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