@egs33/eslint-config 3.0.2 → 4.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/airbnb/best-practices.js +7 -283
- package/airbnb/errors.js +4 -170
- package/airbnb/es6.js +0 -112
- package/airbnb/style.js +3 -521
- package/airbnb/variables.js +1 -32
- package/base.js +8 -6
- package/package.json +19 -19
- package/plugin-rules/imports.js +1 -9
- package/plugin-rules/stylistic.js +186 -0
- package/typescript-base.js +54 -8
- package/typescript-svelte.js +1 -2
package/airbnb/best-practices.js
CHANGED
|
@@ -1,98 +1,26 @@
|
|
|
1
1
|
export const bestPractices = {
|
|
2
|
-
// enforces getter/setter pairs in objects
|
|
3
|
-
// https://eslint.org/docs/rules/accessor-pairs
|
|
4
|
-
'accessor-pairs': 'off',
|
|
5
|
-
|
|
6
|
-
// enforces return statements in callbacks of array's methods
|
|
7
|
-
// https://eslint.org/docs/rules/array-callback-return
|
|
8
2
|
'array-callback-return': ['error', { allowImplicit: true }],
|
|
9
|
-
|
|
10
|
-
// treat var statements as if they were block scoped
|
|
11
|
-
// https://eslint.org/docs/rules/block-scoped-var
|
|
12
3
|
'block-scoped-var': 'error',
|
|
13
|
-
|
|
14
|
-
// specify the maximum cyclomatic complexity allowed in a program
|
|
15
|
-
// https://eslint.org/docs/rules/complexity
|
|
16
4
|
complexity: ['off', 20],
|
|
17
|
-
|
|
18
|
-
// enforce that class methods use "this"
|
|
19
|
-
// https://eslint.org/docs/rules/class-methods-use-this
|
|
20
5
|
'class-methods-use-this': [
|
|
21
6
|
'error', {
|
|
22
7
|
exceptMethods: [],
|
|
23
8
|
},
|
|
24
9
|
],
|
|
25
|
-
|
|
26
|
-
// require return statements to either always or never specify values
|
|
27
|
-
// https://eslint.org/docs/rules/consistent-return
|
|
28
10
|
'consistent-return': 'error',
|
|
29
|
-
|
|
30
|
-
// specify curly brace conventions for all control statements
|
|
31
|
-
// https://eslint.org/docs/rules/curly
|
|
32
|
-
curly: ['error', 'multi-line'], // multiline
|
|
33
|
-
|
|
34
|
-
// require default case in switch statements
|
|
35
|
-
// https://eslint.org/docs/rules/default-case
|
|
11
|
+
curly: ['error', 'multi-line'],
|
|
36
12
|
'default-case': ['error', { commentPattern: '^no default$' }],
|
|
37
|
-
|
|
38
|
-
// Enforce default clauses in switch statements to be last
|
|
39
|
-
// https://eslint.org/docs/rules/default-case-last
|
|
40
13
|
'default-case-last': 'error',
|
|
41
|
-
|
|
42
|
-
// https://eslint.org/docs/rules/default-param-last
|
|
43
14
|
'default-param-last': 'error',
|
|
44
|
-
|
|
45
|
-
// encourages use of dot notation whenever possible
|
|
46
|
-
// https://eslint.org/docs/rules/dot-notation
|
|
47
15
|
'dot-notation': ['error', { allowKeywords: true }],
|
|
48
|
-
|
|
49
|
-
// enforces consistent newlines before or after dots
|
|
50
|
-
// https://eslint.org/docs/rules/dot-location
|
|
51
|
-
'dot-location': ['error', 'property'],
|
|
52
|
-
|
|
53
|
-
// require the use of === and !==
|
|
54
|
-
// https://eslint.org/docs/rules/eqeqeq
|
|
55
16
|
eqeqeq: ['error', 'always', { null: 'ignore' }],
|
|
56
|
-
|
|
57
|
-
// Require grouped accessor pairs in object literals and classes
|
|
58
|
-
// https://eslint.org/docs/rules/grouped-accessor-pairs
|
|
59
17
|
'grouped-accessor-pairs': 'error',
|
|
60
|
-
|
|
61
|
-
// make sure for-in loops have an if statement
|
|
62
|
-
// https://eslint.org/docs/rules/guard-for-in
|
|
63
18
|
'guard-for-in': 'error',
|
|
64
|
-
|
|
65
|
-
// enforce a maximum number of classes per file
|
|
66
|
-
// https://eslint.org/docs/rules/max-classes-per-file
|
|
67
19
|
'max-classes-per-file': ['error', 1],
|
|
68
|
-
|
|
69
|
-
// disallow the use of alert, confirm, and prompt
|
|
70
|
-
// https://eslint.org/docs/rules/no-alert
|
|
71
|
-
// TODO: enable, semver-major
|
|
72
|
-
'no-alert': 'warn',
|
|
73
|
-
|
|
74
|
-
// disallow use of arguments.caller or arguments.callee
|
|
75
|
-
// https://eslint.org/docs/rules/no-caller
|
|
20
|
+
'no-alert': 'error',
|
|
76
21
|
'no-caller': 'error',
|
|
77
|
-
|
|
78
|
-
// disallow lexical declarations in case/default clauses
|
|
79
|
-
// https://eslint.org/docs/rules/no-case-declarations
|
|
80
|
-
'no-case-declarations': 'error',
|
|
81
|
-
|
|
82
|
-
// Disallow returning value in constructor
|
|
83
|
-
// https://eslint.org/docs/rules/no-constructor-return
|
|
84
|
-
'no-constructor-return': 'error',
|
|
85
|
-
|
|
86
|
-
// disallow division operators explicitly at beginning of regular expression
|
|
87
|
-
// https://eslint.org/docs/rules/no-div-regex
|
|
88
22
|
'no-div-regex': 'off',
|
|
89
|
-
|
|
90
|
-
// disallow else after a return in an if
|
|
91
|
-
// https://eslint.org/docs/rules/no-else-return
|
|
92
23
|
'no-else-return': ['error', { allowElseIf: false }],
|
|
93
|
-
|
|
94
|
-
// disallow empty functions, except for standalone funcs/arrows
|
|
95
|
-
// https://eslint.org/docs/rules/no-empty-function
|
|
96
24
|
'no-empty-function': [
|
|
97
25
|
'error', {
|
|
98
26
|
allow: [
|
|
@@ -102,54 +30,14 @@ export const bestPractices = {
|
|
|
102
30
|
],
|
|
103
31
|
},
|
|
104
32
|
],
|
|
105
|
-
|
|
106
|
-
// disallow empty destructuring patterns
|
|
107
|
-
// https://eslint.org/docs/rules/no-empty-pattern
|
|
108
|
-
'no-empty-pattern': 'error',
|
|
109
|
-
|
|
110
|
-
// Disallow empty static blocks
|
|
111
|
-
// https://eslint.org/docs/latest/rules/no-empty-static-block
|
|
112
|
-
// TODO: semver-major, enable
|
|
113
33
|
'no-empty-static-block': 'off',
|
|
114
|
-
|
|
115
|
-
// disallow comparisons to null without a type-checking operator
|
|
116
|
-
// https://eslint.org/docs/rules/no-eq-null
|
|
117
34
|
'no-eq-null': 'off',
|
|
118
|
-
|
|
119
|
-
// disallow use of eval()
|
|
120
|
-
// https://eslint.org/docs/rules/no-eval
|
|
121
35
|
'no-eval': 'error',
|
|
122
|
-
|
|
123
|
-
// disallow adding to native types
|
|
124
|
-
// https://eslint.org/docs/rules/no-extend-native
|
|
125
36
|
'no-extend-native': 'error',
|
|
126
|
-
|
|
127
|
-
// disallow unnecessary function binding
|
|
128
|
-
// https://eslint.org/docs/rules/no-extra-bind
|
|
129
37
|
'no-extra-bind': 'error',
|
|
130
|
-
|
|
131
|
-
// disallow Unnecessary Labels
|
|
132
|
-
// https://eslint.org/docs/rules/no-extra-label
|
|
133
38
|
'no-extra-label': 'error',
|
|
134
|
-
|
|
135
|
-
// disallow fallthrough of case statements
|
|
136
|
-
// https://eslint.org/docs/rules/no-fallthrough
|
|
137
|
-
'no-fallthrough': 'error',
|
|
138
|
-
|
|
139
|
-
// disallow the use of leading or trailing decimal points in numeric literals
|
|
140
|
-
// https://eslint.org/docs/rules/no-floating-decimal
|
|
141
|
-
'no-floating-decimal': 'error',
|
|
142
|
-
|
|
143
|
-
// disallow reassignments of native objects or read-only globals
|
|
144
|
-
// https://eslint.org/docs/rules/no-global-assign
|
|
145
39
|
'no-global-assign': ['error', { exceptions: [] }],
|
|
146
|
-
|
|
147
|
-
// deprecated in favor of no-global-assign
|
|
148
|
-
// https://eslint.org/docs/rules/no-native-reassign
|
|
149
40
|
'no-native-reassign': 'off',
|
|
150
|
-
|
|
151
|
-
// disallow implicit type conversions
|
|
152
|
-
// https://eslint.org/docs/rules/no-implicit-coercion
|
|
153
41
|
'no-implicit-coercion': [
|
|
154
42
|
'off', {
|
|
155
43
|
boolean: false,
|
|
@@ -158,37 +46,13 @@ export const bestPractices = {
|
|
|
158
46
|
allow: [],
|
|
159
47
|
},
|
|
160
48
|
],
|
|
161
|
-
|
|
162
|
-
// disallow var and named functions in global scope
|
|
163
|
-
// https://eslint.org/docs/rules/no-implicit-globals
|
|
164
49
|
'no-implicit-globals': 'off',
|
|
165
|
-
|
|
166
|
-
// disallow use of eval()-like methods
|
|
167
|
-
// https://eslint.org/docs/rules/no-implied-eval
|
|
168
50
|
'no-implied-eval': 'error',
|
|
169
|
-
|
|
170
|
-
// disallow this keywords outside of classes or class-like objects
|
|
171
|
-
// https://eslint.org/docs/rules/no-invalid-this
|
|
172
51
|
'no-invalid-this': 'off',
|
|
173
|
-
|
|
174
|
-
// disallow usage of __iterator__ property
|
|
175
|
-
// https://eslint.org/docs/rules/no-iterator
|
|
176
52
|
'no-iterator': 'error',
|
|
177
|
-
|
|
178
|
-
// disallow use of labels for anything other than loops and switches
|
|
179
|
-
// https://eslint.org/docs/rules/no-labels
|
|
180
53
|
'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
|
|
181
|
-
|
|
182
|
-
// disallow unnecessary nested blocks
|
|
183
|
-
// https://eslint.org/docs/rules/no-lone-blocks
|
|
184
54
|
'no-lone-blocks': 'error',
|
|
185
|
-
|
|
186
|
-
// disallow creation of functions within loops
|
|
187
|
-
// https://eslint.org/docs/rules/no-loop-func
|
|
188
55
|
'no-loop-func': 'error',
|
|
189
|
-
|
|
190
|
-
// disallow magic numbers
|
|
191
|
-
// https://eslint.org/docs/rules/no-magic-numbers
|
|
192
56
|
'no-magic-numbers': [
|
|
193
57
|
'off', {
|
|
194
58
|
ignore: [],
|
|
@@ -197,52 +61,12 @@ export const bestPractices = {
|
|
|
197
61
|
detectObjects: false,
|
|
198
62
|
},
|
|
199
63
|
],
|
|
200
|
-
|
|
201
|
-
// disallow use of multiple spaces
|
|
202
|
-
// https://eslint.org/docs/rules/no-multi-spaces
|
|
203
|
-
'no-multi-spaces': [
|
|
204
|
-
'error', {
|
|
205
|
-
ignoreEOLComments: false,
|
|
206
|
-
},
|
|
207
|
-
],
|
|
208
|
-
|
|
209
|
-
// disallow use of multiline strings
|
|
210
|
-
// https://eslint.org/docs/rules/no-multi-str
|
|
211
64
|
'no-multi-str': 'error',
|
|
212
|
-
|
|
213
|
-
// disallow use of new operator when not part of the assignment or comparison
|
|
214
|
-
// https://eslint.org/docs/rules/no-new
|
|
215
65
|
'no-new': 'error',
|
|
216
|
-
|
|
217
|
-
// disallow use of new operator for Function object
|
|
218
|
-
// https://eslint.org/docs/rules/no-new-func
|
|
219
66
|
'no-new-func': 'error',
|
|
220
|
-
|
|
221
|
-
// disallows creating new instances of String, Number, and Boolean
|
|
222
|
-
// https://eslint.org/docs/rules/no-new-wrappers
|
|
223
67
|
'no-new-wrappers': 'error',
|
|
224
|
-
|
|
225
|
-
// Disallow \8 and \9 escape sequences in string literals
|
|
226
|
-
// https://eslint.org/docs/rules/no-nonoctal-decimal-escape
|
|
227
|
-
'no-nonoctal-decimal-escape': 'error',
|
|
228
|
-
|
|
229
|
-
// Disallow calls to the Object constructor without an argument
|
|
230
|
-
// https://eslint.org/docs/latest/rules/no-object-constructor
|
|
231
|
-
// TODO: enable, semver-major
|
|
232
|
-
'no-object-constructor': 'off',
|
|
233
|
-
|
|
234
|
-
// disallow use of (old style) octal literals
|
|
235
|
-
// https://eslint.org/docs/rules/no-octal
|
|
236
|
-
'no-octal': 'error',
|
|
237
|
-
|
|
238
|
-
// disallow use of octal escape sequences in string literals, such as
|
|
239
|
-
// var foo = 'Copyright \251';
|
|
240
|
-
// https://eslint.org/docs/rules/no-octal-escape
|
|
68
|
+
'no-object-constructor': 'error',
|
|
241
69
|
'no-octal-escape': 'error',
|
|
242
|
-
|
|
243
|
-
// disallow reassignment of function parameters
|
|
244
|
-
// disallow parameter object manipulation except for specific exclusions
|
|
245
|
-
// rule: https://eslint.org/docs/rules/no-param-reassign.html
|
|
246
70
|
'no-param-reassign': [
|
|
247
71
|
'error', {
|
|
248
72
|
props: true,
|
|
@@ -261,17 +85,7 @@ export const bestPractices = {
|
|
|
261
85
|
],
|
|
262
86
|
},
|
|
263
87
|
],
|
|
264
|
-
|
|
265
|
-
// disallow usage of __proto__ property
|
|
266
|
-
// https://eslint.org/docs/rules/no-proto
|
|
267
88
|
'no-proto': 'error',
|
|
268
|
-
|
|
269
|
-
// disallow declaring the same variable more than once
|
|
270
|
-
// https://eslint.org/docs/rules/no-redeclare
|
|
271
|
-
'no-redeclare': 'error',
|
|
272
|
-
|
|
273
|
-
// disallow certain object properties
|
|
274
|
-
// https://eslint.org/docs/rules/no-restricted-properties
|
|
275
89
|
'no-restricted-properties': [
|
|
276
90
|
'error', {
|
|
277
91
|
object: 'arguments',
|
|
@@ -313,45 +127,18 @@ export const bestPractices = {
|
|
|
313
127
|
message: 'Use the exponentiation operator (**) instead.',
|
|
314
128
|
},
|
|
315
129
|
],
|
|
316
|
-
|
|
317
|
-
// disallow use of assignment in return statement
|
|
318
|
-
// https://eslint.org/docs/rules/no-return-assign
|
|
319
130
|
'no-return-assign': ['error', 'always'],
|
|
320
|
-
|
|
321
|
-
// disallow redundant `return await`
|
|
322
|
-
// https://eslint.org/docs/rules/no-return-await
|
|
323
131
|
'no-return-await': 'error',
|
|
324
|
-
|
|
325
|
-
// disallow use of `javascript:` urls.
|
|
326
|
-
// https://eslint.org/docs/rules/no-script-url
|
|
327
132
|
'no-script-url': 'error',
|
|
328
|
-
|
|
329
|
-
// disallow self assignment
|
|
330
|
-
// https://eslint.org/docs/rules/no-self-assign
|
|
331
133
|
'no-self-assign': [
|
|
332
134
|
'error', {
|
|
333
135
|
props: true,
|
|
334
136
|
},
|
|
335
137
|
],
|
|
336
|
-
|
|
337
|
-
// disallow comparisons where both sides are exactly the same
|
|
338
|
-
// https://eslint.org/docs/rules/no-self-compare
|
|
339
138
|
'no-self-compare': 'error',
|
|
340
|
-
|
|
341
|
-
// disallow use of comma operator
|
|
342
|
-
// https://eslint.org/docs/rules/no-sequences
|
|
343
139
|
'no-sequences': 'error',
|
|
344
|
-
|
|
345
|
-
// restrict what can be thrown as an exception
|
|
346
|
-
// https://eslint.org/docs/rules/no-throw-literal
|
|
347
140
|
'no-throw-literal': 'error',
|
|
348
|
-
|
|
349
|
-
// disallow unmodified conditions of loops
|
|
350
|
-
// https://eslint.org/docs/rules/no-unmodified-loop-condition
|
|
351
141
|
'no-unmodified-loop-condition': 'off',
|
|
352
|
-
|
|
353
|
-
// disallow usage of expressions in statement position
|
|
354
|
-
// https://eslint.org/docs/rules/no-unused-expressions
|
|
355
142
|
'no-unused-expressions': [
|
|
356
143
|
'error', {
|
|
357
144
|
allowShortCircuit: false,
|
|
@@ -359,84 +146,21 @@ export const bestPractices = {
|
|
|
359
146
|
allowTaggedTemplates: false,
|
|
360
147
|
},
|
|
361
148
|
],
|
|
362
|
-
|
|
363
|
-
// disallow unused labels
|
|
364
|
-
// https://eslint.org/docs/rules/no-unused-labels
|
|
365
|
-
'no-unused-labels': 'error',
|
|
366
|
-
|
|
367
|
-
// disallow unnecessary .call() and .apply()
|
|
368
|
-
// https://eslint.org/docs/rules/no-useless-call
|
|
369
|
-
'no-useless-call': 'off',
|
|
370
|
-
|
|
371
|
-
// Disallow unnecessary catch clauses
|
|
372
|
-
// https://eslint.org/docs/rules/no-useless-catch
|
|
373
|
-
'no-useless-catch': 'error',
|
|
374
|
-
|
|
375
|
-
// disallow useless string concatenation
|
|
376
|
-
// https://eslint.org/docs/rules/no-useless-concat
|
|
149
|
+
'no-useless-call': 'error',
|
|
377
150
|
'no-useless-concat': 'error',
|
|
378
|
-
|
|
379
|
-
// disallow unnecessary string escaping
|
|
380
|
-
// https://eslint.org/docs/rules/no-useless-escape
|
|
381
|
-
'no-useless-escape': 'error',
|
|
382
|
-
|
|
383
|
-
// disallow redundant return; keywords
|
|
384
|
-
// https://eslint.org/docs/rules/no-useless-return
|
|
385
151
|
'no-useless-return': 'error',
|
|
386
|
-
|
|
387
|
-
// disallow use of void operator
|
|
388
|
-
// https://eslint.org/docs/rules/no-void
|
|
389
152
|
'no-void': 'error',
|
|
390
|
-
|
|
391
|
-
// disallow usage of configurable warning terms in comments: e.g. todo
|
|
392
|
-
// https://eslint.org/docs/rules/no-warning-comments
|
|
393
|
-
'no-warning-comments': ['off', { terms: ['todo', 'fixme', 'xxx'], location: 'start' }],
|
|
394
|
-
|
|
395
|
-
// disallow use of the with statement
|
|
396
|
-
// https://eslint.org/docs/rules/no-with
|
|
397
|
-
'no-with': 'error',
|
|
398
|
-
|
|
399
|
-
// require using Error objects as Promise rejection reasons
|
|
400
|
-
// https://eslint.org/docs/rules/prefer-promise-reject-errors
|
|
401
153
|
'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],
|
|
402
|
-
|
|
403
|
-
// Suggest using named capture group in regular expression
|
|
404
|
-
// https://eslint.org/docs/rules/prefer-named-capture-group
|
|
405
154
|
'prefer-named-capture-group': 'off',
|
|
406
|
-
|
|
407
|
-
// Prefer Object.hasOwn() over Object.prototype.hasOwnProperty.call()
|
|
408
|
-
// https://eslint.org/docs/rules/prefer-object-has-own
|
|
409
|
-
// TODO: semver-major: enable thus rule, once eslint v8.5.0 is required
|
|
410
|
-
'prefer-object-has-own': 'off',
|
|
411
|
-
|
|
412
|
-
// https://eslint.org/docs/rules/prefer-regex-literals
|
|
155
|
+
'prefer-object-has-own': 'error',
|
|
413
156
|
'prefer-regex-literals': [
|
|
414
157
|
'error', {
|
|
415
158
|
disallowRedundantWrapping: true,
|
|
416
159
|
},
|
|
417
160
|
],
|
|
418
|
-
|
|
419
|
-
// require use of the second argument for parseInt()
|
|
420
|
-
// https://eslint.org/docs/rules/radix
|
|
421
161
|
radix: 'error',
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
// https://eslint.org/docs/rules/require-await
|
|
425
|
-
'require-await': 'off',
|
|
426
|
-
|
|
427
|
-
// Enforce the use of u flag on RegExp
|
|
428
|
-
// https://eslint.org/docs/rules/require-unicode-regexp
|
|
429
|
-
'require-unicode-regexp': 'off',
|
|
430
|
-
|
|
431
|
-
// requires to declare all vars on top of their containing scope
|
|
432
|
-
// https://eslint.org/docs/rules/vars-on-top
|
|
162
|
+
'require-await': 'error',
|
|
163
|
+
'require-unicode-regexp': 'error',
|
|
433
164
|
'vars-on-top': 'error',
|
|
434
|
-
|
|
435
|
-
// require immediate function invocation to be wrapped in parentheses
|
|
436
|
-
// https://eslint.org/docs/rules/wrap-iife.html
|
|
437
|
-
'wrap-iife': ['error', 'outside', { functionPrototypeMethods: false }],
|
|
438
|
-
|
|
439
|
-
// require or disallow Yoda conditions
|
|
440
|
-
// https://eslint.org/docs/rules/yoda
|
|
441
165
|
yoda: 'error',
|
|
442
166
|
};
|
package/airbnb/errors.js
CHANGED
|
@@ -1,191 +1,25 @@
|
|
|
1
1
|
export const errors = {
|
|
2
|
-
// Enforce “for” loop update clause moving the counter in the right direction
|
|
3
|
-
// https://eslint.org/docs/rules/for-direction
|
|
4
|
-
'for-direction': 'error',
|
|
5
|
-
|
|
6
|
-
// Enforces that a return statement is present in property getters
|
|
7
|
-
// https://eslint.org/docs/rules/getter-return
|
|
8
2
|
'getter-return': ['error', { allowImplicit: true }],
|
|
9
|
-
|
|
10
|
-
// disallow using an async function as a Promise executor
|
|
11
|
-
// https://eslint.org/docs/rules/no-async-promise-executor
|
|
12
|
-
'no-async-promise-executor': 'error',
|
|
13
|
-
|
|
14
|
-
// Disallow await inside of loops
|
|
15
|
-
// https://eslint.org/docs/rules/no-await-in-loop
|
|
16
3
|
'no-await-in-loop': 'error',
|
|
17
|
-
|
|
18
|
-
// Disallow comparisons to negative zero
|
|
19
|
-
// https://eslint.org/docs/rules/no-compare-neg-zero
|
|
20
|
-
'no-compare-neg-zero': 'error',
|
|
21
|
-
|
|
22
|
-
// disallow assignment in conditional expressions
|
|
23
4
|
'no-cond-assign': ['error', 'always'],
|
|
24
|
-
|
|
25
|
-
// disallow use of console
|
|
26
5
|
'no-console': 'warn',
|
|
27
|
-
|
|
28
|
-
// Disallows expressions where the operation doesn't affect the value
|
|
29
|
-
// https://eslint.org/docs/rules/no-constant-binary-expression
|
|
30
|
-
// TODO: semver-major, enable
|
|
31
|
-
'no-constant-binary-expression': 'off',
|
|
32
|
-
|
|
33
|
-
// disallow use of constant expressions in conditions
|
|
6
|
+
'no-constant-binary-expression': 'error',
|
|
34
7
|
'no-constant-condition': 'warn',
|
|
35
|
-
|
|
36
|
-
// disallow control characters in regular expressions
|
|
37
|
-
'no-control-regex': 'error',
|
|
38
|
-
|
|
39
|
-
// disallow use of debugger
|
|
40
|
-
'no-debugger': 'error',
|
|
41
|
-
|
|
42
|
-
// disallow duplicate arguments in functions
|
|
43
|
-
'no-dupe-args': 'error',
|
|
44
|
-
|
|
45
|
-
// Disallow duplicate conditions in if-else-if chains
|
|
46
|
-
// https://eslint.org/docs/rules/no-dupe-else-if
|
|
47
|
-
'no-dupe-else-if': 'error',
|
|
48
|
-
|
|
49
|
-
// disallow duplicate keys when creating object literals
|
|
50
|
-
'no-dupe-keys': 'error',
|
|
51
|
-
|
|
52
|
-
// disallow a duplicate case label.
|
|
53
|
-
'no-duplicate-case': 'error',
|
|
54
|
-
|
|
55
|
-
// disallow empty statements
|
|
56
|
-
'no-empty': 'error',
|
|
57
|
-
|
|
58
|
-
// disallow the use of empty character classes in regular expressions
|
|
59
8
|
'no-empty-character-class': 'error',
|
|
60
|
-
|
|
61
|
-
// disallow assigning to the exception in a catch block
|
|
62
|
-
'no-ex-assign': 'error',
|
|
63
|
-
|
|
64
|
-
// disallow double-negation boolean casts in a boolean context
|
|
65
|
-
// https://eslint.org/docs/rules/no-extra-boolean-cast
|
|
66
|
-
'no-extra-boolean-cast': 'error',
|
|
67
|
-
|
|
68
|
-
// disallow unnecessary parentheses
|
|
69
|
-
// https://eslint.org/docs/rules/no-extra-parens
|
|
70
|
-
'no-extra-parens': [
|
|
71
|
-
'off', 'all', {
|
|
72
|
-
conditionalAssign: true,
|
|
73
|
-
nestedBinaryExpressions: false,
|
|
74
|
-
returnAssign: false,
|
|
75
|
-
ignoreJSX: 'all', // delegate to eslint-plugin-react
|
|
76
|
-
enforceForArrowConditionals: false,
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
|
|
80
|
-
// disallow unnecessary semicolons
|
|
9
|
+
'no-extra-parens': ['error', 'all', { nestedBinaryExpressions: false }],
|
|
81
10
|
'no-extra-semi': 'error',
|
|
82
|
-
|
|
83
|
-
// disallow overwriting functions written as function declarations
|
|
84
|
-
'no-func-assign': 'error',
|
|
85
|
-
|
|
86
|
-
// https://eslint.org/docs/rules/no-import-assign
|
|
87
|
-
'no-import-assign': 'error',
|
|
88
|
-
|
|
89
|
-
// disallow function or variable declarations in nested blocks
|
|
90
11
|
'no-inner-declarations': 'error',
|
|
91
|
-
|
|
92
|
-
// disallow invalid regular expression strings in the RegExp constructor
|
|
93
12
|
'no-invalid-regexp': 'error',
|
|
94
|
-
|
|
95
|
-
// disallow irregular whitespace outside of strings and comments
|
|
96
|
-
'no-irregular-whitespace': 'error',
|
|
97
|
-
|
|
98
|
-
// Disallow Number Literals That Lose Precision
|
|
99
|
-
// https://eslint.org/docs/rules/no-loss-of-precision
|
|
100
|
-
'no-loss-of-precision': 'error',
|
|
101
|
-
|
|
102
|
-
// Disallow characters which are made with multiple code points in character class syntax
|
|
103
|
-
// https://eslint.org/docs/rules/no-misleading-character-class
|
|
104
|
-
'no-misleading-character-class': 'error',
|
|
105
|
-
|
|
106
|
-
// disallow the use of object properties of the global object (Math and JSON) as functions
|
|
107
|
-
'no-obj-calls': 'error',
|
|
108
|
-
|
|
109
|
-
// Disallow new operators with global non-constructor functions
|
|
110
|
-
// https://eslint.org/docs/latest/rules/no-new-native-nonconstructor
|
|
111
|
-
// TODO: semver-major, enable
|
|
112
|
-
'no-new-native-nonconstructor': 'off',
|
|
113
|
-
|
|
114
|
-
// Disallow returning values from Promise executor functions
|
|
115
|
-
// https://eslint.org/docs/rules/no-promise-executor-return
|
|
13
|
+
'no-new-native-nonconstructor': 'error',
|
|
116
14
|
'no-promise-executor-return': 'error',
|
|
117
|
-
|
|
118
|
-
// disallow use of Object.prototypes builtins directly
|
|
119
|
-
// https://eslint.org/docs/rules/no-prototype-builtins
|
|
120
|
-
'no-prototype-builtins': 'error',
|
|
121
|
-
|
|
122
|
-
// disallow multiple spaces in a regular expression literal
|
|
123
|
-
'no-regex-spaces': 'error',
|
|
124
|
-
|
|
125
|
-
// Disallow returning values from setters
|
|
126
|
-
// https://eslint.org/docs/rules/no-setter-return
|
|
127
|
-
'no-setter-return': 'error',
|
|
128
|
-
|
|
129
|
-
// disallow sparse arrays
|
|
130
|
-
'no-sparse-arrays': 'error',
|
|
131
|
-
|
|
132
|
-
// Disallow template literal placeholder syntax in regular strings
|
|
133
|
-
// https://eslint.org/docs/rules/no-template-curly-in-string
|
|
134
15
|
'no-template-curly-in-string': 'error',
|
|
135
|
-
|
|
136
|
-
// Avoid code that looks like two expressions but is actually one
|
|
137
|
-
// https://eslint.org/docs/rules/no-unexpected-multiline
|
|
138
|
-
'no-unexpected-multiline': 'error',
|
|
139
|
-
|
|
140
|
-
// disallow unreachable statements after a return, throw, continue, or break statement
|
|
141
|
-
'no-unreachable': 'error',
|
|
142
|
-
|
|
143
|
-
// Disallow loops with a body that allows only one iteration
|
|
144
|
-
// https://eslint.org/docs/rules/no-unreachable-loop
|
|
145
16
|
'no-unreachable-loop': [
|
|
146
17
|
'error', {
|
|
147
|
-
ignore: [],
|
|
18
|
+
ignore: [],
|
|
148
19
|
},
|
|
149
20
|
],
|
|
150
|
-
|
|
151
|
-
// disallow return/throw/break/continue inside finally blocks
|
|
152
|
-
// https://eslint.org/docs/rules/no-unsafe-finally
|
|
153
|
-
'no-unsafe-finally': 'error',
|
|
154
|
-
|
|
155
|
-
// disallow negating the left operand of relational operators
|
|
156
|
-
// https://eslint.org/docs/rules/no-unsafe-negation
|
|
157
|
-
'no-unsafe-negation': 'error',
|
|
158
|
-
|
|
159
|
-
// disallow use of optional chaining in contexts where the undefined value is not allowed
|
|
160
|
-
// https://eslint.org/docs/rules/no-unsafe-optional-chaining
|
|
161
21
|
'no-unsafe-optional-chaining': ['error', { disallowArithmeticOperators: true }],
|
|
162
|
-
|
|
163
|
-
// Disallow Unused Private Class Members
|
|
164
|
-
// https://eslint.org/docs/rules/no-unused-private-class-members
|
|
165
|
-
// TODO: enable once eslint 7 is dropped (which is semver-major)
|
|
166
|
-
'no-unused-private-class-members': 'off',
|
|
167
|
-
|
|
168
|
-
// Disallow useless backreferences in regular expressions
|
|
169
|
-
// https://eslint.org/docs/rules/no-useless-backreference
|
|
170
22
|
'no-useless-backreference': 'error',
|
|
171
|
-
|
|
172
|
-
// disallow negation of the left operand of an in expression
|
|
173
|
-
// deprecated in favor of no-unsafe-negation
|
|
174
|
-
'no-negated-in-lhs': 'off',
|
|
175
|
-
|
|
176
|
-
// Disallow assignments that can lead to race conditions due to usage of await or yield
|
|
177
|
-
// https://eslint.org/docs/rules/require-atomic-updates
|
|
178
|
-
// note: not enabled because it is very buggy
|
|
179
23
|
'require-atomic-updates': 'off',
|
|
180
|
-
|
|
181
|
-
// disallow comparisons with the value NaN
|
|
182
|
-
'use-isnan': 'error',
|
|
183
|
-
|
|
184
|
-
// ensure JSDoc comments are valid
|
|
185
|
-
// https://eslint.org/docs/rules/valid-jsdoc
|
|
186
|
-
'valid-jsdoc': 'off',
|
|
187
|
-
|
|
188
|
-
// ensure that the results of typeof are compared against a valid string
|
|
189
|
-
// https://eslint.org/docs/rules/valid-typeof
|
|
190
24
|
'valid-typeof': ['error', { requireStringLiterals: true }],
|
|
191
25
|
};
|