eslint-config-airbnb-extended 0.1.0 → 0.1.1

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