@pplancq/eslint-config 2.2.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/rules/base.js CHANGED
@@ -1,21 +1,680 @@
1
1
  module.exports = {
2
- extends: ['airbnb/base'],
3
- plugins: ['import'],
2
+ extends: ['./import.js'],
4
3
  parserOptions: {
5
4
  ecmaVersion: 'latest',
5
+ sourceType: 'module',
6
+ ecmaFeatures: {
7
+ generators: false,
8
+ objectLiteralDuplicateProperties: false,
9
+ },
6
10
  },
7
11
  env: {
8
12
  browser: true,
9
13
  node: true,
14
+ es6: true,
10
15
  },
11
16
  rules: {
12
- // eslint
17
+ // eslint https://eslint.org
18
+ // Possible Problems - These rules relate to possible logic errors in code
19
+
20
+ // Enforce return statements in callbacks of array methods
21
+ // https://eslint.org/docs/latest/rules/array-callback-return
22
+ 'array-callback-return': ['error', { allowImplicit: true }],
23
+
24
+ // Require super() calls in constructors
25
+ // https://eslint.org/docs/latest/rules/constructor-super
26
+ 'constructor-super': 'error',
27
+
28
+ // Enforce "for" loop update clause moving the counter in the right direction
29
+ // https://eslint.org/docs/latest/rules/for-direction
30
+ 'for-direction': 'error',
31
+
32
+ // Enforce return statements in getters
33
+ // https://eslint.org/docs/latest/rules/getter-return
34
+ 'getter-return': ['error', { allowImplicit: true }],
35
+
36
+ // Disallow using an async function as a Promise executor
37
+ // https://eslint.org/docs/latest/rules/no-async-promise-executor
38
+ 'no-async-promise-executor': 'error',
39
+
40
+ // Disallow await inside of loops
41
+ // https://eslint.org/docs/lates/rules/no-await-in-loop
42
+ 'no-await-in-loop': 'error',
43
+
44
+ // Disallow reassigning class members
45
+ // https://eslint.org/docs/lates/rules/no-class-assign
46
+ 'no-class-assign': 'error',
47
+
48
+ // Disallow comparing against -0
49
+ // https://eslint.org/docs/lates/rules/no-compare-neg-zero
50
+ 'no-compare-neg-zero': 'error',
51
+
52
+ // Disallow assignment operators in conditional expressions
53
+ // https://eslint.org/docs/lates/rules/no-cond-assign
54
+ 'no-cond-assign': ['error', 'always'],
55
+
56
+ // Disallow reassigning const variables
57
+ // https://eslint.org/docs/lates/rules/no-const-assign
58
+ 'no-const-assign': 'error',
59
+
60
+ // Disallow expressions where the operation doesn't affect the value
61
+ // https://eslint.org/docs/lates/rules/no-constant-binary-expression
62
+ 'no-constant-binary-expression': 'off',
63
+
64
+ // Disallow constant expressions in conditions
65
+ // https://eslint.org/docs/lates/rules/no-constant-condition
66
+ 'no-constant-condition': 'warn',
67
+
68
+ // Disallow returning value from constructor
69
+ // https://eslint.org/docs/lates/rules/no-constructor-return
70
+ 'no-constructor-return': 'error',
71
+
72
+ // Disallow control characters in regular expressions
73
+ // https://eslint.org/docs/lates/rules/no-control-regex
74
+ 'no-control-regex': 'error',
75
+
76
+ // Disallow the use of debugger
77
+ // https://eslint.org/docs/lates/rules/no-debugger
78
+ 'no-debugger': 'error',
79
+
80
+ // Disallow duplicate arguments in function definitions
81
+ // https://eslint.org/docs/lates/rules/no-dupe-args
82
+ 'no-dupe-args': 'error',
83
+
84
+ // Disallow duplicate class members
85
+ // https://eslint.org/docs/lates/rules/no-dupe-class-members
86
+ 'no-dupe-class-members': 'error',
87
+
88
+ // Disallow duplicate conditions in if-else-if chains
89
+ // https://eslint.org/docs/lates/rules/no-dupe-else-if
90
+ 'no-dupe-else-if': 'error',
91
+
92
+ // Disallow duplicate keys in object literals
93
+ // https://eslint.org/docs/lates/rules/no-dupe-keys
94
+ 'no-dupe-keys': 'error',
95
+
96
+ // Disallow duplicate case labels
97
+ // https://eslint.org/docs/latest/rules/no-duplicate-case
98
+ 'no-duplicate-case': 'error',
99
+
100
+ // Disallow duplicate module imports
101
+ // https://eslint.org/docs/latest/rules/no-duplicate-imports
102
+ 'no-duplicate-imports': 'off',
103
+
104
+ // Disallow empty character classes in regular expressions
105
+ // https://eslint.org/docs/latest/rules/no-empty-character-class
106
+ 'no-empty-character-class': 'error',
107
+
108
+ // Disallow empty destructuring patterns
109
+ // https://eslint.org/docs/latest/rules/no-empty-pattern
110
+ 'no-empty-pattern': 'error',
111
+
112
+ // Disallow reassigning exceptions in catch clauses
113
+ // https://eslint.org/docs/latest/rules/no-ex-assign
114
+ 'no-ex-assign': 'error',
115
+
116
+ // Disallow fallthrough of case statements
117
+ // https://eslint.org/docs/latest/rules/no-fallthrough
118
+ 'no-fallthrough': 'error',
119
+
120
+ // Disallow reassigning function declarations
121
+ // https://eslint.org/docs/latest/rules/no-func-assign
122
+ 'no-func-assign': 'error',
123
+
124
+ // Disallow assigning to imported bindings
125
+ // https://eslint.org/docs/latest/rules/no-import-assign
126
+ 'no-import-assign': 'error',
127
+
128
+ // Disallow variable or function declarations in nested blocks
129
+ // https://eslint.org/docs/latest/rules/no-inner-declarations
130
+ 'no-inner-declarations': 'error',
131
+
132
+ // Disallow invalid regular expression strings in RegExp constructors
133
+ // https://eslint.org/docs/latest/rules/no-invalid-regexp
134
+ 'no-invalid-regexp': 'error',
135
+
136
+ // Disallow irregular whitespace
137
+ // https://eslint.org/docs/latest/rules/no-irregular-whitespace
138
+ 'no-irregular-whitespace': 'error',
139
+
140
+ // Disallow literal numbers that lose precision
141
+ // https://eslint.org/docs/latest/rules/no-loss-of-precision
142
+ 'no-loss-of-precision': 'error',
143
+
144
+ // Disallow characters which are made with multiple code points in character class syntax
145
+ // https://eslint.org/docs/latest/rules/no-misleading-character-class
146
+ 'no-misleading-character-class': 'error',
147
+
148
+ // Disallow new operators with global non-constructor functions
149
+ // https://eslint.org/docs/latest/rules/no-new-native-nonconstructor
150
+ 'no-new-native-nonconstructor': 'off',
151
+
152
+ // Disallow new operators with the Symbol object
153
+ // https://eslint.org/docs/latest/rules/no-new-symbol
154
+ 'no-new-symbol': 'error',
155
+
156
+ // Disallow calling global object properties as functions
157
+ // https://eslint.org/docs/latest/rules/no-obj-calls
158
+ 'no-obj-calls': 'error',
159
+
160
+ // Disallow returning values from Promise executor functions
161
+ // https://eslint.org/docs/latest/rules/no-promise-executor-return
162
+ 'no-promise-executor-return': 'error',
163
+
164
+ // Disallow calling some Object.prototype methods directly on objects
165
+ // https://eslint.org/docs/latest/rules/no-prototype-builtins
166
+ 'no-prototype-builtins': 'error',
167
+
168
+ // Disallow assignments where both sides are exactly the same
169
+ // https://eslint.org/docs/latest/rules/no-self-assign
170
+ 'no-self-assign': [
171
+ 'error',
172
+ {
173
+ props: true,
174
+ },
175
+ ],
176
+
177
+ // Disallow comparisons where both sides are exactly the same
178
+ // https://eslint.org/docs/latest/rules/no-self-compare
179
+ 'no-self-compare': 'error',
180
+
181
+ // Disallow returning values from setters
182
+ // https://eslint.org/docs/latest/rules/no-setter-return
183
+ 'no-setter-return': 'error',
184
+
185
+ // Disallow sparse arrays
186
+ // https://eslint.org/docs/latest/rules/no-sparse-arrays
187
+ 'no-sparse-arrays': 'error',
188
+
189
+ // Disallow template literal placeholder syntax in regular strings
190
+ // https://eslint.org/docs/latest/rules/no-template-curly-in-string
191
+ 'no-template-curly-in-string': 'error',
192
+
193
+ // Disallow this/super before calling super() in constructors
194
+ // https://eslint.org/docs/latest/rules/no-this-before-super
195
+ 'no-this-before-super': 'error',
196
+
197
+ // Disallow the use of undeclared variables unless mentioned in /*global */ comments
198
+ // https://eslint.org/docs/latest/rules/no-undef
199
+ 'no-undef': 'error',
200
+
201
+ // Disallow confusing multiline expressions
202
+ // https://eslint.org/docs/latest/rules/no-unexpected-multiline
203
+ 'no-unexpected-multiline': 'error',
204
+
205
+ // Disallow unmodified loop conditions
206
+ // https://eslint.org/docs/latest/rules/no-unmodified-loop-condition
207
+ 'no-unmodified-loop-condition': 'off',
208
+
209
+ // Disallow unreachable code after return, throw, continue, and break statements
210
+ // https://eslint.org/docs/latest/rules/no-unreachable
211
+ 'no-unreachable': 'error',
212
+
213
+ // Disallow loops with a body that allows only one iteration
214
+ // https://eslint.org/docs/latest/rules/no-unreachable-loop
215
+ 'no-unreachable-loop': [
216
+ 'error',
217
+ {
218
+ ignore: [],
219
+ },
220
+ ],
221
+
222
+ // Disallow control flow statements in finally blocks
223
+ // https://eslint.org/docs/latest/rules/no-unsafe-finally
224
+ 'no-unsafe-finally': 'error',
225
+
226
+ // Disallow negating the left operand of relational operators
227
+ // https://eslint.org/docs/latest/rules/no-unsafe-negation
228
+ 'no-unsafe-negation': 'error',
229
+
230
+ // Disallow use of optional chaining in contexts where the undefined value is not allowed
231
+ // https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining
232
+ 'no-unsafe-optional-chaining': ['error', { disallowArithmeticOperators: true }],
233
+
234
+ // Disallow unused private class members
235
+ // https://eslint.org/docs/latest/rules/no-unused-private-class-members
236
+ 'no-unused-private-class-members': 'off',
237
+
238
+ // Disallow unused variables
239
+ // https://eslint.org/docs/latest/rules/no-unused-vars
240
+ 'no-unused-vars': ['error', { vars: 'all', args: 'after-used', ignoreRestSiblings: true }],
241
+
242
+ // Disallow the use of variables before they are defined
243
+ // https://eslint.org/docs/latest/rules/no-use-before-define
244
+ 'no-use-before-define': ['error', { functions: true, classes: true, variables: true }],
245
+
246
+ // Disallow useless backreferences in regular expressions
247
+ // https://eslint.org/docs/latest/rules/no-useless-backreference
248
+ 'no-useless-backreference': 'error',
249
+
250
+ // Disallow assignments that can lead to race conditions due to usage of await or yield
251
+ // https://eslint.org/docs/latest/rules/require-atomic-updates
252
+ 'require-atomic-updates': 'off',
253
+
254
+ // Require calls to isNaN() when checking for NaN
255
+ // https://eslint.org/docs/latest/rules/use-isnan
256
+ 'use-isnan': 'error',
257
+
258
+ // Enforce comparing typeof expressions against valid strings
259
+ // https://eslint.org/docs/latest/rules/valid-typeof
260
+ 'valid-typeof': ['error', { requireStringLiterals: true }],
261
+
262
+ // Suggestions - These rules suggest alternate ways of doing things
263
+
264
+ // Enforce getter and setter pairs in objects and classes
265
+ // https://eslint.org/docs/latest/rules/accessor-pairs
266
+ 'accessor-pairs': 'off',
267
+
268
+ // Require braces around arrow function bodies
269
+ // https://eslint.org/docs/latest/rules/arrow-body-style
270
+ 'arrow-body-style': [
271
+ 'error',
272
+ 'as-needed',
273
+ {
274
+ requireReturnForObjectLiteral: false,
275
+ },
276
+ ],
277
+
278
+ // Enforce the use of variables within the scope they are defined
279
+ // https://eslint.org/docs/latest/rules/block-scoped-var
280
+ 'block-scoped-var': 'error',
281
+
282
+ // Enforce camelcase naming convention
283
+ // https://eslint.org/docs/latest/rules/camelcase
284
+ camelcase: ['error', { properties: 'never', ignoreDestructuring: false }],
285
+
286
+ // Enforce or disallow capitalization of the first letter of a comment
287
+ // https://eslint.org/docs/latest/rules/capitalized-comments
288
+ 'capitalized-comments': [
289
+ 'off',
290
+ 'never',
291
+ {
292
+ line: {
293
+ ignorePattern: '.*',
294
+ ignoreInlineComments: true,
295
+ ignoreConsecutiveComments: true,
296
+ },
297
+ block: {
298
+ ignorePattern: '.*',
299
+ ignoreInlineComments: true,
300
+ ignoreConsecutiveComments: true,
301
+ },
302
+ },
303
+ ],
304
+
305
+ // Enforce that class methods utilize this
306
+ // https://eslint.org/docs/latest/rules/class-methods-use-this
307
+ 'class-methods-use-this': [
308
+ 'error',
309
+ {
310
+ exceptMethods: [],
311
+ },
312
+ ],
313
+
314
+ // Enforce a maximum cyclomatic complexity allowed in a program
315
+ // https://eslint.org/docs/latest/rules/complexity
316
+ complexity: ['off', 20],
317
+
318
+ // Require return statements to either always or never specify values
319
+ // https://eslint.org/docs/latest/rules/consistent-return
320
+ 'consistent-return': 'error',
321
+
322
+ // Enforce consistent naming when capturing the current execution context
323
+ // https://eslint.org/docs/latest/rules/consistent-this
324
+ 'consistent-this': 'off',
325
+
326
+ // Enforce consistent brace style for all control statements
327
+ // https://eslint.org/docs/latest/rules/curly
328
+ curly: ['error', 'multi-line'],
329
+
330
+ // Require default cases in switch statements
331
+ // https://eslint.org/docs/latest/rules/default-case
332
+ 'default-case': ['error', { commentPattern: '^no default$' }],
333
+
334
+ // Enforce default clauses in switch statements to be last
335
+ // https://eslint.org/docs/latest/rules/default-case-last
336
+ 'default-case-last': 'error',
337
+
338
+ // Enforce default parameters to be last
339
+ // https://eslint.org/docs/latest/rules/default-param-last
340
+ 'default-param-last': 'error',
341
+
342
+ // Enforce dot notation whenever possible
343
+ // https://eslint.org/docs/latest/rules/dot-notation
344
+ 'dot-notation': ['error', { allowKeywords: true }],
345
+
346
+ // Require the use of === and !==
347
+ // https://eslint.org/docs/latest/rules/eqeqeq
348
+ eqeqeq: ['error', 'always', { null: 'ignore' }],
349
+
350
+ // Require function names to match the name of the variable or property to which they are assigned
351
+ // https://eslint.org/docs/latest/rules/func-name-matching
352
+ 'func-name-matching': [
353
+ 'off',
354
+ 'always',
355
+ {
356
+ includeCommonJSModuleExports: false,
357
+ considerPropertyDescriptor: true,
358
+ },
359
+ ],
360
+
361
+ // Require or disallow named function expressions
362
+ // https://eslint.org/docs/latest/rules/func-names
363
+ 'func-names': 'warn',
364
+
365
+ // Enforce the consistent use of either function declarations or expressions
366
+ // https://eslint.org/docs/latest/rules/func-style
367
+ 'func-style': ['off', 'expression'],
368
+
369
+ // Require grouped accessor pairs in object literals and classes
370
+ // https://eslint.org/docs/latest/rules/grouped-accessor-pairs
371
+ 'grouped-accessor-pairs': 'error',
372
+
373
+ // Require for-in loops to include an if statement
374
+ // https://eslint.org/docs/latest/rules/guard-for-in
375
+ 'guard-for-in': 'error',
376
+
377
+ // Disallow specified identifiers
378
+ // https://eslint.org/docs/latest/rules/id-denylist
379
+ 'id-denylist': 'off',
380
+
381
+ // Enforce minimum and maximum identifier lengths
382
+ // https://eslint.org/docs/latest/rules/id-length
383
+ 'id-length': 'off',
384
+
385
+ // Require identifiers to match a specified regular expression
386
+ // https://eslint.org/docs/latest/rules/id-match
387
+ 'id-match': 'off',
388
+
389
+ // Require or disallow initialization in variable declarations
390
+ // https://eslint.org/docs/latest/rules/init-declarations
391
+ 'init-declarations': 'off',
392
+
393
+ // Require or disallow logical assignment operator shorthand
394
+ // https://eslint.org/docs/latest/rules/logical-assignment-operators
395
+ 'logical-assignment-operators': 'off',
396
+
397
+ // Enforce a maximum number of classes per file
398
+ // https://eslint.org/docs/latest/rules/max-classes-per-file
399
+ 'max-classes-per-file': ['error', 1],
400
+
401
+ // Enforce a maximum depth that blocks can be nested
402
+ // https://eslint.org/docs/latest/rules/max-depth
403
+ 'max-depth': ['off', 4],
404
+
405
+ // Enforce a maximum number of lines per file
406
+ // https://eslint.org/docs/latest/rules/max-lines
407
+ 'max-lines': [
408
+ 'off',
409
+ {
410
+ max: 300,
411
+ skipBlankLines: true,
412
+ skipComments: true,
413
+ },
414
+ ],
415
+
416
+ // Enforce a maximum number of lines of code in a function
417
+ // https://eslint.org/docs/latest/rules/max-lines-per-function
418
+ 'max-lines-per-function': [
419
+ 'off',
420
+ {
421
+ max: 50,
422
+ skipBlankLines: true,
423
+ skipComments: true,
424
+ IIFEs: true,
425
+ },
426
+ ],
427
+
428
+ // Enforce a maximum depth that callbacks can be nested
429
+ // https://eslint.org/docs/latest/rules/max-nested-callbacks
430
+ 'max-nested-callbacks': 'off',
431
+
432
+ // Enforce a maximum number of parameters in function definitions
433
+ // https://eslint.org/docs/latest/rules/max-params
434
+ 'max-params': ['off', 3],
435
+
436
+ // Enforce a maximum number of statements allowed in function blocks
437
+ // https://eslint.org/docs/latest/rules/max-statements
438
+ 'max-statements': ['off', 10],
439
+
440
+ // Enforce a particular style for multiline comments
441
+ // https://eslint.org/docs/latest/rules/multiline-comment-style
442
+ 'multiline-comment-style': ['off', 'starred-block'],
443
+
444
+ // Require constructor names to begin with a capital letter
445
+ // https://eslint.org/docs/latest/rules/new-cap
446
+ 'new-cap': [
447
+ 'error',
448
+ {
449
+ newIsCap: true,
450
+ newIsCapExceptions: [],
451
+ capIsNew: false,
452
+ capIsNewExceptions: ['Immutable.Map', 'Immutable.Set', 'Immutable.List'],
453
+ },
454
+ ],
455
+
456
+ // Disallow the use of alert, confirm, and prompt
457
+ // https://eslint.org/docs/latest/rules/no-alert
458
+ 'no-alert': 'warn',
459
+
460
+ // Disallow Array constructors
461
+ // https://eslint.org/docs/latest/rules/no-array-constructor
462
+ 'no-array-constructor': 'error',
463
+
464
+ // Disallow bitwise operators
465
+ // https://eslint.org/docs/latest/rules/no-bitwise
466
+ 'no-bitwise': 'error',
467
+
468
+ // Disallow the use of arguments.caller or arguments.callee
469
+ // https://eslint.org/docs/latest/rules/no-caller
470
+ 'no-caller': 'error',
471
+
472
+ // Disallow lexical declarations in case clauses
473
+ // https://eslint.org/docs/latest/rules/no-case-declarations
474
+ 'no-case-declarations': 'error',
475
+
476
+ // Disallow the use of console
477
+ // https://eslint.org/docs/latest/rules/no-console
13
478
  'no-console': [
14
479
  'error',
15
480
  {
16
481
  allow: ['info', 'warn', 'error'],
17
482
  },
18
483
  ],
484
+
485
+ // Disallow continue statements
486
+ // https://eslint.org/docs/latest/rules/no-continue
487
+ 'no-continue': 'error',
488
+
489
+ // Disallow deleting variables
490
+ // https://eslint.org/docs/latest/rules/no-delete-var
491
+ 'no-delete-var': 'error',
492
+
493
+ // Disallow equal signs explicitly at the beginning of regular expressions
494
+ // https://eslint.org/docs/latest/rules/no-div-regex
495
+ 'no-div-regex': 'off',
496
+
497
+ // Disallow else blocks after return statements in if statements
498
+ // https://eslint.org/docs/latest/rules/no-else-return
499
+ 'no-else-return': ['error', { allowElseIf: false }],
500
+
501
+ // Disallow empty block statements
502
+ // https://eslint.org/docs/latest/rules/no-empty
503
+ 'no-empty': 'error',
504
+
505
+ // Disallow empty functions
506
+ // https://eslint.org/docs/latest/rules/no-empty-function
507
+ 'no-empty-function': [
508
+ 'error',
509
+ {
510
+ allow: ['arrowFunctions', 'functions', 'methods'],
511
+ },
512
+ ],
513
+
514
+ // Disallow empty static blocks
515
+ // https://eslint.org/docs/latest/rules/no-empty-static-block
516
+ 'no-empty-static-block': 'off',
517
+
518
+ // Disallow null comparisons without type-checking operators
519
+ // https://eslint.org/docs/latest/rules/no-eq-null
520
+ 'no-eq-null': 'off',
521
+
522
+ // Disallow the use of eval()
523
+ // https://eslint.org/docs/latest/rules/no-eval
524
+ 'no-eval': 'error',
525
+
526
+ // Disallow extending native types
527
+ // https://eslint.org/docs/latest/rules/no-extend-native
528
+ 'no-extend-native': 'error',
529
+
530
+ // Disallow unnecessary calls to .bind()
531
+ // https://eslint.org/docs/latest/rules/no-extra-bind
532
+ 'no-extra-bind': 'error',
533
+
534
+ // Disallow unnecessary boolean casts
535
+ // https://eslint.org/docs/latest/rules/no-extra-boolean-cast
536
+ 'no-extra-boolean-cast': 'error',
537
+
538
+ // Disallow unnecessary labels
539
+ // https://eslint.org/docs/latest/rules/no-extra-label
540
+ 'no-extra-label': 'error',
541
+
542
+ // Disallow assignments to native objects or read-only global variables
543
+ // https://eslint.org/docs/latest/rules/no-global-assign
544
+ 'no-global-assign': ['error', { exceptions: [] }],
545
+
546
+ // Disallow shorthand type conversions
547
+ // https://eslint.org/docs/latest/rules/no-implicit-coercion
548
+ 'no-implicit-coercion': [
549
+ 'off',
550
+ {
551
+ boolean: false,
552
+ number: true,
553
+ string: true,
554
+ allow: [],
555
+ },
556
+ ],
557
+
558
+ // Disallow declarations in the global scope
559
+ // https://eslint.org/docs/latest/rules/no-implicit-globals
560
+ 'no-implicit-globals': 'off',
561
+
562
+ // Disallow the use of eval()-like methods
563
+ // https://eslint.org/docs/latest/rules/no-implied-eval
564
+ 'no-implied-eval': 'error',
565
+
566
+ // Disallow inline comments after code
567
+ // https://eslint.org/docs/latest/rules/no-inline-comments
568
+ 'no-inline-comments': 'off',
569
+
570
+ // Disallow use of this in contexts where the value of this is undefined
571
+ // https://eslint.org/docs/latest/rules/no-invalid-this
572
+ 'no-invalid-this': 'off',
573
+
574
+ // Disallow the use of the __iterator__ property
575
+ // https://eslint.org/docs/latest/rules/no-iterator
576
+ 'no-iterator': 'error',
577
+
578
+ // Disallow labels that share a name with a variable
579
+ // https://eslint.org/docs/latest/rules/no-label-var
580
+ 'no-label-var': 'error',
581
+
582
+ // Disallow labeled statements
583
+ // https://eslint.org/docs/latest/rules/no-labels
584
+ 'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
585
+
586
+ // Disallow unnecessary nested blocks
587
+ // https://eslint.org/docs/latest/rules/no-lone-blocks
588
+ 'no-lone-blocks': 'error',
589
+
590
+ // Disallow if statements as the only statement in else blocks
591
+ // https://eslint.org/docs/latest/rules/no-lonely-if
592
+ 'no-lonely-if': 'error',
593
+
594
+ // Disallow function declarations that contain unsafe references inside loop statements
595
+ // https://eslint.org/docs/latest/rules/no-loop-func
596
+ 'no-loop-func': 'error',
597
+
598
+ // Disallow magic numbers
599
+ // https://eslint.org/docs/latest/rules/no-magic-numbers
600
+ 'no-magic-numbers': [
601
+ 'off',
602
+ {
603
+ ignore: [],
604
+ ignoreArrayIndexes: true,
605
+ enforceConst: true,
606
+ detectObjects: false,
607
+ },
608
+ ],
609
+
610
+ // Disallow use of chained assignment expressions
611
+ // https://eslint.org/docs/latest/rules/no-multi-assign
612
+ 'no-multi-assign': ['error'],
613
+
614
+ // Disallow multiline strings
615
+ // https://eslint.org/docs/latest/rules/no-multi-str
616
+ 'no-multi-str': 'error',
617
+
618
+ // Disallow negated conditions
619
+ // https://eslint.org/docs/latest/rules/no-negated-condition
620
+ 'no-negated-condition': 'off',
621
+
622
+ // Disallow nested ternary expressions
623
+ // https://eslint.org/docs/latest/rules/no-nested-ternary
624
+ 'no-nested-ternary': 'error',
625
+
626
+ // Disallow new operators outside of assignments or comparisons
627
+ // https://eslint.org/docs/latest/rules/no-new
628
+ 'no-new': 'error',
629
+
630
+ // Disallow new operators with the Function object
631
+ // https://eslint.org/docs/latest/rules/no-new-func
632
+ 'no-new-func': 'error',
633
+
634
+ // Disallow new operators with the String, Number, and Boolean objects
635
+ // https://eslint.org/docs/latest/rules/no-new-wrappers
636
+ 'no-new-wrappers': 'error',
637
+
638
+ // Disallow \8 and \9 escape sequences in string literals
639
+ // https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape
640
+ 'no-nonoctal-decimal-escape': 'error',
641
+
642
+ // Disallow calls to the Object constructor without an argument
643
+ // https://eslint.org/docs/latest/rules/no-object-constructor
644
+ 'no-object-constructor': 'off',
645
+
646
+ // Disallow octal literals
647
+ // https://eslint.org/docs/latest/rules/no-octal
648
+ 'no-octal': 'error',
649
+
650
+ // Disallow octal escape sequences in string literals
651
+ // https://eslint.org/docs/latest/rules/no-octal-escape
652
+ 'no-octal-escape': 'error',
653
+
654
+ //
655
+ //
656
+ 'no-param-reassign': [
657
+ 'error',
658
+ {
659
+ props: true,
660
+ ignorePropertyModificationsFor: [
661
+ 'acc',
662
+ 'accumulator',
663
+ 'e',
664
+ 'ctx',
665
+ 'context',
666
+ 'req',
667
+ 'request',
668
+ 'res',
669
+ 'response',
670
+ '$scope',
671
+ 'staticContext',
672
+ ],
673
+ },
674
+ ],
675
+
676
+ // Disallow the unary operators ++ and --
677
+ // https://eslint.org/docs/latest/rules/no-plusplus
19
678
  'no-plusplus': [
20
679
  'error',
21
680
  {
@@ -23,15 +682,774 @@ module.exports = {
23
682
  },
24
683
  ],
25
684
 
26
- // eslint-plugin-import https://github.com/import-js/eslint-plugin-import
27
- 'import/prefer-default-export': 'off',
28
- 'import/no-default-export': 'error',
29
- },
30
- settings: {
31
- 'import/resolver': {
32
- node: {
33
- extensions: ['.js'],
685
+ // Disallow the use of the __proto__ property
686
+ // https://eslint.org/docs/latest/rules/no-proto
687
+ 'no-proto': 'error',
688
+
689
+ // Disallow variable redeclaration
690
+ // https://eslint.org/docs/latest/rules/no-redeclare
691
+ 'no-redeclare': 'error',
692
+
693
+ // Disallow multiple spaces in regular expressions
694
+ // https://eslint.org/docs/latest/rules/no-regex-spaces
695
+ 'no-regex-spaces': 'error',
696
+
697
+ // Disallow specified names in exports
698
+ // https://eslint.org/docs/latest/rules/no-restricted-exports
699
+ 'no-restricted-exports': [
700
+ 'error',
701
+ {
702
+ restrictedNamedExports: ['default', 'then'],
34
703
  },
35
- },
704
+ ],
705
+
706
+ // Disallow specified global variables
707
+ // https://eslint.org/docs/latest/rules/no-restricted-globals
708
+ 'no-restricted-globals': [
709
+ 'error',
710
+ {
711
+ name: 'isFinite',
712
+ message: 'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
713
+ },
714
+ {
715
+ name: 'isNaN',
716
+ message: 'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
717
+ },
718
+ 'addEventListener',
719
+ 'blur',
720
+ 'close',
721
+ 'closed',
722
+ 'confirm',
723
+ 'defaultStatus',
724
+ 'defaultstatus',
725
+ 'event',
726
+ 'external',
727
+ 'find',
728
+ 'focus',
729
+ 'frameElement',
730
+ 'frames',
731
+ 'history',
732
+ 'innerHeight',
733
+ 'innerWidth',
734
+ 'length',
735
+ 'location',
736
+ 'locationbar',
737
+ 'menubar',
738
+ 'moveBy',
739
+ 'moveTo',
740
+ 'name',
741
+ 'onblur',
742
+ 'onerror',
743
+ 'onfocus',
744
+ 'onload',
745
+ 'onresize',
746
+ 'onunload',
747
+ 'open',
748
+ 'opener',
749
+ 'opera',
750
+ 'outerHeight',
751
+ 'outerWidth',
752
+ 'pageXOffset',
753
+ 'pageYOffset',
754
+ 'parent',
755
+ 'print',
756
+ 'removeEventListener',
757
+ 'resizeBy',
758
+ 'resizeTo',
759
+ 'screen',
760
+ 'screenLeft',
761
+ 'screenTop',
762
+ 'screenX',
763
+ 'screenY',
764
+ 'scroll',
765
+ 'scrollbars',
766
+ 'scrollBy',
767
+ 'scrollTo',
768
+ 'scrollX',
769
+ 'scrollY',
770
+ 'self',
771
+ 'status',
772
+ 'statusbar',
773
+ 'stop',
774
+ 'toolbar',
775
+ 'top',
776
+ ],
777
+
778
+ // Disallow specified modules when loaded by import
779
+ // https://eslint.org/docs/latest/rules/no-restricted-imports
780
+ 'no-restricted-imports': [
781
+ 'off',
782
+ {
783
+ paths: [],
784
+ patterns: [],
785
+ },
786
+ ],
787
+
788
+ // Disallow certain properties on certain objects
789
+ // https://eslint.org/docs/latest/rules/no-restricted-properties
790
+ 'no-restricted-properties': [
791
+ 'error',
792
+ {
793
+ object: 'arguments',
794
+ property: 'callee',
795
+ message: 'arguments.callee is deprecated',
796
+ },
797
+ {
798
+ object: 'global',
799
+ property: 'isFinite',
800
+ message: 'Please use Number.isFinite instead',
801
+ },
802
+ {
803
+ object: 'self',
804
+ property: 'isFinite',
805
+ message: 'Please use Number.isFinite instead',
806
+ },
807
+ {
808
+ object: 'window',
809
+ property: 'isFinite',
810
+ message: 'Please use Number.isFinite instead',
811
+ },
812
+ {
813
+ object: 'global',
814
+ property: 'isNaN',
815
+ message: 'Please use Number.isNaN instead',
816
+ },
817
+ {
818
+ object: 'self',
819
+ property: 'isNaN',
820
+ message: 'Please use Number.isNaN instead',
821
+ },
822
+ {
823
+ object: 'window',
824
+ property: 'isNaN',
825
+ message: 'Please use Number.isNaN instead',
826
+ },
827
+ {
828
+ property: '__defineGetter__',
829
+ message: 'Please use Object.defineProperty instead.',
830
+ },
831
+ {
832
+ property: '__defineSetter__',
833
+ message: 'Please use Object.defineProperty instead.',
834
+ },
835
+ {
836
+ object: 'Math',
837
+ property: 'pow',
838
+ message: 'Use the exponentiation operator (**) instead.',
839
+ },
840
+ ],
841
+
842
+ // Disallow specified syntax
843
+ // https://eslint.org/docs/latest/rules/no-restricted-syntax
844
+ 'no-restricted-syntax': [
845
+ 'error',
846
+ {
847
+ selector: 'ForInStatement',
848
+ message:
849
+ 'for..in loops iterate over the entire prototype chain, which is virtually never what you want. Use Object.{keys,values,entries}, and iterate over the resulting array.',
850
+ },
851
+ {
852
+ selector: 'ForOfStatement',
853
+ message:
854
+ 'iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations.',
855
+ },
856
+ {
857
+ selector: 'LabeledStatement',
858
+ message: 'Labels are a form of GOTO; using them makes code confusing and hard to maintain and understand.',
859
+ },
860
+ {
861
+ selector: 'WithStatement',
862
+ message: '`with` is disallowed in strict mode because it makes code impossible to predict and optimize.',
863
+ },
864
+ ],
865
+
866
+ // Disallow assignment operators in return statements
867
+ // https://eslint.org/docs/latest/rules/no-return-assign
868
+ 'no-return-assign': ['error', 'always'],
869
+
870
+ // Disallow javascript: urls
871
+ // https://eslint.org/docs/latest/rules/no-script-url
872
+ 'no-script-url': 'error',
873
+
874
+ // Disallow comma operators
875
+ // https://eslint.org/docs/latest/rules/no-sequences
876
+ 'no-sequences': 'error',
877
+
878
+ // Disallow variable declarations from shadowing variables declared in the outer scope
879
+ // https://eslint.org/docs/latest/rules/no-shadow
880
+ 'no-shadow': 'error',
881
+
882
+ // Disallow identifiers from shadowing restricted names
883
+ // https://eslint.org/docs/latest/rules/no-shadow-restricted-names
884
+ 'no-shadow-restricted-names': 'error',
885
+
886
+ // Disallow ternary operators
887
+ // https://eslint.org/docs/latest/rules/no-ternary
888
+ 'no-ternary': 'off',
889
+
890
+ // Disallow throwing literals as exceptions
891
+ // https://eslint.org/docs/latest/rules/no-throw-literal
892
+ 'no-throw-literal': 'error',
893
+
894
+ // Disallow initializing variables to undefined
895
+ // https://eslint.org/docs/latest/rules/no-undef-init
896
+ 'no-undef-init': 'error',
897
+
898
+ // Disallow the use of undefined as an identifier
899
+ // https://eslint.org/docs/latest/rules/no-undefined
900
+ 'no-undefined': 'off',
901
+
902
+ // Disallow dangling underscores in identifiers
903
+ // https://eslint.org/docs/latest/rules/no-underscore-dangle
904
+ 'no-underscore-dangle': [
905
+ 'error',
906
+ {
907
+ allow: [],
908
+ allowAfterThis: false,
909
+ allowAfterSuper: false,
910
+ enforceInMethodNames: true,
911
+ },
912
+ ],
913
+
914
+ // Disallow ternary operators when simpler alternatives exist
915
+ // https://eslint.org/docs/latest/rules/no-unneeded-ternary
916
+ 'no-unneeded-ternary': ['error', { defaultAssignment: false }],
917
+
918
+ // Disallow unused expressions
919
+ // no-unused-expressions
920
+ 'no-unused-expressions': [
921
+ 'error',
922
+ {
923
+ allowShortCircuit: false,
924
+ allowTernary: false,
925
+ allowTaggedTemplates: false,
926
+ },
927
+ ],
928
+
929
+ // Disallow unused labels
930
+ // https://eslint.org/docs/latest/rules/no-unused-labels
931
+ 'no-unused-labels': 'error',
932
+
933
+ // Disallow unnecessary calls to .call() and .apply()
934
+ // https://eslint.org/docs/latest/rules/no-useless-call
935
+ 'no-useless-call': 'off',
936
+
937
+ // Disallow unnecessary catch clauses
938
+ // https://eslint.org/docs/latest/rules/no-useless-catch
939
+ 'no-useless-catch': 'error',
940
+
941
+ // Disallow unnecessary computed property keys in objects and classes
942
+ // https://eslint.org/docs/latest/rules/no-useless-computed-key
943
+ 'no-useless-computed-key': 'error',
944
+
945
+ // Disallow unnecessary concatenation of literals or template literals
946
+ // https://eslint.org/docs/latest/rules/no-useless-concat
947
+ 'no-useless-concat': 'error',
948
+
949
+ // Disallow unnecessary constructors
950
+ // https://eslint.org/docs/latest/rules/no-useless-constructor
951
+ 'no-useless-constructor': 'error',
952
+
953
+ // Disallow unnecessary escape characters
954
+ // https://eslint.org/docs/latest/rules/no-useless-escape
955
+ 'no-useless-escape': 'error',
956
+
957
+ // Disallow renaming import, export, and destructured assignments to the same name
958
+ // https://eslint.org/docs/latest/rules/no-useless-rename
959
+ 'no-useless-rename': [
960
+ 'error',
961
+ {
962
+ ignoreDestructuring: false,
963
+ ignoreImport: false,
964
+ ignoreExport: false,
965
+ },
966
+ ],
967
+
968
+ // Require let or const instead of var
969
+ // https://eslint.org/docs/latest/rules/no-var
970
+ 'no-var': 'error',
971
+
972
+ // Disallow redundant return statements
973
+ // https://eslint.org/docs/latest/rules/no-useless-return
974
+ 'no-useless-return': 'error',
975
+
976
+ // Disallow void operators
977
+ // https://eslint.org/docs/latest/rules/no-void
978
+ 'no-void': 'error',
979
+
980
+ // Disallow specified warning terms in comments
981
+ // https://eslint.org/docs/latest/rules/no-warning-comments
982
+ 'no-warning-comments': ['off', { terms: ['todo', 'fixme', 'xxx'], location: 'start' }],
983
+
984
+ // Disallow with statements
985
+ // https://eslint.org/docs/latest/rules/no-with
986
+ 'no-with': 'error',
987
+
988
+ // Require or disallow method and property shorthand syntax for object literals
989
+ // https://eslint.org/docs/latest/rules/object-shorthand
990
+ 'object-shorthand': [
991
+ 'error',
992
+ 'always',
993
+ {
994
+ ignoreConstructors: false,
995
+ avoidQuotes: true,
996
+ },
997
+ ],
998
+
999
+ // Enforce variables to be declared either together or separately in functions
1000
+ // https://eslint.org/docs/latest/rules/one-var
1001
+ 'one-var': ['error', 'never'],
1002
+
1003
+ // Require or disallow assignment operator shorthand where possible
1004
+ // https://eslint.org/docs/latest/rules/operator-assignment
1005
+ 'operator-assignment': ['error', 'always'],
1006
+
1007
+ // Require using arrow functions for callbacks
1008
+ // https://eslint.org/docs/latest/rules/prefer-arrow-callback
1009
+ 'prefer-arrow-callback': [
1010
+ 'error',
1011
+ {
1012
+ allowNamedFunctions: false,
1013
+ allowUnboundThis: true,
1014
+ },
1015
+ ],
1016
+
1017
+ // Require const declarations for variables that are never reassigned after declared
1018
+ // https://eslint.org/docs/latest/rules/prefer-const
1019
+ 'prefer-const': [
1020
+ 'error',
1021
+ {
1022
+ destructuring: 'any',
1023
+ ignoreReadBeforeAssign: true,
1024
+ },
1025
+ ],
1026
+
1027
+ // Require destructuring from arrays and/or objects
1028
+ // https://eslint.org/docs/latest/rules/prefer-destructuring
1029
+ 'prefer-destructuring': [
1030
+ 'error',
1031
+ {
1032
+ VariableDeclarator: {
1033
+ array: false,
1034
+ object: true,
1035
+ },
1036
+ AssignmentExpression: {
1037
+ array: true,
1038
+ object: false,
1039
+ },
1040
+ },
1041
+ {
1042
+ enforceForRenamedProperties: false,
1043
+ },
1044
+ ],
1045
+
1046
+ // Disallow the use of Math.pow in favor of the ** operator
1047
+ // https://eslint.org/docs/latest/rules/prefer-exponentiation-operator
1048
+ 'prefer-exponentiation-operator': 'error',
1049
+
1050
+ // Enforce using named capture group in regular expression
1051
+ // https://eslint.org/docs/latest/rules/prefer-named-capture-group
1052
+ 'prefer-named-capture-group': 'off',
1053
+
1054
+ // Disallow parseInt() and Number.parseInt() in favor of binary, octal, and hexadecimal literals
1055
+ // https://eslint.org/docs/latest/rules/prefer-numeric-literals
1056
+ 'prefer-numeric-literals': 'error',
1057
+
1058
+ // Disallow use of Object.prototype.hasOwnProperty.call() and prefer use of Object.hasOwn()
1059
+ // https://eslint.org/docs/latest/rules/prefer-object-has-own
1060
+ 'prefer-object-has-own': 'off',
1061
+
1062
+ // Disallow using Object.assign with an object literal as the first argument and prefer the use of object spread instead
1063
+ // https://eslint.org/docs/latest/rules/prefer-object-spread
1064
+ 'prefer-object-spread': 'error',
1065
+
1066
+ // Require using Error objects as Promise rejection reasons
1067
+ // https://eslint.org/docs/latest/rules/prefer-promise-reject-errors
1068
+ 'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],
1069
+
1070
+ // Disallow use of the RegExp constructor in favor of regular expression literals
1071
+ // https://eslint.org/docs/latest/rules/prefer-regex-literals
1072
+ 'prefer-regex-literals': [
1073
+ 'error',
1074
+ {
1075
+ disallowRedundantWrapping: true,
1076
+ },
1077
+ ],
1078
+
1079
+ // Require rest parameters instead of arguments
1080
+ // https://eslint.org/docs/latest/rules/prefer-rest-params
1081
+ 'prefer-rest-params': 'error',
1082
+
1083
+ // Require spread operators instead of .apply()
1084
+ // https://eslint.org/docs/latest/rules/prefer-spread
1085
+ 'prefer-spread': 'error',
1086
+
1087
+ // Require template literals instead of string concatenation
1088
+ // https://eslint.org/docs/latest/rules/prefer-template
1089
+ 'prefer-template': 'error',
1090
+
1091
+ // Enforce the consistent use of the radix argument when using parseInt()
1092
+ // https://eslint.org/docs/latest/rules/radix
1093
+ radix: 'error',
1094
+
1095
+ // Disallow async functions which have no await expression
1096
+ // https://eslint.org/docs/latest/rules/require-await
1097
+ 'require-await': 'off',
1098
+
1099
+ // Enforce the use of u or v flag on RegExp
1100
+ // https://eslint.org/docs/latest/rules/require-unicode-regexp
1101
+ 'require-unicode-regexp': 'off',
1102
+
1103
+ // Require generator functions to contain yield
1104
+ // https://eslint.org/docs/latest/rules/require-yield
1105
+ 'require-yield': 'error',
1106
+
1107
+ // Enforce sorted import declarations within modules
1108
+ // https://eslint.org/docs/latest/rules/sort-imports
1109
+ 'sort-imports': [
1110
+ 'off',
1111
+ {
1112
+ ignoreCase: false,
1113
+ ignoreDeclarationSort: false,
1114
+ ignoreMemberSort: false,
1115
+ memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
1116
+ },
1117
+ ],
1118
+
1119
+ // Require object keys to be sorted
1120
+ // https://eslint.org/docs/latest/rules/sort-keys
1121
+ 'sort-keys': ['off', 'asc', { caseSensitive: false, natural: true }],
1122
+
1123
+ // Require variables within the same declaration block to be sorted
1124
+ // https://eslint.org/docs/latest/rules/sort-vars
1125
+ 'sort-vars': 'off',
1126
+
1127
+ // Require or disallow strict mode directives
1128
+ // https://eslint.org/docs/latest/rules/strict
1129
+ strict: ['error', 'never'],
1130
+
1131
+ // Require symbol descriptions
1132
+ // https://eslint.org/docs/latest/rules/symbol-description
1133
+ 'symbol-description': 'error',
1134
+
1135
+ // Require var declarations be placed at the top of their containing scope
1136
+ // https://eslint.org/docs/latest/rules/vars-on-top
1137
+ 'vars-on-top': 'error',
1138
+
1139
+ // Require or disallow "Yoda" conditions
1140
+ // https://eslint.org/docs/latest/rules/yoda
1141
+ yoda: 'error',
1142
+
1143
+ // Layout & Formatting - These rules care about how the code looks rather than how it executes
1144
+
1145
+ // Enforce position of line comments
1146
+ // https://eslint.org/docs/latest/rules/line-comment-position
1147
+ 'line-comment-position': [
1148
+ 'off',
1149
+ {
1150
+ position: 'above',
1151
+ ignorePattern: '',
1152
+ applyDefaultPatterns: true,
1153
+ },
1154
+ ],
1155
+
1156
+ // Require or disallow Unicode byte order mark (BOM)
1157
+ // https://eslint.org/docs/latest/rules/unicode-bom
1158
+ 'unicode-bom': ['error', 'never'],
1159
+
1160
+ // Deprecated - These rules have been deprecated in accordance with the deprecation policy, and replaced by newer rules
1161
+
1162
+ 'array-bracket-newline': ['off', 'consistent'],
1163
+ 'array-bracket-spacing': ['error', 'never'],
1164
+ 'array-element-newline': ['off', { multiline: true, minItems: 3 }],
1165
+ 'arrow-parens': ['error', 'always'],
1166
+ 'arrow-spacing': ['error', { before: true, after: true }],
1167
+ 'block-spacing': ['error', 'always'],
1168
+ 'brace-style': ['error', '1tbs', { allowSingleLine: true }],
1169
+ 'callback-return': 'off',
1170
+ 'comma-dangle': [
1171
+ 'error',
1172
+ {
1173
+ arrays: 'always-multiline',
1174
+ objects: 'always-multiline',
1175
+ imports: 'always-multiline',
1176
+ exports: 'always-multiline',
1177
+ functions: 'always-multiline',
1178
+ },
1179
+ ],
1180
+ 'comma-spacing': ['error', { before: false, after: true }],
1181
+ 'comma-style': [
1182
+ 'error',
1183
+ 'last',
1184
+ {
1185
+ exceptions: {
1186
+ ArrayExpression: false,
1187
+ ArrayPattern: false,
1188
+ ArrowFunctionExpression: false,
1189
+ CallExpression: false,
1190
+ FunctionDeclaration: false,
1191
+ FunctionExpression: false,
1192
+ ImportDeclaration: false,
1193
+ ObjectExpression: false,
1194
+ ObjectPattern: false,
1195
+ VariableDeclaration: false,
1196
+ NewExpression: false,
1197
+ },
1198
+ },
1199
+ ],
1200
+ 'computed-property-spacing': ['error', 'never'],
1201
+ 'dot-location': ['error', 'property'],
1202
+ 'eol-last': ['error', 'always'],
1203
+ 'func-call-spacing': ['error', 'never'],
1204
+ 'function-call-argument-newline': ['error', 'consistent'],
1205
+ 'function-paren-newline': ['error', 'multiline-arguments'],
1206
+ 'generator-star-spacing': ['error', { before: false, after: true }],
1207
+ 'global-require': 'error',
1208
+ 'handle-callback-err': 'off',
1209
+ // Replaced by id-denylist
1210
+ 'id-blacklist': 'off',
1211
+ 'implicit-arrow-linebreak': ['error', 'beside'],
1212
+ indent: [
1213
+ 'error',
1214
+ 2,
1215
+ {
1216
+ SwitchCase: 1,
1217
+ VariableDeclarator: 1,
1218
+ outerIIFEBody: 1,
1219
+ FunctionDeclaration: {
1220
+ parameters: 1,
1221
+ body: 1,
1222
+ },
1223
+ FunctionExpression: {
1224
+ parameters: 1,
1225
+ body: 1,
1226
+ },
1227
+ CallExpression: {
1228
+ arguments: 1,
1229
+ },
1230
+ ArrayExpression: 1,
1231
+ ObjectExpression: 1,
1232
+ ImportDeclaration: 1,
1233
+ flatTernaryExpressions: false,
1234
+ ignoredNodes: [
1235
+ 'JSXElement',
1236
+ 'JSXElement > *',
1237
+ 'JSXAttribute',
1238
+ 'JSXIdentifier',
1239
+ 'JSXNamespacedName',
1240
+ 'JSXMemberExpression',
1241
+ 'JSXSpreadAttribute',
1242
+ 'JSXExpressionContainer',
1243
+ 'JSXOpeningElement',
1244
+ 'JSXClosingElement',
1245
+ 'JSXFragment',
1246
+ 'JSXOpeningFragment',
1247
+ 'JSXClosingFragment',
1248
+ 'JSXText',
1249
+ 'JSXEmptyExpression',
1250
+ 'JSXSpreadChild',
1251
+ ],
1252
+ ignoreComments: false,
1253
+ },
1254
+ ],
1255
+ // Replaced by indent
1256
+ 'indent-legacy': 'off',
1257
+ 'jsx-quotes': ['off', 'prefer-double'],
1258
+ 'key-spacing': ['error', { beforeColon: false, afterColon: true }],
1259
+ 'keyword-spacing': [
1260
+ 'error',
1261
+ {
1262
+ before: true,
1263
+ after: true,
1264
+ overrides: {
1265
+ return: { after: true },
1266
+ throw: { after: true },
1267
+ case: { after: true },
1268
+ },
1269
+ },
1270
+ ],
1271
+ 'linebreak-style': ['error', 'unix'],
1272
+ 'lines-around-comment': 'off',
1273
+ // Replaced by padding-line-between-statements
1274
+ 'lines-around-directive': [
1275
+ 'error',
1276
+ {
1277
+ before: 'always',
1278
+ after: 'always',
1279
+ },
1280
+ ],
1281
+ 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: false }],
1282
+ 'max-len': [
1283
+ 'error',
1284
+ 100,
1285
+ 2,
1286
+ {
1287
+ ignoreUrls: true,
1288
+ ignoreComments: false,
1289
+ ignoreRegExpLiterals: true,
1290
+ ignoreStrings: true,
1291
+ ignoreTemplateLiterals: true,
1292
+ },
1293
+ ],
1294
+ 'max-statements-per-line': ['off', { max: 1 }],
1295
+ 'multiline-ternary': ['off', 'never'],
1296
+ 'new-parens': 'error',
1297
+ // Replaced by padding-line-between-statements
1298
+ 'newline-after-var': 'off',
1299
+ // Replaced by padding-line-between-statements
1300
+ 'newline-before-return': 'off',
1301
+ 'newline-per-chained-call': ['error', { ignoreChainWithDepth: 4 }],
1302
+ 'no-buffer-constructor': 'error',
1303
+ // Replaced by no-shadow
1304
+ 'no-catch-shadow': 'off',
1305
+ 'no-confusing-arrow': [
1306
+ 'error',
1307
+ {
1308
+ allowParens: true,
1309
+ },
1310
+ ],
1311
+ 'no-extra-parens': [
1312
+ 'off',
1313
+ 'all',
1314
+ {
1315
+ conditionalAssign: true,
1316
+ nestedBinaryExpressions: false,
1317
+ returnAssign: false,
1318
+ ignoreJSX: 'all',
1319
+ enforceForArrowConditionals: false,
1320
+ },
1321
+ ],
1322
+ 'no-extra-semi': 'error',
1323
+ 'no-floating-decimal': 'error',
1324
+ 'no-mixed-operators': [
1325
+ 'error',
1326
+ {
1327
+ groups: [
1328
+ ['%', '**'],
1329
+ ['%', '+'],
1330
+ ['%', '-'],
1331
+ ['%', '*'],
1332
+ ['%', '/'],
1333
+ ['/', '*'],
1334
+ ['&', '|', '<<', '>>', '>>>'],
1335
+ ['==', '!=', '===', '!=='],
1336
+ ['&&', '||'],
1337
+ ],
1338
+ allowSamePrecedence: false,
1339
+ },
1340
+ ],
1341
+ 'no-mixed-requires': ['off', false],
1342
+ 'no-mixed-spaces-and-tabs': 'error',
1343
+ 'no-multi-spaces': [
1344
+ 'error',
1345
+ {
1346
+ ignoreEOLComments: false,
1347
+ },
1348
+ ],
1349
+ 'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
1350
+ // Replaced by no-global-assign
1351
+ 'no-native-reassign': 'off',
1352
+ // Replaced by no-unsafe-negation
1353
+ 'no-negated-in-lhs': 'off',
1354
+ // Replaced by no-object-constructor
1355
+ 'no-new-object': 'error',
1356
+ 'no-new-require': 'error',
1357
+ 'no-path-concat': 'error',
1358
+ 'no-process-env': 'off',
1359
+ 'no-process-exit': 'off',
1360
+ 'no-restricted-modules': 'off',
1361
+ 'no-return-await': 'error',
1362
+ // Replaced by func-call-spacing
1363
+ 'no-spaced-func': 'error',
1364
+ 'no-sync': 'off',
1365
+ 'no-tabs': 'error',
1366
+ 'no-trailing-spaces': [
1367
+ 'error',
1368
+ {
1369
+ skipBlankLines: false,
1370
+ ignoreComments: false,
1371
+ },
1372
+ ],
1373
+ 'no-whitespace-before-property': 'error',
1374
+ 'nonblock-statement-body-position': ['error', 'beside', { overrides: {} }],
1375
+ 'object-curly-newline': [
1376
+ 'error',
1377
+ {
1378
+ ObjectExpression: { minProperties: 4, multiline: true, consistent: true },
1379
+ ObjectPattern: { minProperties: 4, multiline: true, consistent: true },
1380
+ ImportDeclaration: { minProperties: 4, multiline: true, consistent: true },
1381
+ ExportDeclaration: { minProperties: 4, multiline: true, consistent: true },
1382
+ },
1383
+ ],
1384
+ 'object-curly-spacing': ['error', 'always'],
1385
+ 'object-property-newline': [
1386
+ 'error',
1387
+ {
1388
+ allowAllPropertiesOnSameLine: true,
1389
+ },
1390
+ ],
1391
+ 'one-var-declaration-per-line': ['error', 'always'],
1392
+ 'operator-linebreak': ['error', 'before', { overrides: { '=': 'none' } }],
1393
+ 'padded-blocks': [
1394
+ 'error',
1395
+ {
1396
+ blocks: 'never',
1397
+ classes: 'never',
1398
+ switches: 'never',
1399
+ },
1400
+ {
1401
+ allowSingleLineBlocks: true,
1402
+ },
1403
+ ],
1404
+ 'padding-line-between-statements': 'off',
1405
+ 'prefer-reflect': 'off',
1406
+ 'quote-props': ['error', 'as-needed', { keywords: false, unnecessary: true, numbers: false }],
1407
+ quotes: ['error', 'single', { avoidEscape: true }],
1408
+ 'require-jsdoc': 'off',
1409
+ 'rest-spread-spacing': ['error', 'never'],
1410
+ semi: ['error', 'always'],
1411
+ 'semi-spacing': ['error', { before: false, after: true }],
1412
+ 'semi-style': ['error', 'last'],
1413
+ 'space-before-blocks': 'error',
1414
+ 'space-before-function-paren': [
1415
+ 'error',
1416
+ {
1417
+ anonymous: 'always',
1418
+ named: 'never',
1419
+ asyncArrow: 'always',
1420
+ },
1421
+ ],
1422
+ 'space-in-parens': ['error', 'never'],
1423
+ 'space-infix-ops': 'error',
1424
+ 'space-unary-ops': [
1425
+ 'error',
1426
+ {
1427
+ words: true,
1428
+ nonwords: false,
1429
+ overrides: {},
1430
+ },
1431
+ ],
1432
+ 'spaced-comment': [
1433
+ 'error',
1434
+ 'always',
1435
+ {
1436
+ line: {
1437
+ exceptions: ['-', '+'],
1438
+ markers: ['=', '!', '/'],
1439
+ },
1440
+ block: {
1441
+ exceptions: ['-', '+'],
1442
+ markers: ['=', '!', ':', '::'],
1443
+ balanced: true,
1444
+ },
1445
+ },
1446
+ ],
1447
+ 'switch-colon-spacing': ['error', { after: true, before: false }],
1448
+ 'template-curly-spacing': 'error',
1449
+ 'template-tag-spacing': ['error', 'never'],
1450
+ 'valid-jsdoc': 'off',
1451
+ 'wrap-iife': ['error', 'outside', { functionPrototypeMethods: false }],
1452
+ 'wrap-regex': 'off',
1453
+ 'yield-star-spacing': ['error', 'after'],
36
1454
  },
37
1455
  };