-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
591 lines (572 loc) · 23.3 KB
/
.eslintrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
{
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"globals": {
"require": false,
"module": false
},
"rules": {
// These rules relate to possible syntax or logic errors in JavaScript code:
// disallow assignment operators in conditional expressions.
"no-cond-assign": "error",
// disallow the use of console.
"no-console": "warn",
// disallow constant expressions in conditions.
"no-constant-condition": "error",
// disallow control characters in regular expressions.
"no-control-regex": "error",
// disallow the use of debugger.
"no-debugger": "warn",
// disallow duplicate arguments in function definitions.
"no-dupe-args": "error",
// disallow duplicate keys in object literals.
"no-dupe-keys": "error",
// disallow duplicate case labels.
"no-duplicate-case": "error",
// disallow empty block statements.
"no-empty": "error",
// disallow empty character classes in regular expressions.
"no-empty-character-class": "error",
// disallow reassigning exceptions in catch clauses.
"no-ex-assign": "error",
// disallow unnecessary boolean casts.
"no-extra-boolean-cast": "error",
// disallow unnecessary parentheses.
"no-extra-parens": "error",
// disallow unnecessary semicolons.
"no-extra-semi": "error",
// disallow reassigning function declarations.
"no-func-assign": "error",
// disallow function or var declarations in nested blocks.
"no-inner-declarations": "error",
// disallow invalid regular expression strings in RegExp constructors.
"no-invalid-regexp": "error",
// disallow irregular whitespace outside of strings and comments.
"no-irregular-whitespace": "error",
// disallow negating the left operand in in expressions.
"no-negated-in-lhs": "error",
// disallow calling global object properties as functions.
"no-obj-calls": "error",
// disallow use of Object.prototypes builtins directly.
"no-prototype-builtins": "error",
// disallow multiple spaces in regular expression literals.
"no-regex-spaces": "error",
// disallow sparse arrays.
"no-sparse-arrays": "error",
// disallow confusing multiline expressions.
"no-unexpected-multiline": "error",
// disallow unreachable code after return, throw, continue, and break statements.
"no-unreachable": "error",
// disallow control flow statements in finally blocks.
"no-unsafe-finally": "error",
// require calls to isNaN() when checking for NaN.
"use-isnan": "error",
// enforce valid JSDoc comments.
"valid-jsdoc": "error",
// enforce comparing typeof expressions against valid strings.
"valid-typeof": "error",
// These rules relate to better ways of doing things to help you avoid problems:
// enforce getter and setter pairs in objects.
"accessor-pairs": "error",
// enforce return statements in callbacks of array methods.
"array-callback-return": "error",
// enforce the use of variables within the scope they are defined.
"block-scoped-var": "error",
// enforce a maximum cyclomatic complexity allowed in a program.
"complexity": "off",
// require return statements to either always or never specify values.
"consistent-return": "error",
// enforce consistent brace style for all control statements.
"curly": "error",
// require default cases in switch statements.
"default-case": "error",
// enforce consistent newlines before and after dots.
"dot-location": [
"error",
"property"
],
// enforce dot notation whenever possible.
"dot-notation": "error",
// require the use of === and !==.
"eqeqeq": "error",
// require for-in loops to include an if statement.
"guard-for-in": "error",
// disallow the use of alert, confirm, and prompt.
"no-alert": "error",
// disallow the use of arguments.caller or arguments.callee.
"no-caller": "error",
// disallow lexical declarations in case clauses.
"no-case-declarations": "error",
// disallow division operators explicitly at the beginning of regular expressions.
"no-div-regex": "error",
// disallow else blocks after return statements in if statements.
"no-else-return": "off",
// disallow empty functions.
"no-empty-function": "error",
// disallow empty destructuring patterns.
"no-empty-pattern": "error",
// disallow null comparisons without type-checking operators.
"no-eq-null": "error",
// disallow the use of eval().
"no-eval": "error",
// disallow extending native types.
"no-extend-native": "error",
// disallow unnecessary calls to .bind().
"no-extra-bind": "error",
// disallow unnecessary labels.
"no-extra-label": "error",
// disallow fallthrough of case statements.
"no-fallthrough": "error",
// disallow leading or trailing decimal points in numeric literals.
"no-floating-decimal": "error",
// disallow shorthand type conversions.
"no-implicit-coercion": "error",
// disallow var and named function declarations in the global scope.
"no-implicit-globals": "error",
// disallow the use of eval()-like methods.
"no-implied-eval": "error",
// disallow this keywords outside of classes or class-like objects.
"no-invalid-this": "off",
// disallow the use of the __iterator__ property.
"no-iterator": "error",
// disallow labeled statements.
"no-labels": "error",
// disallow unnecessary nested blocks.
"no-lone-blocks": "error",
// disallow function declarations and expressions inside loop statements.
"no-loop-func": "error",
// disallow magic numbers.
"no-magic-numbers": [
"error",
{
"ignore": [1]
}
],
// disallow multiple spaces.
"no-multi-spaces": [
"error",
{
"exceptions": {
"Property": true,
"VariableDeclarator": true,
"ImportDeclaration": true
}
}
],
// disallow multiline strings.
"no-multi-str": "error",
// disallow assignments to native objects or read-only global variables.
"no-native-reassign": "error",
// disallow new operators outside of assignments or comparisons.
"no-new": "error",
// disallow new operators with the Function object.
"no-new-func": "error",
// disallow new operators with the String, Number, and Boolean objects.
"no-new-wrappers": "error",
// disallow octal literals.
"no-octal": "error",
// disallow octal escape sequences in string literals.
"no-octal-escape": "error",
// disallow reassigning function parameters.
"no-param-reassign": [
"error",
{
"props": false
}
],
// disallow the use of the __proto__ property.
"no-proto": "error",
// disallow var redeclaration.
"no-redeclare": "error",
// disallow assignment operators in return statements.
"no-return-assign": "error",
// disallow javascript: urls.
"no-script-url": "error",
// disallow assignments where both sides are exactly the same.
"no-self-assign": "error",
// disallow comparisons where both sides are exactly the same.
"no-self-compare": "error",
// disallow comma operators.
"no-sequences": "error",
// disallow throwing literals as exceptions.
"no-throw-literal": "off",
// disallow unmodified loop conditions.
"no-unmodified-loop-condition": "error",
// disallow unused expressions.
"no-unused-expressions": "error",
// disallow unused labels.
"no-unused-labels": "error",
// disallow unnecessary calls to .call() and .apply().
"no-useless-call": "error",
// disallow unnecessary concatenation of literals or template literals.
"no-useless-concat": "error",
// disallow unnecessary escape characters.
"no-useless-escape": "error",
// disallow void operators.
"no-void": "error",
// disallow specified warning terms in comments.
"no-warning-comments": "error",
// disallow with statements.
"no-with": "error",
// enforce the consistent use of the radix argument when using parseInt().
"radix": "error",
// require var declarations be placed at the top of their containing scope.
"vars-on-top": "error",
// require parentheses around immediate function invocations.
"wrap-iife": "error",
// require or disallow “Yoda” conditions.
"yoda": [
"error",
"never"
],
// These rules relate to strict mode directives:
// require or disallow strict mode directives.
"strict": "error",
// These rules relate to variable declarations:
// require or disallow initialization in var declarations.
"init-declarations": "error",
// disallow catch clause parameters from shadowing variables in the outer scope.
"no-catch-shadow": "off",
// disallow deleting variables.
"no-delete-var": "error",
// disallow labels that share a name with a variable.
"no-label-var": "error",
// disallow specified global variables.
"no-restricted-globals": "error",
// disallow var declarations from shadowing variables in the outer scope.
"no-shadow": [
"error",
{
"hoist": "all",
"allow": [
"index",
"event",
"error"
]
}
],
// disallow identifiers from shadowing restricted names.
"no-shadow-restricted-names": "error",
// disallow the use of undeclared variables unless mentioned in /*global */ comments.
"no-undef": "error",
// disallow initializing variables to undefined.
"no-undef-init": "error",
// disallow the use of undefined as an identifier.
"no-undefined": "off",
// disallow unused variables.
"no-unused-vars": "warn",
// disallow the use of variables before they are defined.
"no-use-before-define": "error",
// These rules relate to code running in Node.js, or in browsers with CommonJS:
// require return statements after callbacks.
"callback-return": "error",
// require require() calls to be placed at top-level module scope.
"global-require": "off",
// require error handling in callbacks.
"handle-callback-err": "error",
// disallow require calls to be mixed with regular var declarations.
"no-mixed-requires": "error",
// disallow new operators with calls to require.
"no-new-require": "error",
// disallow string concatenation with __dirname and __filename.
"no-path-concat": "error",
// disallow the use of process.env.
"no-process-env": "error",
// disallow the use of process.exit().
"no-process-exit": "error",
// disallow specified modules when loaded by require.
"no-restricted-modules": "error",
// disallow synchronous methods.
"no-sync": "off",
// These rules relate to style guidelines, and are therefore quite subjective:
// enforce consistent spacing inside array brackets.
"array-bracket-spacing": [
"error",
"never"
],
// enforce consistent spacing inside single-line blocks.
"block-spacing": "error",
// enforce consistent brace style for blocks.
"brace-style": [
"error",
"1tbs"
],
// enforce camelcase naming convention.
"camelcase": "off",
// require or disallow trailing commas.
"comma-dangle": "error",
// enforce consistent spacing before and after commas.
"comma-spacing": [
"error",
{
"after": true,
"before": false
}
],
// enforce consistent comma style.
"comma-style": [
"error",
"last"
],
// enforce consistent spacing inside computed property brackets.
"computed-property-spacing": [
"error",
"never"
],
// enforce consistent naming when capturing the current execution context.
"consistent-this": "off",
// enforce at least one newline at the end of files.
"eol-last": "error",
// require or disallow named function expressions.
"func-names": "error",
// enforce the consistent use of either function declarations or expressions.
"func-style": "off",
// disallow specified identifiers.
"id-blacklist": "error",
// enforce minimum and maximum identifier lengths.
"id-length": "off",
// require identifiers to match a specified regular expression.
"id-match": "error",
// enforce consistent indentation.
"indent": [
"error",
2,
{
"VariableDeclarator": {
"var": 2,
"let": 2,
"const": 3
}
}
],
// enforce the consistent use of either double or single quotes in JSX attributes.
"jsx-quotes": "error",
// enforce consistent spacing between keys and values in object literal properties.
"key-spacing": "error",
// enforce consistent spacing before and after keywords.
"keyword-spacing": [
"error",
{
"after": true,
"before": true
}
],
// enforce consistent linebreak style.
"linebreak-style": [
"error",
"unix"
],
// require empty lines around comments.
"lines-around-comment": "error",
// enforce a maximum depth that blocks can be nested.
"max-depth": "error",
// enforce a maximum line length.
"max-len": "off",
// enforce a maximum file length.
"max-lines": "off",
// enforce a maximum depth that callbacks can be nested.
"max-nested-callbacks": "error",
// enforce a maximum number of parameters in function definitions.
"max-params": "warn",
// enforce a maximum number of statements allowed in function blocks.
"max-statements": "warn",
// enforce a maximum number of statements allowed per line.
"max-statements-per-line": "error",
// require constructor function names to begin with a capital letter.
"new-cap": "error",
// require parentheses when invoking a constructor with no arguments.
"new-parens": "error",
// require or disallow an empty line after var declarations.
"newline-after-var": "error",
// require an empty line before return statements.
"newline-before-return": "error",
// require a newline after each call in a method chain.
"newline-per-chained-call": "error",
// disallow Array constructors.
"no-array-constructor": "error",
// disallow bitwise operators.
"no-bitwise": "error",
// disallow continue statements.
"no-continue": "off",
// disallow inline comments after code.
"no-inline-comments": "warn",
// disallow if statements as the only statement in else blocks.
"no-lonely-if": "off",
// disallow mixes of different operators.
"no-mixed-operators": "error",
// disallow mixed spaces and tabs for indentation.
"no-mixed-spaces-and-tabs": "error",
// disallow multiple empty lines.
"no-multiple-empty-lines": [
"error",
{
"max": 3
}
],
// disallow negated conditions.
"no-negated-condition": "off",
// disallow nested ternary expressions.
"no-nested-ternary": "error",
// disallow Object constructors.
"no-new-object": "error",
// disallow the unary operators ++ and --.
"no-plusplus": "off",
// disallow specified syntax.
"no-restricted-syntax": "error",
// disallow spacing between function identifiers and their applications.
"no-spaced-func": "error",
// disallow ternary operators.
"no-ternary": "off",
// disallow trailing whitespace at the end of lines.
"no-trailing-spaces": [
"error",
{
"skipBlankLines": true
}
],
// disallow dangling underscores in identifiers.
"no-underscore-dangle": "off",
// disallow ternary operators when simpler alternatives exist.
"no-unneeded-ternary": "error",
// disallow whitespace before properties.
"no-whitespace-before-property": "error",
// enforce consistent line breaks inside braces.
"object-curly-newline": "error",
// enforce consistent spacing inside braces.
"object-curly-spacing": [
"error",
"always"
],
// enforce placing object properties on separate lines.
"object-property-newline": [
"error",
{
"allowMultiplePropertiesPerLine": true
}
],
// enforce variables to be declared either together or separately in functions.
"one-var": "off",
// require or disallow newlines around var declarations.
"one-var-declaration-per-line": "error",
// require or disallow assignment operator shorthand where possible.
"operator-assignment": "error",
// enforce consistent linebreak style for operators.
"operator-linebreak": "error",
// require or disallow padding within blocks.
"padded-blocks": "error",
// require quotes around object literal property names.
"quote-props": "off",
// enforce the consistent use of either backticks, double, or single quotes.
"quotes": "off",
// require JSDoc comments.
"require-jsdoc": "error",
// require or disallow semicolons instead of ASI.
"semi": "error",
// enforce consistent spacing before and after semicolons.
"semi-spacing": [
"error",
{
"after": true,
"before": false
}
],
// require variables within the same declaration block to be sorted.
"sort-vars": "off",
// enforce consistent spacing before blocks.
"space-before-blocks": "error",
// enforce consistent spacing before function definition opening parenthesis.
"space-before-function-paren": "error",
// enforce consistent spacing inside parentheses.
"space-in-parens": [
"error",
"never"
],
// require spacing around operators.
"space-infix-ops": "error",
// enforce consistent spacing before or after unary operators.
"space-unary-ops": "error",
// enforce consistent spacing after the // or /* in a comment
"spaced-comment": "off",
// require or disallow the Unicode BOM.
"unicode-bom": "error",
// require parenthesis around regex literals.
"wrap-regex": "error",
// These rules relate to ES6, also known as ES2015:
// require braces around arrow function bodies.
"arrow-body-style": "off",
// require parentheses around arrow function arguments.
"arrow-parens": [
"error",
"always"
],
// enforce consistent spacing before and after the arrow in arrow functions.
"arrow-spacing": [
"error",
{
"after": true,
"before": true
}
],
// require super() calls in constructors.
"constructor-super": "error",
// enforce consistent spacing around * operators in generator functions.
"generator-star-spacing": "error",
// disallow reassigning class members.
"no-class-assign": "error",
// disallow arrow functions where they could be confused with comparisons.
"no-confusing-arrow": "off",
// disallow reassigning const variables.
"no-const-assign": "error",
// disallow duplicate class members.
"no-dupe-class-members": "error",
// disallow duplicate module imports.
"no-duplicate-imports": "error",
// disallow new operators with the Symbol object.
"no-new-symbol": "error",
// disallow specified modules when loaded by import.
"no-restricted-imports": "error",
// disallow this/super before calling super() in constructors.
"no-this-before-super": "error",
// disallow unnecessary computed property keys in object literals.
"no-useless-computed-key": "error",
// disallow unnecessary constructors.
"no-useless-constructor": "error",
// disallow renaming import, export, and destructured assignments to the same name.
"no-useless-rename": "error",
// require let or const instead of var.
"no-var": "error",
// require or disallow method and property shorthand syntax for object literals.
"object-shorthand": "error",
// require arrow functions as callbacks.
"prefer-arrow-callback": "error",
// require const declarations for variables that are never reassigned after declared.
"prefer-const": "error",
// require Reflect methods where applicable.
"prefer-reflect": "off",
// require rest parameters instead of arguments.
"prefer-rest-params": "error",
// require spread operators instead of .apply().
"prefer-spread": "error",
// require template literals instead of string concatenation.
"prefer-template": "error",
// require generator functions to contain yield.
"require-yield": "error",
// enforce spacing between rest and spread operators and their expressions.
"rest-spread-spacing": "error",
// enforce sorted import declarations within modules.
"sort-imports": "off",
// require or disallow spacing around embedded expressions of template strings.
"template-curly-spacing": [
"error",
"never"
],
// require or disallow spacing around the * in yield* expressions.
"yield-star-spacing": "error"
}
}