@robinblomberg/eslint-config-robinblomberg 0.33.0 → 0.34.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.
package/index.js CHANGED
@@ -1,1550 +1,1576 @@
1
- const { defineConfig } = require('eslint-define-config');
1
+ import babelParser from '@babel/eslint-parser';
2
+ import typescriptEslintPlugin from '@typescript-eslint/eslint-plugin';
3
+ import typescriptEslintParser from '@typescript-eslint/parser';
4
+ import importPlugin from 'eslint-plugin-import';
5
+ import jsdocPlugin from 'eslint-plugin-jsdoc';
6
+ import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
7
+ import reactPlugin from 'eslint-plugin-react';
8
+ import reactHooksPlugin from 'eslint-plugin-react-hooks';
9
+ import reactRefreshPlugin from 'eslint-plugin-react-refresh';
10
+ import sonarjsPlugin from 'eslint-plugin-sonarjs';
11
+ // @ts-expect-error - No published type declarations:
12
+ import sortExportsPlugin from 'eslint-plugin-sort-exports';
13
+ // @ts-expect-error - No published type declarations:
14
+ import sortKeysPlugin from 'eslint-plugin-sort-keys';
15
+ import storybookPlugin from 'eslint-plugin-storybook';
16
+ import unicornPlugin from 'eslint-plugin-unicorn';
17
+ import globals from 'globals';
2
18
 
3
19
  const IS_DEVELOPMENT = !process.env.CI && process.env.NODE_ENV !== 'production';
4
20
  const error = 'error';
5
21
  const off = 'off';
6
22
  const warn = IS_DEVELOPMENT ? 'warn' : 'error';
7
23
 
8
- module.exports = defineConfig({
9
- env: {
10
- browser: true,
11
- es2024: true,
12
- node: true,
24
+ /**
25
+ * @type {import('eslint').Linter.Config[]}
26
+ */
27
+ const config = [
28
+ {
29
+ ignores: ['**/.*/**', '**/node_modules/**'],
13
30
  },
14
- globals: {
15
- globalThis: true,
16
- },
17
- ignorePatterns: ['**/.*/**', '**/node_modules/**'],
18
- overrides: [
19
- {
20
- files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'],
21
- globals: {
22
- NodeJS: true,
23
- },
24
- parser: '@typescript-eslint/parser',
31
+ {
32
+ languageOptions: {
33
+ ecmaVersion: 'latest',
34
+ sourceType: 'module',
35
+ parser: babelParser,
25
36
  parserOptions: {
26
- project: './tsconfig.json',
37
+ allowAwaitOutsideFunction: true,
38
+ ecmaFeatures: {
39
+ jsx: true,
40
+ },
41
+ requireConfigFile: false,
27
42
  },
28
- plugins: ['@typescript-eslint'],
29
- rules: {
30
- '@typescript-eslint/adjacent-overload-signatures': warn,
31
- '@typescript-eslint/array-type': [warn, { default: 'array' }],
32
- // Disabled due to slow performance:
33
- '@typescript-eslint/await-thenable': off,
34
- '@typescript-eslint/ban-ts-comment': warn,
35
- '@typescript-eslint/ban-tslint-comment': warn,
36
- '@typescript-eslint/ban-types': [
37
- off,
38
- {
39
- extendDefaults: true,
40
- types: {
41
- Boolean: false,
42
- Function: false,
43
- Number: false,
44
- Object: false,
45
- '{}': false,
46
- },
47
- },
48
- ],
49
- // Definition not found (2026-09-03):
50
- // '@typescript-eslint/brace-style': warn,
51
- '@typescript-eslint/camelcase': off,
52
- '@typescript-eslint/class-literal-property-style': [warn, 'fields'],
53
- // Definition not found (2026-09-03):
54
- // '@typescript-eslint/comma-dangle': [warn, 'always-multiline'],
55
- // Definition not found (2026-09-03):
56
- // '@typescript-eslint/comma-spacing': [warn, { after: true, before: false }],
57
- '@typescript-eslint/consistent-type-assertions': [
58
- off,
59
- {
60
- assertionStyle: 'as',
61
- objectLiteralTypeAssertions: 'never',
62
- },
63
- ],
64
- '@typescript-eslint/consistent-type-definitions': [warn, 'type'],
65
- '@typescript-eslint/consistent-type-imports': [
66
- warn,
67
- {
68
- disallowTypeAnnotations: true,
69
- fixStyle: 'separate-type-imports',
70
- prefer: 'type-imports',
71
- },
72
- ],
73
- '@typescript-eslint/default-param-last': warn,
74
- '@typescript-eslint/dot-notation': warn,
75
- '@typescript-eslint/explicit-function-return-type': [
76
- off,
77
- { allowTypedFunctionExpressions: true },
78
- ],
79
- '@typescript-eslint/explicit-member-accessibility': [
80
- warn,
81
- { accessibility: 'no-public' },
82
- ],
83
- '@typescript-eslint/explicit-module-boundary-types': off,
84
- // Definition not found (2026-09-03):
85
- // '@typescript-eslint/func-call-spacing': warn,
86
- // Definition not found (2026-09-03):
87
- // '@typescript-eslint/indent': [
88
- // warn,
89
- // 2,
90
- // {
91
- // SwitchCase: 1,
92
- // // Ignored nodes due to false positives:
93
- // ignoredNodes: [
94
- // 'TSIntersectionType',
95
- // 'TSTypeParameterInstantiation',
96
- // 'TSUnionType',
97
- // ],
98
- // },
99
- // ],
100
- // Definition not found (2020-10-26):
101
- // '@typescript-eslint/index': warn,
102
- '@typescript-eslint/init-declarations': off,
103
- // Definition not found (2026-09-03):
104
- // '@typescript-eslint/keyword-spacing': warn,
105
- '@typescript-eslint/lines-between-class-members': [
106
- off,
107
- 'always',
108
- { exceptAfterOverload: true, exceptAfterSingleLine: true },
109
- ],
110
- // Definition not found (2026-09-03):
111
- // '@typescript-eslint/member-delimiter-style': [
112
- // warn,
113
- // {
114
- // multiline: { delimiter: 'semi', requireLast: true },
115
- // singleline: { delimiter: 'semi', requireLast: true },
116
- // },
117
- // ],
118
- // Disabled to due buggy ordering:
119
- '@typescript-eslint/member-ordering': [
120
- off,
121
- {
122
- default: [
123
- 'signature',
124
- 'private-static-field',
125
- 'protected-static-field',
126
- 'public-static-field',
127
- 'private-static-method',
128
- 'protected-static-method',
129
- 'public-static-method',
130
- 'private-decorated-field',
131
- 'protected-decorated-field',
132
- 'public-decorated-field',
133
- 'private-instance-field',
134
- 'protected-instance-field',
135
- 'public-instance-field',
136
- 'protected-abstract-field',
137
- 'public-abstract-field',
138
- 'static-field',
139
- 'private-field',
140
- 'protected-field',
141
- 'public-field',
142
- 'instance-field',
143
- 'abstract-field',
144
- 'decorated-field',
145
- 'field',
146
- 'private-constructor',
147
- 'protected-constructor',
148
- 'public-constructor',
149
- 'constructor',
150
- 'private-decorated-method',
151
- 'protected-decorated-method',
152
- 'public-decorated-method',
153
- 'private-instance-method',
154
- 'protected-instance-method',
155
- 'public-instance-method',
156
- 'protected-abstract-method',
157
- 'public-abstract-method',
158
- 'static-method',
159
- 'private-method',
160
- 'protected-method',
161
- 'public-method',
162
- 'instance-method',
163
- 'abstract-method',
164
- 'decorated-method',
165
- 'method',
166
- ],
167
- },
168
- ],
169
- '@typescript-eslint/method-signature-style': [warn, 'property'],
170
- '@typescript-eslint/naming-convention': [
171
- off,
172
- {
173
- format: ['camelCase'],
174
- leadingUnderscore: 'allow',
175
- selector: 'default',
176
- },
177
- {
178
- format: ['camelCase', 'snake_case', 'PascalCase', 'UPPER_CASE'],
179
- leadingUnderscore: 'allow',
180
- selector: ['objectLiteralProperty'],
181
- },
182
- {
183
- format: ['camelCase', 'PascalCase'],
184
- leadingUnderscore: 'allow',
185
- selector: ['function'],
186
- },
187
- {
188
- format: ['camelCase', 'UPPER_CASE'],
189
- leadingUnderscore: 'allow',
190
- selector: ['objectLiteralMethod', 'typeMethod', 'variable'],
191
- },
192
- {
193
- format: ['PascalCase'],
194
- leadingUnderscore: 'allow',
195
- selector: [
196
- 'class',
197
- 'enum',
198
- 'interface',
199
- 'typeAlias',
200
- 'typeParameter',
201
- ],
202
- },
203
- {
204
- format: ['UPPER_CASE'],
205
- leadingUnderscore: 'allow',
206
- selector: ['enumMember'],
207
- },
208
- {
209
- format: null,
210
- leadingUnderscore: 'allow',
211
- selector: ['parameter', 'property'],
212
- },
213
- ],
214
- '@typescript-eslint/no-array-constructor': warn,
215
- '@typescript-eslint/no-base-to-string': warn,
216
- '@typescript-eslint/no-confusing-non-null-assertion': off,
217
- '@typescript-eslint/no-dupe-class-members': warn,
218
- '@typescript-eslint/no-dynamic-delete': off,
219
- '@typescript-eslint/no-empty-function': off,
220
- '@typescript-eslint/no-empty-interface': warn,
221
- // Often warns about necessary uses:
222
- '@typescript-eslint/no-explicit-any': off,
223
- '@typescript-eslint/no-extra-non-null-assertion': warn,
224
- // Definition not found (2026-09-03):
225
- // '@typescript-eslint/no-extra-parens': [
226
- // warn,
227
- // 'all',
228
- // { ignoreJSX: 'all', nestedBinaryExpressions: false },
229
- // ],
230
- // Definition not found (2026-09-03):
231
- // '@typescript-eslint/no-extra-semi': warn,
232
- '@typescript-eslint/no-extraneous-class': off,
233
- // Disabled due to slow performance:
234
- '@typescript-eslint/no-floating-promises': [
235
- off,
236
- { ignoreIIFE: true, ignoreVoid: true },
237
- ],
238
- '@typescript-eslint/no-for-in-array': warn,
239
- '@typescript-eslint/no-implicit-any-catch': off,
240
- '@typescript-eslint/no-implied-eval': warn,
241
- '@typescript-eslint/no-inferrable-types': warn,
242
- '@typescript-eslint/no-invalid-this': off,
243
- '@typescript-eslint/no-invalid-void-type': off,
244
- '@typescript-eslint/no-loop-func': warn,
245
- '@typescript-eslint/no-loss-of-precision': warn,
246
- '@typescript-eslint/no-magic-numbers': [
247
- off,
248
- {
249
- ignore: [-1, 0, 1, 2, 3, '-1n', '0n', '1n', '2n', '3n'],
250
- ignoreEnums: true,
251
- ignoreNumericLiteralTypes: true,
252
- ignoreReadonlyClassProperties: true,
253
- },
254
- ],
255
- '@typescript-eslint/no-misused-new': warn,
256
- '@typescript-eslint/no-misused-promises': off,
257
- '@typescript-eslint/no-namespace': [off, { allowDeclarations: true }],
258
- '@typescript-eslint/no-non-null-asserted-optional-chain': warn,
259
- '@typescript-eslint/no-non-null-assertion': off,
260
- '@typescript-eslint/no-parameter-properties': off,
261
- '@typescript-eslint/no-redeclare': off,
262
- '@typescript-eslint/no-require-imports': off,
263
- '@typescript-eslint/no-shadow': warn,
264
- '@typescript-eslint/no-this-alias': warn,
265
- '@typescript-eslint/no-type-alias': off,
266
- '@typescript-eslint/no-unnecessary-boolean-literal-compare': warn,
267
- '@typescript-eslint/no-unnecessary-condition': off,
268
- // Disabled due to slow performance:
269
- '@typescript-eslint/no-unnecessary-qualifier': off,
270
- '@typescript-eslint/no-unnecessary-type-arguments': off,
271
- '@typescript-eslint/no-unnecessary-type-assertion': warn,
272
- '@typescript-eslint/no-unsafe-assignment': off,
273
- '@typescript-eslint/no-unsafe-call': off,
274
- '@typescript-eslint/no-unsafe-member-access': off,
275
- '@typescript-eslint/no-unsafe-return': off,
276
- '@typescript-eslint/no-unused-expressions': [
277
- warn,
278
- {
279
- allowShortCircuit: true,
280
- allowTaggedTemplates: true,
281
- allowTernary: true,
282
- },
283
- ],
284
- '@typescript-eslint/no-unused-vars': [
285
- warn,
286
- {
287
- args: 'none',
288
- argsIgnorePattern: '^_.*$',
289
- vars: 'all',
290
- varsIgnorePattern: '^_.*$|^T$',
291
- },
292
- ],
293
- '@typescript-eslint/no-use-before-define': [
294
- error,
295
- { classes: false, functions: false, variables: false },
296
- ],
297
- '@typescript-eslint/no-useless-constructor': warn,
298
- '@typescript-eslint/no-var-requires': off,
299
- '@typescript-eslint/only-throw-error': warn,
300
- '@typescript-eslint/prefer-as-const': warn,
301
- '@typescript-eslint/prefer-enum-initializers': off,
302
- '@typescript-eslint/prefer-for-of': warn,
303
- '@typescript-eslint/prefer-function-type': warn,
304
- '@typescript-eslint/prefer-includes': warn,
305
- '@typescript-eslint/prefer-literal-enum-member': warn,
306
- '@typescript-eslint/prefer-namespace-keyword': warn,
307
- // Warns about correct uses of `||`:
308
- '@typescript-eslint/prefer-nullish-coalescing': off,
309
- '@typescript-eslint/prefer-optional-chain': warn,
310
- '@typescript-eslint/prefer-readonly': warn,
311
- // Disabled due to error:
312
- // "Error: Non-null Assertion Failed: Expected to find a property "XXX" for the type."
313
- '@typescript-eslint/prefer-readonly-parameter-types': off,
314
- '@typescript-eslint/prefer-reduce-type-parameter': warn,
315
- '@typescript-eslint/prefer-regexp-exec': off,
316
- '@typescript-eslint/prefer-string-starts-ends-with': off,
317
- '@typescript-eslint/prefer-ts-expect-error': warn,
318
- '@typescript-eslint/promise-function-async': off,
319
- // Definition not found (2026-09-03):
320
- // '@typescript-eslint/quotes': [warn, 'single'],
321
- '@typescript-eslint/require-array-sort-compare': [
322
- warn,
323
- { ignoreStringArrays: true },
324
- ],
325
- '@typescript-eslint/require-await': warn,
326
- '@typescript-eslint/restrict-plus-operands': [
327
- error,
328
- { allowAny: false },
329
- ],
330
- // Disabled due to false positives:
331
- '@typescript-eslint/restrict-template-expressions': off,
332
- '@typescript-eslint/return-await': [warn, 'always'],
333
- // Definition not found (2026-09-03):
334
- // '@typescript-eslint/semi': [warn, 'always'],
335
- // Definition not found (2026-09-03):
336
- // '@typescript-eslint/space-before-function-paren': [warn, 'always'],
337
- '@typescript-eslint/strict-boolean-expressions': off,
338
- '@typescript-eslint/switch-exhaustiveness-check': [
339
- warn,
340
- {
341
- allowDefaultCaseForExhaustiveSwitch: true,
342
- considerDefaultExhaustiveForUnions: true,
343
- requireDefaultForNonUnion: true,
344
- },
345
- ],
346
- '@typescript-eslint/triple-slash-reference': warn,
347
- // Definition not found (2026-09-03):
348
- // '@typescript-eslint/type-annotation-spacing': warn,
349
- '@typescript-eslint/typedef': off,
350
- '@typescript-eslint/unbound-method': off,
351
- '@typescript-eslint/unified-signatures': warn,
352
- 'default-case': off,
353
- 'default-param-last': off,
354
- // Incompatible with the `noPropertyAccessFromIndexSignature` config setting:
355
- 'dot-notation': off,
356
- 'func-call-spacing': off,
357
- 'import/exports-last': off,
358
- 'import/no-unassigned-import': off,
359
- // Disabled due to false positives:
360
- 'import/no-unresolved': [off, { ignore: ['\\.types$'] }],
361
- indent: off,
362
- 'init-declarations': off,
363
- 'jsdoc/check-examples': off,
364
- 'jsdoc/require-description': off,
365
- 'jsdoc/require-description-complete-sentence': off,
366
- 'jsdoc/require-example': off,
367
- 'jsdoc/require-file-overview': off,
368
- 'jsdoc/require-hyphen-before-param-description': off,
369
- 'jsdoc/require-jsdoc': off,
370
- 'jsdoc/require-param': off,
371
- 'jsdoc/require-param-description': off,
372
- 'jsdoc/require-param-name': off,
373
- 'jsdoc/require-param-type': off,
374
- 'jsdoc/require-property': off,
375
- 'jsdoc/require-property-description': off,
376
- 'jsdoc/require-property-name': off,
377
- 'jsdoc/require-property-type': off,
378
- 'jsdoc/require-returns': off,
379
- 'jsdoc/require-returns-check': off,
380
- 'jsdoc/require-returns-description': off,
381
- 'jsdoc/require-returns-type': off,
382
- 'keyword-spacing': off,
383
- 'lines-between-class-members': off,
384
- 'no-dupe-class-members': off,
385
- 'no-duplicate-imports': off,
386
- 'no-empty-function': off,
387
- 'no-extra-parens': off,
388
- 'no-extra-semi': off,
389
- 'no-invalid-this': off,
390
- 'no-loop-func': off,
391
- 'no-loss-of-precision': off,
392
- // Handled by `@typescript-eslint/no-implied-eval`:
393
- 'no-new-func': off,
394
- 'no-redeclare': off,
395
- 'no-return-await': off,
396
- 'no-shadow': off,
397
- /**
398
- * @see https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
399
- */
400
- 'no-undef': off,
401
- 'no-unused-expressions': off,
402
- 'no-unused-vars': off,
403
- 'no-use-before-define': off,
404
- 'no-useless-constructor': off,
405
- 'no-void': off,
406
- quotes: off,
407
- 'require-await': off,
408
- semi: off,
409
- 'space-before-function-paren': off,
410
- },
411
- },
412
- // Based on `storybook/recommended`:
413
- {
414
- files: [
415
- '**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)',
416
- '**/*.stories.fixtures.@(ts|tsx|js|jsx|mjs|cjs)',
417
- '**/*.story.@(ts|tsx|js|jsx|mjs|cjs)',
418
- ],
419
- rules: {
420
- 'import/no-anonymous-default-export': off,
421
- 'react/no-multi-comp': off,
422
- 'react-hooks/rules-of-hooks': off,
423
- 'storybook/await-interactions': error,
424
- 'storybook/context-in-play-function': error,
425
- 'storybook/default-exports': error,
426
- 'storybook/hierarchy-separator': warn,
427
- 'storybook/no-redundant-story-name': warn,
428
- 'storybook/prefer-pascal-case': warn,
429
- 'storybook/story-exports': error,
430
- 'storybook/use-storybook-expect': error,
431
- 'storybook/use-storybook-testing-library': error,
43
+ globals: {
44
+ ...globals.browser,
45
+ ...globals.es2024,
46
+ ...globals.node,
47
+ globalThis: 'writable',
432
48
  },
433
49
  },
434
- // Based on `storybook/recommended`:
435
- {
436
- files: ['**/.storybook/main.@(js|cjs|mjs|ts)'],
437
- rules: {
438
- 'storybook/no-uninstalled-addons': error,
439
- },
50
+ plugins: {
51
+ import: importPlugin,
52
+ jsdoc: jsdocPlugin,
53
+ 'sort-exports': /** @type {any} */ (sortExportsPlugin),
54
+ 'sort-keys': /** @type {any} */ (sortKeysPlugin),
55
+ sonarjs: sonarjsPlugin,
56
+ storybook: /** @type {any} */ (storybookPlugin),
57
+ unicorn: unicornPlugin,
440
58
  },
441
- {
442
- files: [
443
- '**/spec/**',
444
- '**/test/**',
445
- '**/tests/**',
446
- '**/*.spec.*',
447
- '**/*.test.*',
59
+ rules: {
60
+ 'accessor-pairs': warn,
61
+ 'array-bracket-newline': off,
62
+ 'array-bracket-spacing': [warn, 'never'],
63
+ 'array-callback-return': warn,
64
+ 'array-element-newline': [warn, 'consistent'],
65
+ 'arrow-body-style': off,
66
+ 'arrow-parens': [warn, 'always'],
67
+ 'arrow-spacing': [warn, { after: true, before: true }],
68
+ 'block-scoped-var': warn,
69
+ 'block-spacing': [warn, 'always'],
70
+ 'brace-style': [warn, '1tbs'],
71
+ 'callback-return': [off, ['callback', 'cb', 'next']],
72
+ camelcase: [off, { properties: 'never' }],
73
+ 'capitalized-comments': off,
74
+ 'class-methods-use-this': off,
75
+ 'comma-dangle': [warn, 'always-multiline'],
76
+ 'comma-spacing': [warn, { after: true, before: false }],
77
+ 'comma-style': [warn, 'last'],
78
+ complexity: off,
79
+ 'computed-property-spacing': [warn, 'never'],
80
+ 'consistent-return': off,
81
+ 'consistent-this': off,
82
+ 'constructor-super': warn,
83
+ curly: [warn, 'all'],
84
+ 'default-case': warn,
85
+ 'default-param-last': warn,
86
+ 'dot-location': [warn, 'property'],
87
+ 'dot-notation': [warn, { allowKeywords: true }],
88
+ 'eol-last': warn,
89
+ eqeqeq: [warn, 'always', { null: 'ignore' }],
90
+ 'for-direction': warn,
91
+ 'func-call-spacing': [warn, 'never'],
92
+ 'func-name-matching': warn,
93
+ 'func-names': [off, 'as-needed'],
94
+ 'func-style': [off, 'expression'],
95
+ 'function-call-argument-newline': off,
96
+ 'function-paren-newline': off,
97
+ 'generator-star-spacing': [warn, { after: true, before: true }],
98
+ 'getter-return': warn,
99
+ 'global-require': off,
100
+ 'guard-for-in': off,
101
+ 'handle-callback-err': [warn, '^(err|error)$'],
102
+ 'id-blacklist': warn,
103
+ 'id-length': off,
104
+ 'id-match': [warn, '^[$_]$|^[$_]?[_A-Za-z][A-Za-z0-9_]*$'],
105
+ 'implicit-arrow-linebreak': [off, 'beside'],
106
+ 'import/default': warn,
107
+ 'import/dynamic-import-chunkname': off,
108
+ 'import/export': warn,
109
+ 'import/exports-last': off,
110
+ // This should be opt-in. It's not necessary for Vite, for example.
111
+ 'import/extensions': [off, { js: 'always', json: 'always' }],
112
+ 'import/first': warn,
113
+ 'import/group-exports': off,
114
+ 'import/imports-first': warn,
115
+ 'import/max-dependencies': off,
116
+ // Disabled due to false positives:
117
+ 'import/named': off,
118
+ // Disabled due to false positives:
119
+ 'import/namespace': off,
120
+ 'import/newline-after-import': warn,
121
+ 'import/no-absolute-path': warn,
122
+ 'import/no-amd': warn,
123
+ 'import/no-anonymous-default-export': warn,
124
+ 'import/no-commonjs': off,
125
+ 'import/no-cycle': off,
126
+ 'import/no-default-export': off,
127
+ // Disabled due to slow performance:
128
+ 'import/no-deprecated': off,
129
+ // Disabled due to slow performance, and because it's duplicated by `no-duplicate-imports`:
130
+ 'import/no-duplicates': off,
131
+ 'import/no-dynamic-require': off,
132
+ 'import/no-extraneous-dependencies': warn,
133
+ 'import/no-internal-modules': [
134
+ off,
135
+ { allow: ['[@a-z][@a-z]***', '**/*.svg'] },
448
136
  ],
449
- env: {
450
- jest: true,
451
- mocha: true,
137
+ 'import/no-mutable-exports': warn,
138
+ 'import/no-named-as-default': warn,
139
+ 'import/no-named-as-default-member': warn,
140
+ 'import/no-named-default': warn,
141
+ 'import/no-named-export': off,
142
+ 'import/no-namespace': off,
143
+ 'import/no-nodejs-modules': off,
144
+ // Disabled due to false positives (e.g. "@robinblomberg/schema"):
145
+ 'import/no-relative-parent-imports': off,
146
+ 'import/no-restricted-paths': off,
147
+ // Disabled due to slow performance:
148
+ 'import/no-self-import': off,
149
+ 'import/no-unassigned-import': warn,
150
+ // Disabled due to false positives on packages without a `main` field:
151
+ 'import/no-unresolved': off,
152
+ 'import/no-unused-modules': warn,
153
+ // Disabled due to slow performance:
154
+ 'import/no-useless-path-segments': off,
155
+ 'import/no-webpack-loader-syntax': warn,
156
+ /* 'import/order': [warn, {
157
+ alphabetize: {
158
+ caseInsensitive: false,
159
+ order: 'asc'
160
+ },
161
+ groups: [
162
+ 'builtin',
163
+ 'external',
164
+ 'internal',
165
+ 'unknown',
166
+ 'parent',
167
+ 'sibling',
168
+ 'index',
169
+ 'object'
170
+ ],
171
+ 'newlines-between': 'never'
172
+ }], */
173
+ 'import/prefer-default-export': off,
174
+ 'import/unambiguous': off,
175
+ indent: [warn, 2, { SwitchCase: 1 }],
176
+ 'init-declarations': off,
177
+ 'jsx-quotes': warn,
178
+ 'key-spacing': [warn, { afterColon: true, beforeColon: false }],
179
+ 'keyword-spacing': [off, { after: true, before: true }],
180
+ 'line-comment-position': off,
181
+ 'linebreak-style': [warn, 'unix'],
182
+ 'lines-around-comment': off,
183
+ 'lines-between-class-members': [
184
+ warn,
185
+ 'always',
186
+ { exceptAfterSingleLine: true },
187
+ ],
188
+ 'max-classes-per-file': [off, 1],
189
+ 'max-depth': off,
190
+ 'max-len': [
191
+ warn,
192
+ { code: 100, ignoreComments: true, ignoreRegExpLiterals: true },
193
+ ],
194
+ 'max-lines': off,
195
+ 'max-lines-per-function': off,
196
+ 'max-nested-callbacks': warn,
197
+ 'max-params': off,
198
+ 'max-statements': off,
199
+ 'max-statements-per-line': [warn, { max: 1 }],
200
+ 'multiline-comment-style': off,
201
+ 'multiline-ternary': off,
202
+ 'new-cap': [warn, { capIsNew: false, newIsCap: true, properties: true }],
203
+ 'new-parens': warn,
204
+ 'newline-per-chained-call': off,
205
+ 'no-alert': off,
206
+ 'no-array-constructor': warn,
207
+ 'no-async-promise-executor': warn,
208
+ 'no-await-in-loop': off,
209
+ 'no-bitwise': off,
210
+ 'no-buffer-constructor': warn,
211
+ 'no-caller': warn,
212
+ 'no-case-declarations': warn,
213
+ 'no-class-assign': warn,
214
+ 'no-compare-neg-zero': warn,
215
+ 'no-cond-assign': warn,
216
+ 'no-confusing-arrow': off,
217
+ 'no-console': [off, { allow: ['debug', 'error', 'info', 'warn'] }],
218
+ 'no-const-assign': warn,
219
+ 'no-constant-condition': [warn, { checkLoops: false }],
220
+ 'no-continue': off,
221
+ 'no-control-regex': off,
222
+ 'no-debugger': warn,
223
+ 'no-delete-var': warn,
224
+ 'no-div-regex': off,
225
+ 'no-dupe-args': warn,
226
+ 'no-dupe-class-members': warn,
227
+ 'no-dupe-keys': warn,
228
+ 'no-duplicate-case': warn,
229
+ 'no-duplicate-imports': warn,
230
+ 'no-else-return': warn,
231
+ 'no-empty': [off, { allowEmptyCatch: true }],
232
+ 'no-empty-character-class': warn,
233
+ 'no-empty-function': off,
234
+ 'no-empty-pattern': off,
235
+ 'no-eq-null': off,
236
+ 'no-eval': warn,
237
+ 'no-ex-assign': warn,
238
+ 'no-extend-native': warn,
239
+ 'no-extra-bind': warn,
240
+ 'no-extra-boolean-cast': warn,
241
+ 'no-extra-label': warn,
242
+ 'no-extra-parens': [off, 'all', { nestedBinaryExpressions: false }],
243
+ 'no-extra-semi': warn,
244
+ 'no-fallthrough': warn,
245
+ 'no-floating-decimal': warn,
246
+ 'no-func-assign': warn,
247
+ 'no-global-assign': warn,
248
+ 'no-implicit-coercion': [warn, { boolean: false, number: false }],
249
+ 'no-implicit-globals': warn,
250
+ 'no-implied-eval': warn,
251
+ 'no-inline-comments': off,
252
+ 'no-inner-declarations': [warn, 'functions'],
253
+ 'no-invalid-regexp': warn,
254
+ 'no-invalid-this': off,
255
+ 'no-irregular-whitespace': warn,
256
+ 'no-iterator': warn,
257
+ 'no-label-var': warn,
258
+ 'no-labels': [off, { allowLoop: false, allowSwitch: false }],
259
+ 'no-lone-blocks': off,
260
+ 'no-lonely-if': warn,
261
+ 'no-loop-func': warn,
262
+ 'no-loss-of-precision': warn,
263
+ 'no-magic-numbers': [
264
+ off,
265
+ { ignore: [-1, 0, 1, 2, 3, '-1n', '0n', '1n', '2n', '3n'] },
266
+ ],
267
+ 'no-misleading-character-class': warn,
268
+ 'no-mixed-operators': [
269
+ warn,
270
+ {
271
+ allowSamePrecedence: true,
272
+ groups: [
273
+ ['==', '!=', '===', '!==', '>', '>=', '<', '<='],
274
+ ['&&', '||'],
275
+ ['in', 'instanceof'],
276
+ ],
277
+ },
278
+ ],
279
+ 'no-mixed-requires': warn,
280
+ 'no-mixed-spaces-and-tabs': warn,
281
+ 'no-multi-assign': off,
282
+ 'no-multi-spaces': warn,
283
+ 'no-multi-str': warn,
284
+ 'no-multiple-empty-lines': [warn, { max: 1, maxEOF: 0 }],
285
+ // Replaced by `unicorn/no-negated-condition`:
286
+ 'no-negated-condition': off,
287
+ 'no-negated-in-lhs': warn,
288
+ 'no-nested-ternary': off,
289
+ 'no-new': warn,
290
+ 'no-new-func': warn,
291
+ 'no-new-object': warn,
292
+ 'no-new-require': warn,
293
+ 'no-new-symbol': warn,
294
+ 'no-new-wrappers': off,
295
+ 'no-obj-calls': warn,
296
+ 'no-octal': warn,
297
+ 'no-octal-escape': warn,
298
+ 'no-param-reassign': off,
299
+ 'no-path-concat': warn,
300
+ 'no-plusplus': off,
301
+ 'no-process-env': off,
302
+ 'no-process-exit': off,
303
+ 'no-proto': warn,
304
+ 'no-prototype-builtins': warn,
305
+ 'no-redeclare': [warn, { builtinGlobals: false }],
306
+ 'no-regex-spaces': warn,
307
+ 'no-restricted-globals': [
308
+ error,
309
+ 'isNaN',
310
+ /*
311
+ * https://github.com/sidoshi/eslint-restricted-globals/blob/master/index.js
312
+ */
313
+ 'addEventListener',
314
+ 'blur',
315
+ 'close',
316
+ 'closed',
317
+ 'confirm',
318
+ 'defaultStatus',
319
+ 'event',
320
+ 'external',
321
+ 'defaultstatus',
322
+ 'find',
323
+ 'focus',
324
+ 'frameElement',
325
+ 'frames',
326
+ 'history',
327
+ 'innerHeight',
328
+ 'innerWidth',
329
+ 'length',
330
+ 'location',
331
+ 'locationbar',
332
+ 'menubar',
333
+ 'moveBy',
334
+ 'moveTo',
335
+ 'name',
336
+ 'onblur',
337
+ 'onerror',
338
+ 'onfocus',
339
+ 'onload',
340
+ 'onresize',
341
+ 'onunload',
342
+ 'open',
343
+ 'opener',
344
+ 'opera',
345
+ 'outerHeight',
346
+ 'outerWidth',
347
+ 'pageXOffset',
348
+ 'pageYOffset',
349
+ 'parent',
350
+ 'print',
351
+ 'removeEventListener',
352
+ 'resizeBy',
353
+ 'resizeTo',
354
+ 'screen',
355
+ 'screenLeft',
356
+ 'screenTop',
357
+ 'screenX',
358
+ 'screenY',
359
+ 'scroll',
360
+ 'scrollbars',
361
+ 'scrollBy',
362
+ 'scrollTo',
363
+ 'scrollX',
364
+ 'scrollY',
365
+ 'self',
366
+ 'status',
367
+ 'statusbar',
368
+ 'stop',
369
+ 'toolbar',
370
+ 'top',
371
+ ],
372
+ 'no-restricted-imports': [
373
+ 'error',
374
+ { paths: ['console', 'node:console', 'test', 'node:test'] },
375
+ ],
376
+ 'no-restricted-modules': warn,
377
+ 'no-restricted-properties': warn,
378
+ 'no-restricted-syntax': [warn, 'WithStatement'],
379
+ 'no-return-assign': [warn, 'except-parens'],
380
+ 'no-return-await': off,
381
+ 'no-script-url': warn,
382
+ 'no-self-assign': [warn, { props: true }],
383
+ 'no-self-compare': warn,
384
+ 'no-sequences': warn,
385
+ 'no-shadow': warn,
386
+ 'no-shadow-restricted-names': warn,
387
+ 'no-sparse-arrays': warn,
388
+ 'no-sync': off,
389
+ 'no-tabs': warn,
390
+ 'no-template-curly-in-string': off,
391
+ 'no-ternary': off,
392
+ 'no-this-before-super': warn,
393
+ 'no-throw-literal': warn,
394
+ 'no-trailing-spaces': warn,
395
+ 'no-undef': error,
396
+ 'no-undef-init': warn,
397
+ 'no-undefined': off,
398
+ 'no-underscore-dangle': off,
399
+ 'no-unexpected-multiline': warn,
400
+ 'no-unmodified-loop-condition': warn,
401
+ 'no-unneeded-ternary': [warn, { defaultAssignment: false }],
402
+ 'no-unreachable': warn,
403
+ 'no-unsafe-finally': warn,
404
+ 'no-unsafe-negation': warn,
405
+ 'no-unused-expressions': [
406
+ warn,
407
+ {
408
+ allowShortCircuit: true,
409
+ allowTaggedTemplates: true,
410
+ allowTernary: true,
411
+ },
412
+ ],
413
+ 'no-unused-labels': warn,
414
+ 'no-unused-vars': [
415
+ warn,
416
+ {
417
+ args: 'none',
418
+ argsIgnorePattern: '^_.*$',
419
+ vars: 'all',
420
+ varsIgnorePattern: '^_.*$|^T$',
421
+ },
422
+ ],
423
+ 'no-use-before-define': [
424
+ error,
425
+ { classes: false, functions: false, variables: false },
426
+ ],
427
+ 'no-useless-call': warn,
428
+ 'no-useless-catch': warn,
429
+ 'no-useless-computed-key': warn,
430
+ 'no-useless-concat': warn,
431
+ 'no-useless-constructor': warn,
432
+ 'no-useless-escape': warn,
433
+ 'no-useless-rename': warn,
434
+ 'no-useless-return': warn,
435
+ 'no-var': warn,
436
+ 'no-void': warn,
437
+ 'no-warning-comments': off,
438
+ 'no-whitespace-before-property': warn,
439
+ 'no-with': warn,
440
+ 'nonblock-statement-body-position': warn,
441
+ 'object-curly-newline': [warn, { consistent: true, multiline: true }],
442
+ 'object-curly-spacing': [warn, 'always'],
443
+ 'object-property-newline': [
444
+ warn,
445
+ { allowMultiplePropertiesPerLine: true },
446
+ ],
447
+ 'object-shorthand': [warn, 'always'],
448
+ 'one-var': [warn, 'never'],
449
+ 'one-var-declaration-per-line': warn,
450
+ 'operator-assignment': [warn, 'always'],
451
+ 'operator-linebreak': [
452
+ warn,
453
+ 'after',
454
+ { overrides: { ':': 'before', '?': 'before', '??': 'before' } },
455
+ ],
456
+ 'padded-blocks': [
457
+ warn,
458
+ { blocks: 'never', classes: 'never', switches: 'never' },
459
+ ],
460
+ 'padding-line-between-statements': warn,
461
+ // You may want to use `fn(function () {})` for some advanced cases:
462
+ 'prefer-arrow-callback': off,
463
+ 'prefer-const': [warn, { destructuring: 'all' }],
464
+ 'prefer-destructuring': [off, { array: false, object: true }],
465
+ 'prefer-named-capture-group': off,
466
+ 'prefer-numeric-literals': warn,
467
+ 'prefer-object-spread': warn,
468
+ 'prefer-promise-reject-errors': warn,
469
+ 'prefer-regex-literals': warn,
470
+ 'prefer-rest-params': warn,
471
+ 'prefer-spread': warn,
472
+ 'prefer-template': off,
473
+ 'quote-props': [warn, 'as-needed'],
474
+ quotes: [
475
+ warn,
476
+ 'single',
477
+ { allowTemplateLiterals: false, avoidEscape: true },
478
+ ],
479
+ radix: warn,
480
+ // Disabled due to false (?) positives:
481
+ 'require-atomic-updates': off,
482
+ 'require-await': warn,
483
+ 'require-unicode-regexp': off,
484
+ 'require-yield': warn,
485
+ 'rest-spread-spacing': [warn, 'never'],
486
+ semi: [warn, 'always'],
487
+ 'semi-spacing': [warn, { after: true, before: false }],
488
+ 'semi-style': [warn, 'last'],
489
+ 'sonarjs/cognitive-complexity': off,
490
+ 'sonarjs/elseif-without-else': off,
491
+ 'sonarjs/max-switch-cases': off,
492
+ 'sonarjs/no-all-duplicated-branches': warn,
493
+ 'sonarjs/no-collapsible-if': warn,
494
+ 'sonarjs/no-collection-size-mischeck': warn,
495
+ 'sonarjs/no-duplicate-string': off,
496
+ 'sonarjs/no-duplicated-branches': off,
497
+ 'sonarjs/no-element-overwrite': warn,
498
+ 'sonarjs/no-empty-collection': warn,
499
+ 'sonarjs/no-extra-arguments': warn,
500
+ // Disabled due to slow performance:
501
+ 'sonarjs/no-gratuitous-expressions': off,
502
+ 'sonarjs/no-identical-conditions': warn,
503
+ 'sonarjs/no-identical-expressions': warn,
504
+ 'sonarjs/no-identical-functions': off,
505
+ 'sonarjs/no-ignored-return': warn,
506
+ 'sonarjs/no-inverted-boolean-check': off,
507
+ 'sonarjs/no-nested-switch': off,
508
+ 'sonarjs/no-nested-template-literals': off,
509
+ 'sonarjs/no-redundant-boolean': warn,
510
+ 'sonarjs/no-redundant-jump': warn,
511
+ 'sonarjs/no-same-line-conditional': warn,
512
+ 'sonarjs/no-small-switch': off,
513
+ 'sonarjs/no-unused-collection': warn,
514
+ 'sonarjs/no-use-of-empty-return-value': warn,
515
+ 'sonarjs/no-useless-catch': warn,
516
+ 'sonarjs/non-existent-operator': warn,
517
+ 'sonarjs/prefer-immediate-return': warn,
518
+ 'sonarjs/prefer-object-literal': warn,
519
+ 'sonarjs/prefer-single-boolean-return': warn,
520
+ 'sonarjs/prefer-while': warn,
521
+ 'sort-imports': [
522
+ off,
523
+ {
524
+ ignoreCase: false,
525
+ ignoreDeclarationSort: false,
526
+ ignoreMemberSort: false,
527
+ memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'],
528
+ },
529
+ ],
530
+ 'sort-keys': off,
531
+ 'sort-keys/sort-keys-fix': [off, 'asc', { natural: false }],
532
+ 'sort-vars': warn,
533
+ 'space-before-blocks': [warn, 'always'],
534
+ 'space-before-function-paren': [warn, 'always'],
535
+ 'space-in-parens': [warn, 'never'],
536
+ 'space-infix-ops': warn,
537
+ 'space-unary-ops': [warn, { nonwords: false, words: true }],
538
+ 'spaced-comment': [
539
+ warn,
540
+ 'always',
541
+ {
542
+ block: { balanced: true, exceptions: ['*'] },
543
+ line: { markers: ['!', '?', '*', '/', '//'] },
544
+ },
545
+ ],
546
+ strict: [warn, 'never'],
547
+ 'switch-colon-spacing': [warn, { after: true, before: false }],
548
+ 'symbol-description': warn,
549
+ 'template-curly-spacing': [warn, 'never'],
550
+ 'template-tag-spacing': [warn, 'never'],
551
+ 'unicode-bom': [warn, 'never'],
552
+ 'unicorn/better-regex': warn,
553
+ 'unicorn/catch-error-name': warn,
554
+ 'unicorn/consistent-destructuring': warn,
555
+ 'unicorn/consistent-function-scoping': warn,
556
+ 'unicorn/custom-error-definition': off,
557
+ 'unicorn/empty-brace-spaces': off,
558
+ 'unicorn/error-message': warn,
559
+ 'unicorn/escape-case': warn,
560
+ 'unicorn/expiring-todo-comments': warn,
561
+ 'unicorn/explicit-length-check': warn,
562
+ 'unicorn/filename-case': [
563
+ warn,
564
+ { cases: { kebabCase: true, pascalCase: true } },
565
+ ],
566
+ 'unicorn/import-style': off,
567
+ 'unicorn/new-for-builtins': warn,
568
+ 'unicorn/no-abusive-eslint-disable': warn,
569
+ 'unicorn/no-array-callback-reference': warn,
570
+ 'unicorn/no-array-for-each': warn,
571
+ 'unicorn/no-array-method-this-argument': warn,
572
+ 'unicorn/no-array-push-push': off,
573
+ 'unicorn/no-array-reduce': warn,
574
+ 'unicorn/no-await-expression-member': warn,
575
+ 'unicorn/no-console-spaces': warn,
576
+ 'unicorn/no-document-cookie': off,
577
+ 'unicorn/no-empty-file': off,
578
+ 'unicorn/no-for-loop': warn,
579
+ 'unicorn/no-hex-escape': off,
580
+ 'unicorn/no-instanceof-array': warn,
581
+ 'unicorn/no-invalid-remove-event-listener': warn,
582
+ 'unicorn/no-keyword-prefix': off,
583
+ // Duplicated by `sonarjs/no-collapsible-if`, but with more annoying highlighting.
584
+ // It has auto-fix however, which is sometimes wanted and sometimes not:
585
+ 'unicorn/no-lonely-if': off,
586
+ 'unicorn/no-negated-condition': warn,
587
+ 'unicorn/no-nested-ternary': off,
588
+ 'unicorn/no-new-array': off,
589
+ 'unicorn/no-new-buffer': warn,
590
+ 'unicorn/no-null': off,
591
+ 'unicorn/no-object-as-default-parameter': off,
592
+ 'unicorn/no-process-exit': off,
593
+ 'unicorn/no-static-only-class': warn,
594
+ // Disabled due to slow performance:
595
+ 'unicorn/no-thenable': off,
596
+ 'unicorn/no-this-assignment': off,
597
+ 'unicorn/no-typeof-undefined': [warn, { checkGlobalVariables: true }],
598
+ 'unicorn/no-unnecessary-await': warn,
599
+ 'unicorn/no-unreadable-array-destructuring': warn,
600
+ 'unicorn/no-unreadable-iife': warn,
601
+ 'unicorn/no-unused-properties': off,
602
+ 'unicorn/no-useless-fallback-in-spread': warn,
603
+ 'unicorn/no-useless-length-check': warn,
604
+ 'unicorn/no-useless-promise-resolve-reject': warn,
605
+ 'unicorn/no-useless-spread': warn,
606
+ 'unicorn/no-useless-switch-case': warn,
607
+ 'unicorn/no-useless-undefined': off,
608
+ 'unicorn/no-zero-fractions': warn,
609
+ 'unicorn/number-literal-case': off,
610
+ 'unicorn/numeric-separators-style': warn,
611
+ 'unicorn/prefer-add-event-listener': warn,
612
+ 'unicorn/prefer-array-find': warn,
613
+ 'unicorn/prefer-array-flat-map': warn,
614
+ // Disabled due to slow performance:
615
+ 'unicorn/prefer-array-flat': off,
616
+ 'unicorn/prefer-array-index-of': warn,
617
+ 'unicorn/prefer-array-some': warn,
618
+ 'unicorn/prefer-at': warn,
619
+ 'unicorn/prefer-blob-reading-methods': warn,
620
+ 'unicorn/prefer-code-point': off,
621
+ 'unicorn/prefer-date-now': warn,
622
+ 'unicorn/prefer-default-parameters': warn,
623
+ 'unicorn/prefer-dom-node-append': warn,
624
+ 'unicorn/prefer-dom-node-dataset': warn,
625
+ 'unicorn/prefer-dom-node-remove': warn,
626
+ 'unicorn/prefer-dom-node-text-content': warn,
627
+ 'unicorn/prefer-event-target': warn,
628
+ 'unicorn/prefer-export-from': warn,
629
+ 'unicorn/prefer-includes': warn,
630
+ 'unicorn/prefer-json-parse-buffer': off,
631
+ 'unicorn/prefer-keyboard-event-key': warn,
632
+ 'unicorn/prefer-logical-operator-over-ternary': warn,
633
+ 'unicorn/prefer-math-trunc': warn,
634
+ 'unicorn/prefer-modern-dom-apis': warn,
635
+ 'unicorn/prefer-modern-math-apis': warn,
636
+ 'unicorn/prefer-module': off,
637
+ 'unicorn/prefer-native-coercion-functions': warn,
638
+ 'unicorn/prefer-negative-index': warn,
639
+ 'unicorn/prefer-node-protocol': warn,
640
+ 'unicorn/prefer-number-properties': [
641
+ warn,
642
+ { checkInfinity: false, checkNaN: false },
643
+ ],
644
+ 'unicorn/prefer-object-from-entries': warn,
645
+ 'unicorn/prefer-optional-catch-binding': warn,
646
+ 'unicorn/prefer-prototype-methods': warn,
647
+ 'unicorn/prefer-query-selector': warn,
648
+ 'unicorn/prefer-reflect-apply': warn,
649
+ 'unicorn/prefer-regexp-test': warn,
650
+ 'unicorn/prefer-set-has': warn,
651
+ 'unicorn/prefer-set-size': warn,
652
+ // Disabled due to slow performance:
653
+ 'unicorn/prefer-spread': off,
654
+ 'unicorn/prefer-string-replace-all': warn,
655
+ 'unicorn/prefer-string-slice': warn,
656
+ 'unicorn/prefer-string-starts-ends-with': warn,
657
+ 'unicorn/prefer-string-trim-start-end': warn,
658
+ 'unicorn/prefer-switch': off,
659
+ 'unicorn/prefer-ternary': off,
660
+ // Not available in all Node.js versions or without specific settings:
661
+ 'unicorn/prefer-top-level-await': off,
662
+ 'unicorn/prefer-type-error': warn,
663
+ 'unicorn/prevent-abbreviations': off,
664
+ 'unicorn/relative-url-style': off,
665
+ 'unicorn/require-array-join-separator': warn,
666
+ 'unicorn/require-number-to-fixed-digits-argument': warn,
667
+ 'unicorn/require-post-message-target-origin': warn,
668
+ 'unicorn/string-content': off,
669
+ 'unicorn/switch-case-braces': off,
670
+ 'unicorn/template-indent': warn,
671
+ 'unicorn/text-encoding-identifier-case': warn,
672
+ 'unicorn/throw-new-error': warn,
673
+ 'use-isnan': warn,
674
+ 'valid-typeof': [off, { requireStringLiterals: true }],
675
+ 'vars-on-top': warn,
676
+ 'wrap-iife': [warn, 'any', { functionPrototypeMethods: true }],
677
+ 'wrap-regex': off,
678
+ 'yield-star-spacing': [warn, 'both'],
679
+ yoda: [warn, 'never'],
680
+ },
681
+ settings: {
682
+ 'import/extensions': ['.js', '.ts'],
683
+ 'import/internal-regex': '^@',
684
+ jsdoc: {
685
+ mode: 'closure',
452
686
  },
453
- rules: {
454
- '@typescript-eslint/no-magic-numbers': off,
455
- 'jsdoc/require-jsdoc': off,
456
- 'no-empty-character-class': off,
457
- 'no-magic-numbers': off,
458
- 'no-sparse-arrays': off,
459
- 'sonarjs/no-duplicate-string': off,
460
- 'sort-keys': off,
461
- 'symbol-description': off,
462
- 'unicorn/better-regex': off,
463
- 'unicorn/consistent-function-scoping': off,
464
- 'unicorn/new-for-builtins': off,
465
- 'unicorn/no-new-array': off,
687
+ react: {
688
+ version: 'detect',
466
689
  },
467
690
  },
468
- {
469
- files: ['**/*.jsx', '**/*.tsx'],
470
- plugins: ['react', 'react-hooks', 'react-refresh', 'jsx-a11y'],
471
- rules: {
472
- 'jsx-a11y/accessible-emoji': warn,
473
- 'jsx-a11y/alt-text': warn,
474
- 'jsx-a11y/anchor-has-content': warn,
475
- 'jsx-a11y/anchor-is-valid': warn,
476
- 'jsx-a11y/aria-activedescendant-has-tabindex': warn,
477
- 'jsx-a11y/aria-props': warn,
478
- 'jsx-a11y/aria-proptypes': warn,
479
- 'jsx-a11y/aria-role': warn,
480
- 'jsx-a11y/aria-unsupported-elements': warn,
481
- 'jsx-a11y/autocomplete-valid': warn,
482
- 'jsx-a11y/click-events-have-key-events': warn,
483
- 'jsx-a11y/control-has-associated-label': [
484
- warn,
485
- {
486
- ignoreElements: [
487
- 'audio',
488
- 'canvas',
489
- 'embed',
490
- 'input',
491
- 'textarea',
492
- 'tr',
493
- 'video',
494
- ],
495
- ignoreRoles: [
496
- 'grid',
497
- 'listbox',
498
- 'menu',
499
- 'menubar',
500
- 'radiogroup',
501
- 'row',
502
- 'tablist',
503
- 'toolbar',
504
- 'tree',
505
- 'treegrid',
506
- ],
507
- includeRoles: ['alert', 'dialog'],
508
- },
509
- ],
510
- 'jsx-a11y/heading-has-content': warn,
511
- 'jsx-a11y/html-has-lang': warn,
512
- 'jsx-a11y/iframe-has-title': warn,
513
- 'jsx-a11y/img-redundant-alt': warn,
514
- 'jsx-a11y/interactive-supports-focus': [
515
- warn,
516
- {
517
- tabbable: [
518
- 'button',
519
- 'checkbox',
520
- 'link',
521
- 'progressbar',
522
- 'searchbox',
523
- 'slider',
524
- 'spinbutton',
525
- 'switch',
526
- 'textbox',
527
- ],
528
- },
529
- ],
530
- 'jsx-a11y/label-has-associated-control': warn,
531
- 'jsx-a11y/label-has-for': off,
532
- 'jsx-a11y/media-has-caption': warn,
533
- 'jsx-a11y/mouse-events-have-key-events': warn,
534
- 'jsx-a11y/no-access-key': warn,
535
- 'jsx-a11y/no-autofocus': warn,
536
- 'jsx-a11y/no-distracting-elements': warn,
537
- 'jsx-a11y/no-interactive-element-to-noninteractive-role': warn,
538
- 'jsx-a11y/no-noninteractive-element-interactions': [
539
- warn,
540
- {
541
- body: ['onError', 'onLoad'],
542
- iframe: ['onError', 'onLoad'],
543
- img: ['onError', 'onLoad'],
544
- },
545
- ],
546
- 'jsx-a11y/no-noninteractive-element-to-interactive-role': warn,
547
- 'jsx-a11y/no-noninteractive-tabindex': warn,
548
- 'jsx-a11y/no-redundant-roles': warn,
549
- 'jsx-a11y/no-static-element-interactions': warn,
550
- 'jsx-a11y/role-has-required-aria-props': warn,
551
- 'jsx-a11y/role-supports-aria-props': warn,
552
- 'jsx-a11y/scope': warn,
553
- 'jsx-a11y/tabindex-no-positive': warn,
554
- 'react/boolean-prop-naming': warn,
555
- 'react/button-has-type': warn,
556
- 'react/default-props-match-prop-types': warn,
557
- 'react/destructuring-assignment': off,
558
- 'react/display-name': warn,
559
- 'react/forbid-component-props': off,
560
- 'react/forbid-dom-props': warn,
561
- 'react/forbid-elements': warn,
562
- 'react/forbid-foreign-prop-types': warn,
563
- 'react/forbid-prop-types': warn,
564
- 'react/function-component-definition': [
565
- warn,
566
- {
567
- namedComponents: 'arrow-function',
568
- unnamedComponents: 'arrow-function',
569
- },
570
- ],
571
- 'react/jsx-boolean-value': warn,
572
- 'react/jsx-child-element-spacing': warn,
573
- 'react/jsx-closing-bracket-location': warn,
574
- 'react/jsx-closing-tag-location': warn,
575
- 'react/jsx-curly-brace-presence': [
576
- warn,
577
- { children: 'always', props: 'never' },
578
- ],
579
- 'react/jsx-curly-newline': off,
580
- 'react/jsx-curly-spacing': warn,
581
- 'react/jsx-equals-spacing': warn,
582
- 'react/jsx-filename-extension': [
583
- warn,
584
- { extensions: ['.jsx', '.tsx'] },
585
- ],
586
- 'react/jsx-first-prop-new-line': warn,
587
- 'react/jsx-fragments': warn,
588
- 'react/jsx-handler-names': warn,
589
- 'react/jsx-indent': [warn, 2, { indentLogicalExpressions: true }],
590
- 'react/jsx-indent-props': [warn, 2],
591
- 'react/jsx-key': warn,
592
- 'react/jsx-max-depth': off,
593
- 'react/jsx-max-props-per-line': [
594
- warn,
595
- { maximum: 1, when: 'multiline' },
596
- ],
597
- 'react/jsx-newline': off,
598
- 'react/jsx-no-bind': [
599
- warn,
600
- {
601
- allowArrowFunctions: true,
602
- allowBind: true,
603
- allowFunctions: false,
604
- ignoreDOMComponents: false,
605
- ignoreRefs: false,
606
- },
607
- ],
608
- 'react/jsx-no-comment-textnodes': warn,
609
- 'react/jsx-no-constructed-context-values': warn,
610
- 'react/jsx-no-duplicate-props': warn,
611
- 'react/jsx-no-literals': warn,
612
- 'react/jsx-no-script-url': warn,
613
- 'react/jsx-no-target-blank': warn,
614
- 'react/jsx-no-undef': warn,
615
- 'react/jsx-no-useless-fragment': off,
616
- 'react/jsx-one-expression-per-line': warn,
617
- 'react/jsx-pascal-case': warn,
618
- 'react/jsx-props-no-multi-spaces': warn,
619
- 'react/jsx-props-no-spreading': off,
620
- 'react/jsx-sort-props': warn,
621
- /** @deprecated */
622
- 'react/jsx-space-before-closing': off,
623
- 'react/jsx-tag-spacing': [
624
- warn,
625
- {
626
- afterOpening: 'never',
627
- beforeClosing: 'allow',
628
- beforeSelfClosing: 'always',
629
- closingSlash: 'never',
630
- },
631
- ],
632
- 'react/jsx-uses-react': warn,
633
- 'react/jsx-uses-vars': warn,
634
- 'react/jsx-wrap-multilines': [
635
- warn,
636
- {
637
- arrow: 'ignore',
638
- assignment: 'ignore',
639
- condition: 'ignore',
640
- declaration: 'ignore',
641
- logical: 'ignore',
642
- prop: 'ignore',
643
- return: 'parens',
644
- },
645
- ],
646
- 'react/no-access-state-in-setstate': warn,
647
- 'react/no-adjacent-inline-elements': off,
648
- 'react/no-array-index-key': warn,
649
- 'react/no-children-prop': warn,
650
- 'react/no-danger': warn,
651
- 'react/no-danger-with-children': warn,
652
- 'react/no-deprecated': warn,
653
- 'react/no-did-mount-set-state': warn,
654
- 'react/no-did-update-set-state': warn,
655
- 'react/no-direct-mutation-state': warn,
656
- 'react/no-find-dom-node': warn,
657
- 'react/no-is-mounted': warn,
658
- 'react/no-multi-comp': off,
659
- 'react/no-redundant-should-component-update': warn,
660
- 'react/no-render-return-value': warn,
661
- 'react/no-set-state': off,
662
- 'react/no-string-refs': warn,
663
- 'react/no-this-in-sfc': warn,
664
- 'react/no-typos': warn,
665
- 'react/no-unescaped-entities': warn,
666
- 'react/no-unknown-property': warn,
667
- 'react/no-unsafe': warn,
668
- 'react/no-unused-prop-types': warn,
669
- 'react/no-unused-state': warn,
670
- 'react/no-will-update-set-state': warn,
671
- 'react/prefer-es6-class': warn,
672
- // Props are seldom mutated anyway:
673
- 'react/prefer-read-only-props': off,
674
- 'react/prefer-stateless-function': warn,
675
- 'react/prop-types': off,
676
- 'react/react-in-jsx-scope': off,
677
- 'react/require-default-props': off,
678
- 'react/require-optimization': off,
679
- 'react/require-render-return': warn,
680
- 'react/self-closing-comp': warn,
681
- 'react/sort-comp': [
682
- warn,
683
- {
684
- groups: {
685
- lifecycle: [
686
- 'displayName',
687
- 'propTypes',
688
- 'contextTypes',
689
- 'childContextTypes',
690
- 'mixins',
691
- 'statics',
692
- 'defaultProps',
693
- 'constructor',
694
- 'getDefaultProps',
695
- 'state',
696
- 'getInitialState',
697
- 'getChildContext',
698
- 'getDerivedStateFromProps',
699
- 'componentWillMount',
700
- 'UNSAFE_componentWillMount',
701
- 'componentDidMount',
702
- 'componentWillReceiveProps',
703
- 'UNSAFE_componentWillReceiveProps',
704
- 'shouldComponentUpdate',
705
- 'componentWillUpdate',
706
- 'UNSAFE_componentWillUpdate',
707
- 'getSnapshotBeforeUpdate',
708
- 'componentDidUpdate',
709
- 'componentDidCatch',
710
- 'componentWillUnmount',
711
- ],
712
- },
713
- order: [
714
- 'static-variables',
715
- 'static-methods',
716
- 'everything-else',
717
- 'instance-variables',
718
- 'instance-methods',
719
- 'lifecycle',
720
- 'render',
721
- ],
722
- },
723
- ],
724
- 'react/sort-default-props': warn,
725
- 'react/sort-prop-types': warn,
726
- 'react/state-in-constructor': off,
727
- 'react/static-property-placement': warn,
728
- 'react/style-prop-object': warn,
729
- 'react/void-dom-elements-no-children': warn,
730
- 'react-hooks/exhaustive-deps': warn,
731
- 'react-hooks/rules-of-hooks': error,
732
- 'react-refresh/only-export-components': [
733
- warn,
734
- { allowConstantExport: true },
735
- ],
691
+ },
692
+ {
693
+ files: ['**/*.ts', '**/*.tsx', '**/*.d.ts'],
694
+ languageOptions: {
695
+ globals: {
696
+ NodeJS: 'writable',
736
697
  },
737
- },
738
- {
739
- files: ['**/*.d.ts'],
740
- rules: {
741
- '@typescript-eslint/consistent-type-definitions': off,
742
- '@typescript-eslint/no-extraneous-class': off,
743
- '@typescript-eslint/no-use-before-define': off,
744
- 'import/no-default-export': off,
745
- 'jsdoc/require-jsdoc': off,
746
- 'max-classes-per-file': off,
698
+ parser: typescriptEslintParser,
699
+ parserOptions: {
700
+ project: './tsconfig.json',
747
701
  },
748
702
  },
749
- {
750
- files: ['**/*.config.js', '**/*.config.ts'],
751
- rules: {
752
- '@typescript-eslint/no-magic-numbers': off,
753
- 'no-magic-numbers': off,
754
- },
703
+ plugins: {
704
+ '@typescript-eslint': /** @type {any} */ (typescriptEslintPlugin),
755
705
  },
756
- {
757
- files: ['**/*.js'],
758
- rules: {
759
- 'jsdoc/check-access': warn,
760
- 'jsdoc/check-alignment': warn,
761
- 'jsdoc/check-examples': off,
762
- 'jsdoc/check-indentation': [off, { excludeTags: ['example'] }],
763
- 'jsdoc/check-line-alignment': warn,
764
- 'jsdoc/check-param-names': warn,
765
- 'jsdoc/check-property-names': warn,
766
- 'jsdoc/check-syntax': warn,
767
- 'jsdoc/check-tag-names': warn,
768
- 'jsdoc/check-types': [warn, { noDefaults: true }],
769
- 'jsdoc/check-values': warn,
770
- 'jsdoc/empty-tags': warn,
771
- 'jsdoc/implements-on-classes': warn,
772
- 'jsdoc/match-description': warn,
773
- 'jsdoc/no-bad-blocks': warn,
774
- 'jsdoc/no-defaults': warn,
775
- 'jsdoc/no-types': off,
776
- // Disabled due to false positives when referring to a generic type from inside its function:
777
- 'jsdoc/no-undefined-types': [
778
- off,
779
- {
780
- definedTypes: [
781
- 'unknown',
782
- /**
783
- * @see typescript\lib\lib.es5.d.ts
784
- * @version 4.1.2
785
- */
786
- 'PropertyKey',
787
- 'PropertyDescriptor',
788
- 'PropertyDescriptorMap',
789
- 'ObjectConstructor',
790
- 'FunctionConstructor',
791
- 'ThisParameterType',
792
- 'OmitThisParameter',
793
- 'CallableFunction',
794
- 'NewableFunction',
795
- 'IArguments',
796
- 'StringConstructor',
797
- 'BooleanConstructor',
798
- 'NumberConstructor',
799
- 'TemplateStringsArray',
800
- 'ImportMeta',
801
- 'DateConstructor',
802
- 'RegExpMatchArray',
803
- 'RegExpExecArray',
804
- 'RegExpConstructor',
805
- 'ErrorConstructor',
806
- 'EvalErrorConstructor',
807
- 'RangeErrorConstructor',
808
- 'ReferenceErrorConstructor',
809
- 'SyntaxErrorConstructor',
810
- 'TypeErrorConstructor',
811
- 'URIErrorConstructor',
812
- 'ReadonlyArray',
813
- 'ConcatArray',
814
- 'ArrayConstructor',
815
- 'TypedPropertyDescriptor',
816
- 'ClassDecorator',
817
- 'PropertyDecorator',
818
- 'MethodDecorator',
819
- 'ParameterDecorator',
820
- 'PromiseConstructorLike',
821
- 'PromiseLike',
822
- 'ArrayLike',
823
- 'Partial',
824
- 'Required',
825
- 'Readonly',
826
- 'Pick',
827
- 'Exclude',
828
- 'Extract',
829
- 'Omit',
830
- 'NonNullable',
831
- 'Parameters',
832
- 'ConstructorParameters',
833
- 'ReturnType',
834
- 'InstanceType',
835
- 'ThisType',
836
- 'ArrayBufferTypes',
837
- 'ArrayBufferLike',
838
- 'ArrayBufferConstructor',
839
- 'ArrayBufferView',
840
- 'DataViewConstructor',
841
- 'Int8ArrayConstructor',
842
- 'Uint8ArrayConstructor',
843
- 'Uint8ClampedArrayConstructor',
844
- 'Int16ArrayConstructor',
845
- 'Uint16ArrayConstructor',
846
- 'Int32ArrayConstructor',
847
- 'Uint32ArrayConstructor',
848
- 'Float32ArrayConstructor',
849
- 'Float64ArrayConstructor',
850
- ],
851
- },
852
- ],
853
- 'jsdoc/require-description': [
854
- off,
855
- { contexts: ['any'], descriptionStyle: 'body' },
856
- ],
857
- 'jsdoc/require-description-complete-sentence': off,
858
- 'jsdoc/require-example': off,
859
- 'jsdoc/require-file-overview': off,
860
- 'jsdoc/require-hyphen-before-param-description': [warn, 'never'],
861
- 'jsdoc/require-jsdoc': [
862
- off,
863
- {
864
- exemptEmptyFunctions: true,
865
- publicOnly: false,
866
- require: {
867
- ArrowFunctionExpression: true,
868
- ClassDeclaration: false,
869
- ClassExpression: false,
870
- FunctionDeclaration: true,
871
- FunctionExpression: true,
872
- MethodDefinition: true,
873
- },
706
+ rules: {
707
+ '@typescript-eslint/adjacent-overload-signatures': warn,
708
+ '@typescript-eslint/array-type': [warn, { default: 'array' }],
709
+ // Disabled due to slow performance:
710
+ '@typescript-eslint/await-thenable': off,
711
+ '@typescript-eslint/ban-ts-comment': warn,
712
+ '@typescript-eslint/ban-tslint-comment': warn,
713
+ '@typescript-eslint/ban-types': [
714
+ off,
715
+ {
716
+ extendDefaults: true,
717
+ types: {
718
+ Boolean: false,
719
+ Function: false,
720
+ Number: false,
721
+ Object: false,
722
+ '{}': false,
874
723
  },
875
- ],
876
- 'jsdoc/require-param': [
877
- warn,
878
- {
879
- checkConstructors: true,
880
- checkDestructured: true,
881
- checkDestructuredRoots: true,
882
- checkGetters: true,
883
- checkSetters: true,
884
- },
885
- ],
886
- 'jsdoc/require-param-description': off,
887
- 'jsdoc/require-param-name': warn,
888
- 'jsdoc/require-param-type': [warn, { contexts: ['any'] }],
889
- 'jsdoc/require-property': warn,
890
- 'jsdoc/require-property-description': off,
891
- 'jsdoc/require-property-name': warn,
892
- 'jsdoc/require-property-type': warn,
893
- 'jsdoc/require-returns': off,
894
- 'jsdoc/require-returns-check': warn,
895
- 'jsdoc/require-returns-description': off,
896
- 'jsdoc/require-returns-type': warn,
897
- 'jsdoc/valid-types': off,
898
- },
724
+ },
725
+ ],
726
+ // Definition not found (2026-09-03):
727
+ // '@typescript-eslint/brace-style': warn,
728
+ '@typescript-eslint/camelcase': off,
729
+ '@typescript-eslint/class-literal-property-style': [warn, 'fields'],
730
+ // Definition not found (2026-09-03):
731
+ // '@typescript-eslint/comma-dangle': [warn, 'always-multiline'],
732
+ // Definition not found (2026-09-03):
733
+ // '@typescript-eslint/comma-spacing': [warn, { after: true, before: false }],
734
+ '@typescript-eslint/consistent-type-assertions': [
735
+ off,
736
+ {
737
+ assertionStyle: 'as',
738
+ objectLiteralTypeAssertions: 'never',
739
+ },
740
+ ],
741
+ '@typescript-eslint/consistent-type-definitions': [warn, 'type'],
742
+ '@typescript-eslint/consistent-type-imports': [
743
+ warn,
744
+ {
745
+ disallowTypeAnnotations: true,
746
+ fixStyle: 'separate-type-imports',
747
+ prefer: 'type-imports',
748
+ },
749
+ ],
750
+ '@typescript-eslint/default-param-last': warn,
751
+ '@typescript-eslint/dot-notation': warn,
752
+ '@typescript-eslint/explicit-function-return-type': [
753
+ off,
754
+ { allowTypedFunctionExpressions: true },
755
+ ],
756
+ '@typescript-eslint/explicit-member-accessibility': [
757
+ warn,
758
+ { accessibility: 'no-public' },
759
+ ],
760
+ '@typescript-eslint/explicit-module-boundary-types': off,
761
+ // Definition not found (2026-09-03):
762
+ // '@typescript-eslint/func-call-spacing': warn,
763
+ // Definition not found (2026-09-03):
764
+ // '@typescript-eslint/indent': [
765
+ // warn,
766
+ // 2,
767
+ // {
768
+ // SwitchCase: 1,
769
+ // // Ignored nodes due to false positives:
770
+ // ignoredNodes: [
771
+ // 'TSIntersectionType',
772
+ // 'TSTypeParameterInstantiation',
773
+ // 'TSUnionType',
774
+ // ],
775
+ // },
776
+ // ],
777
+ // Definition not found (2020-10-26):
778
+ // '@typescript-eslint/index': warn,
779
+ '@typescript-eslint/init-declarations': off,
780
+ // Definition not found (2026-09-03):
781
+ // '@typescript-eslint/keyword-spacing': warn,
782
+ '@typescript-eslint/lines-between-class-members': [
783
+ off,
784
+ 'always',
785
+ { exceptAfterOverload: true, exceptAfterSingleLine: true },
786
+ ],
787
+ // Definition not found (2026-09-03):
788
+ // '@typescript-eslint/member-delimiter-style': [
789
+ // warn,
790
+ // {
791
+ // multiline: { delimiter: 'semi', requireLast: true },
792
+ // singleline: { delimiter: 'semi', requireLast: true },
793
+ // },
794
+ // ],
795
+ // Disabled to due buggy ordering:
796
+ '@typescript-eslint/member-ordering': [
797
+ off,
798
+ {
799
+ default: [
800
+ 'signature',
801
+ 'private-static-field',
802
+ 'protected-static-field',
803
+ 'public-static-field',
804
+ 'private-static-method',
805
+ 'protected-static-method',
806
+ 'public-static-method',
807
+ 'private-decorated-field',
808
+ 'protected-decorated-field',
809
+ 'public-decorated-field',
810
+ 'private-instance-field',
811
+ 'protected-instance-field',
812
+ 'public-instance-field',
813
+ 'protected-abstract-field',
814
+ 'public-abstract-field',
815
+ 'static-field',
816
+ 'private-field',
817
+ 'protected-field',
818
+ 'public-field',
819
+ 'instance-field',
820
+ 'abstract-field',
821
+ 'decorated-field',
822
+ 'field',
823
+ 'private-constructor',
824
+ 'protected-constructor',
825
+ 'public-constructor',
826
+ 'constructor',
827
+ 'private-decorated-method',
828
+ 'protected-decorated-method',
829
+ 'public-decorated-method',
830
+ 'private-instance-method',
831
+ 'protected-instance-method',
832
+ 'public-instance-method',
833
+ 'protected-abstract-method',
834
+ 'public-abstract-method',
835
+ 'static-method',
836
+ 'private-method',
837
+ 'protected-method',
838
+ 'public-method',
839
+ 'instance-method',
840
+ 'abstract-method',
841
+ 'decorated-method',
842
+ 'method',
843
+ ],
844
+ },
845
+ ],
846
+ '@typescript-eslint/method-signature-style': [warn, 'property'],
847
+ '@typescript-eslint/naming-convention': [
848
+ off,
849
+ {
850
+ format: ['camelCase'],
851
+ leadingUnderscore: 'allow',
852
+ selector: 'default',
853
+ },
854
+ {
855
+ format: ['camelCase', 'snake_case', 'PascalCase', 'UPPER_CASE'],
856
+ leadingUnderscore: 'allow',
857
+ selector: ['objectLiteralProperty'],
858
+ },
859
+ {
860
+ format: ['camelCase', 'PascalCase'],
861
+ leadingUnderscore: 'allow',
862
+ selector: ['function'],
863
+ },
864
+ {
865
+ format: ['camelCase', 'UPPER_CASE'],
866
+ leadingUnderscore: 'allow',
867
+ selector: ['objectLiteralMethod', 'typeMethod', 'variable'],
868
+ },
869
+ {
870
+ format: ['PascalCase'],
871
+ leadingUnderscore: 'allow',
872
+ selector: [
873
+ 'class',
874
+ 'enum',
875
+ 'interface',
876
+ 'typeAlias',
877
+ 'typeParameter',
878
+ ],
879
+ },
880
+ {
881
+ format: ['UPPER_CASE'],
882
+ leadingUnderscore: 'allow',
883
+ selector: ['enumMember'],
884
+ },
885
+ {
886
+ format: null,
887
+ leadingUnderscore: 'allow',
888
+ selector: ['parameter', 'property'],
889
+ },
890
+ ],
891
+ '@typescript-eslint/no-array-constructor': warn,
892
+ '@typescript-eslint/no-base-to-string': warn,
893
+ '@typescript-eslint/no-confusing-non-null-assertion': off,
894
+ '@typescript-eslint/no-dupe-class-members': warn,
895
+ '@typescript-eslint/no-dynamic-delete': off,
896
+ '@typescript-eslint/no-empty-function': off,
897
+ '@typescript-eslint/no-empty-interface': warn,
898
+ // Often warns about necessary uses:
899
+ '@typescript-eslint/no-explicit-any': off,
900
+ '@typescript-eslint/no-extra-non-null-assertion': warn,
901
+ // Definition not found (2026-09-03):
902
+ // '@typescript-eslint/no-extra-parens': [
903
+ // warn,
904
+ // 'all',
905
+ // { ignoreJSX: 'all', nestedBinaryExpressions: false },
906
+ // ],
907
+ // Definition not found (2026-09-03):
908
+ // '@typescript-eslint/no-extra-semi': warn,
909
+ '@typescript-eslint/no-extraneous-class': off,
910
+ // Disabled due to slow performance:
911
+ '@typescript-eslint/no-floating-promises': [
912
+ off,
913
+ { ignoreIIFE: true, ignoreVoid: true },
914
+ ],
915
+ '@typescript-eslint/no-for-in-array': warn,
916
+ '@typescript-eslint/no-implicit-any-catch': off,
917
+ '@typescript-eslint/no-implied-eval': warn,
918
+ '@typescript-eslint/no-inferrable-types': warn,
919
+ '@typescript-eslint/no-invalid-this': off,
920
+ '@typescript-eslint/no-invalid-void-type': off,
921
+ '@typescript-eslint/no-loop-func': warn,
922
+ '@typescript-eslint/no-loss-of-precision': warn,
923
+ '@typescript-eslint/no-magic-numbers': [
924
+ off,
925
+ {
926
+ ignore: [-1, 0, 1, 2, 3, '-1n', '0n', '1n', '2n', '3n'],
927
+ ignoreEnums: true,
928
+ ignoreNumericLiteralTypes: true,
929
+ ignoreReadonlyClassProperties: true,
930
+ },
931
+ ],
932
+ '@typescript-eslint/no-misused-new': warn,
933
+ '@typescript-eslint/no-misused-promises': off,
934
+ '@typescript-eslint/no-namespace': [off, { allowDeclarations: true }],
935
+ '@typescript-eslint/no-non-null-asserted-optional-chain': warn,
936
+ '@typescript-eslint/no-non-null-assertion': off,
937
+ '@typescript-eslint/no-parameter-properties': off,
938
+ '@typescript-eslint/no-redeclare': off,
939
+ '@typescript-eslint/no-require-imports': off,
940
+ '@typescript-eslint/no-shadow': warn,
941
+ '@typescript-eslint/no-this-alias': warn,
942
+ '@typescript-eslint/no-type-alias': off,
943
+ '@typescript-eslint/no-unnecessary-boolean-literal-compare': warn,
944
+ '@typescript-eslint/no-unnecessary-condition': off,
945
+ // Disabled due to slow performance:
946
+ '@typescript-eslint/no-unnecessary-qualifier': off,
947
+ '@typescript-eslint/no-unnecessary-type-arguments': off,
948
+ '@typescript-eslint/no-unnecessary-type-assertion': warn,
949
+ '@typescript-eslint/no-unsafe-assignment': off,
950
+ '@typescript-eslint/no-unsafe-call': off,
951
+ '@typescript-eslint/no-unsafe-member-access': off,
952
+ '@typescript-eslint/no-unsafe-return': off,
953
+ '@typescript-eslint/no-unused-expressions': [
954
+ warn,
955
+ {
956
+ allowShortCircuit: true,
957
+ allowTaggedTemplates: true,
958
+ allowTernary: true,
959
+ },
960
+ ],
961
+ '@typescript-eslint/no-unused-vars': [
962
+ warn,
963
+ {
964
+ args: 'none',
965
+ argsIgnorePattern: '^_.*$',
966
+ vars: 'all',
967
+ varsIgnorePattern: '^_.*$|^T$',
968
+ },
969
+ ],
970
+ '@typescript-eslint/no-use-before-define': [
971
+ error,
972
+ { classes: false, functions: false, variables: false },
973
+ ],
974
+ '@typescript-eslint/no-useless-constructor': warn,
975
+ '@typescript-eslint/no-var-requires': off,
976
+ '@typescript-eslint/only-throw-error': warn,
977
+ '@typescript-eslint/prefer-as-const': warn,
978
+ '@typescript-eslint/prefer-enum-initializers': off,
979
+ '@typescript-eslint/prefer-for-of': warn,
980
+ '@typescript-eslint/prefer-function-type': warn,
981
+ '@typescript-eslint/prefer-includes': warn,
982
+ '@typescript-eslint/prefer-literal-enum-member': warn,
983
+ '@typescript-eslint/prefer-namespace-keyword': warn,
984
+ // Warns about correct uses of `||`:
985
+ '@typescript-eslint/prefer-nullish-coalescing': off,
986
+ '@typescript-eslint/prefer-optional-chain': warn,
987
+ '@typescript-eslint/prefer-readonly': warn,
988
+ // Disabled due to error:
989
+ // "Error: Non-null Assertion Failed: Expected to find a property "XXX" for the type."
990
+ '@typescript-eslint/prefer-readonly-parameter-types': off,
991
+ '@typescript-eslint/prefer-reduce-type-parameter': warn,
992
+ '@typescript-eslint/prefer-regexp-exec': off,
993
+ '@typescript-eslint/prefer-string-starts-ends-with': off,
994
+ '@typescript-eslint/prefer-ts-expect-error': warn,
995
+ '@typescript-eslint/promise-function-async': off,
996
+ // Definition not found (2026-09-03):
997
+ // '@typescript-eslint/quotes': [warn, 'single'],
998
+ '@typescript-eslint/require-array-sort-compare': [
999
+ warn,
1000
+ { ignoreStringArrays: true },
1001
+ ],
1002
+ '@typescript-eslint/require-await': warn,
1003
+ '@typescript-eslint/restrict-plus-operands': [error, { allowAny: false }],
1004
+ // Disabled due to false positives:
1005
+ '@typescript-eslint/restrict-template-expressions': off,
1006
+ '@typescript-eslint/return-await': [warn, 'always'],
1007
+ // Definition not found (2026-09-03):
1008
+ // '@typescript-eslint/semi': [warn, 'always'],
1009
+ // Definition not found (2026-09-03):
1010
+ // '@typescript-eslint/space-before-function-paren': [warn, 'always'],
1011
+ '@typescript-eslint/strict-boolean-expressions': off,
1012
+ '@typescript-eslint/switch-exhaustiveness-check': [
1013
+ warn,
1014
+ {
1015
+ allowDefaultCaseForExhaustiveSwitch: true,
1016
+ considerDefaultExhaustiveForUnions: true,
1017
+ requireDefaultForNonUnion: true,
1018
+ },
1019
+ ],
1020
+ '@typescript-eslint/triple-slash-reference': warn,
1021
+ // Definition not found (2026-09-03):
1022
+ // '@typescript-eslint/type-annotation-spacing': warn,
1023
+ '@typescript-eslint/typedef': off,
1024
+ '@typescript-eslint/unbound-method': off,
1025
+ '@typescript-eslint/unified-signatures': off,
1026
+ 'default-case': off,
1027
+ 'default-param-last': off,
1028
+ 'dot-notation': off,
1029
+ 'func-call-spacing': off,
1030
+ 'import/exports-last': off,
1031
+ 'import/no-unassigned-import': off,
1032
+ // Disabled due to false positives:
1033
+ 'import/no-unresolved': [off, { ignore: ['\\.types$'] }],
1034
+ indent: off,
1035
+ 'init-declarations': off,
1036
+ 'jsdoc/check-examples': off,
1037
+ 'jsdoc/require-description': off,
1038
+ 'jsdoc/require-description-complete-sentence': off,
1039
+ 'jsdoc/require-example': off,
1040
+ 'jsdoc/require-file-overview': off,
1041
+ 'jsdoc/require-hyphen-before-param-description': off,
1042
+ 'jsdoc/require-jsdoc': off,
1043
+ 'jsdoc/require-param': off,
1044
+ 'jsdoc/require-param-description': off,
1045
+ 'jsdoc/require-param-name': off,
1046
+ 'jsdoc/require-param-type': off,
1047
+ 'jsdoc/require-property': off,
1048
+ 'jsdoc/require-property-description': off,
1049
+ 'jsdoc/require-property-name': off,
1050
+ 'jsdoc/require-property-type': off,
1051
+ 'jsdoc/require-returns': off,
1052
+ 'jsdoc/require-returns-check': off,
1053
+ 'jsdoc/require-returns-description': off,
1054
+ 'jsdoc/require-returns-type': off,
1055
+ 'keyword-spacing': off,
1056
+ 'lines-between-class-members': off,
1057
+ 'no-dupe-class-members': off,
1058
+ 'no-duplicate-imports': off,
1059
+ 'no-empty-function': off,
1060
+ 'no-extra-parens': off,
1061
+ 'no-extra-semi': off,
1062
+ 'no-invalid-this': off,
1063
+ 'no-loop-func': off,
1064
+ 'no-loss-of-precision': off,
1065
+ // Handled by `@typescript-eslint/no-implied-eval`:
1066
+ 'no-new-func': off,
1067
+ 'no-redeclare': off,
1068
+ 'no-return-await': off,
1069
+ 'no-shadow': off,
1070
+ /**
1071
+ * @see https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/FAQ.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
1072
+ */
1073
+ 'no-undef': off,
1074
+ 'no-unused-expressions': off,
1075
+ 'no-unused-vars': off,
1076
+ 'no-use-before-define': off,
1077
+ 'no-useless-constructor': off,
1078
+ 'no-void': off,
1079
+ quotes: off,
1080
+ 'require-await': off,
1081
+ semi: off,
1082
+ 'space-before-function-paren': off,
1083
+ },
1084
+ },
1085
+ // Based on `storybook/recommended`:
1086
+ {
1087
+ files: [
1088
+ '**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)',
1089
+ '**/*.stories.fixtures.@(ts|tsx|js|jsx|mjs|cjs)',
1090
+ '**/*.story.@(ts|tsx|js|jsx|mjs|cjs)',
1091
+ ],
1092
+ rules: {
1093
+ 'import/no-anonymous-default-export': off,
1094
+ 'react/no-multi-comp': off,
1095
+ 'react-hooks/rules-of-hooks': off,
1096
+ 'storybook/await-interactions': error,
1097
+ 'storybook/context-in-play-function': error,
1098
+ 'storybook/default-exports': error,
1099
+ 'storybook/hierarchy-separator': warn,
1100
+ 'storybook/no-redundant-story-name': warn,
1101
+ 'storybook/prefer-pascal-case': warn,
1102
+ 'storybook/story-exports': error,
1103
+ 'storybook/use-storybook-expect': error,
1104
+ 'storybook/use-storybook-testing-library': error,
899
1105
  },
900
- ],
901
- parser: '@babel/eslint-parser',
902
- parserOptions: {
903
- allowAwaitOutsideFunction: true,
904
- ecmaFeatures: {
905
- jsx: true,
1106
+ },
1107
+ // Based on `storybook/recommended`:
1108
+ {
1109
+ files: ['**/.storybook/main.@(js|cjs|mjs|ts)'],
1110
+ rules: {
1111
+ 'storybook/no-uninstalled-addons': error,
906
1112
  },
907
- ecmaVersion: 'latest',
908
- requireConfigFile: false,
909
- sourceType: 'module',
910
1113
  },
911
- plugins: [
912
- 'import',
913
- 'jsdoc',
914
- 'sort-exports',
915
- 'sort-keys',
916
- 'sonarjs',
917
- 'storybook',
918
- 'unicorn',
919
- ],
920
- root: true,
921
- rules: {
922
- 'accessor-pairs': warn,
923
- 'array-bracket-newline': off,
924
- 'array-bracket-spacing': [warn, 'never'],
925
- 'array-callback-return': warn,
926
- 'array-element-newline': [warn, 'consistent'],
927
- 'arrow-body-style': off,
928
- 'arrow-parens': [warn, 'always'],
929
- 'arrow-spacing': [warn, { after: true, before: true }],
930
- 'block-scoped-var': warn,
931
- 'block-spacing': [warn, 'always'],
932
- 'brace-style': [warn, '1tbs'],
933
- 'callback-return': [off, ['callback', 'cb', 'next']],
934
- camelcase: [off, { properties: 'never' }],
935
- 'capitalized-comments': off,
936
- 'class-methods-use-this': off,
937
- 'comma-dangle': [warn, 'always-multiline'],
938
- 'comma-spacing': [warn, { after: true, before: false }],
939
- 'comma-style': [warn, 'last'],
940
- complexity: off,
941
- 'computed-property-spacing': [warn, 'never'],
942
- 'consistent-return': off,
943
- 'consistent-this': warn,
944
- 'constructor-super': warn,
945
- curly: [warn, 'all'],
946
- 'default-case': warn,
947
- 'default-param-last': warn,
948
- 'dot-location': [warn, 'property'],
949
- 'dot-notation': [warn, { allowKeywords: true }],
950
- 'eol-last': warn,
951
- eqeqeq: [warn, 'always', { null: 'ignore' }],
952
- 'for-direction': warn,
953
- 'func-call-spacing': [warn, 'never'],
954
- 'func-name-matching': warn,
955
- 'func-names': [off, 'as-needed'],
956
- 'func-style': [off, 'expression'],
957
- 'function-call-argument-newline': off,
958
- 'function-paren-newline': off,
959
- 'generator-star-spacing': [warn, { after: true, before: true }],
960
- 'getter-return': warn,
961
- 'global-require': off,
962
- 'guard-for-in': off,
963
- 'handle-callback-err': [warn, '^(err|error)$'],
964
- 'id-blacklist': warn,
965
- 'id-length': off,
966
- 'id-match': [warn, '^[$_]$|^[$_]?[_A-Za-z][A-Za-z0-9_]*$'],
967
- 'implicit-arrow-linebreak': [off, 'beside'],
968
- 'import/default': warn,
969
- 'import/dynamic-import-chunkname': off,
970
- 'import/export': warn,
971
- 'import/exports-last': off,
972
- // This should be opt-in. It's not necessary for Vite, for example.
973
- 'import/extensions': [off, { js: 'always', json: 'always' }],
974
- 'import/first': warn,
975
- 'import/group-exports': off,
976
- 'import/imports-first': warn,
977
- 'import/max-dependencies': off,
978
- // Disabled due to false positives:
979
- 'import/named': off,
980
- // Disabled due to false positives:
981
- 'import/namespace': off,
982
- 'import/newline-after-import': warn,
983
- 'import/no-absolute-path': warn,
984
- 'import/no-amd': warn,
985
- 'import/no-anonymous-default-export': warn,
986
- 'import/no-commonjs': off,
987
- 'import/no-cycle': off,
988
- 'import/no-default-export': off,
989
- // Disabled due to slow performance:
990
- 'import/no-deprecated': off,
991
- // Disabled due to slow performance, and because it's duplicated by `no-duplicate-imports`:
992
- 'import/no-duplicates': off,
993
- 'import/no-dynamic-require': off,
994
- 'import/no-extraneous-dependencies': warn,
995
- 'import/no-internal-modules': [
996
- off,
997
- { allow: ['[@a-z][@a-z]***', '**/*.svg'] },
1114
+ {
1115
+ files: [
1116
+ '**/spec/**',
1117
+ '**/test/**',
1118
+ '**/tests/**',
1119
+ '**/*.spec.*',
1120
+ '**/*.test.*',
998
1121
  ],
999
- 'import/no-mutable-exports': warn,
1000
- 'import/no-named-as-default': warn,
1001
- 'import/no-named-as-default-member': warn,
1002
- 'import/no-named-default': warn,
1003
- 'import/no-named-export': off,
1004
- 'import/no-namespace': off,
1005
- 'import/no-nodejs-modules': off,
1006
- // Disabled due to false positives (e.g. "@robinblomberg/schema"):
1007
- 'import/no-relative-parent-imports': off,
1008
- 'import/no-restricted-paths': off,
1009
- // Disabled due to slow performance:
1010
- 'import/no-self-import': off,
1011
- 'import/no-unassigned-import': warn,
1012
- // Disabled due to false positives:
1013
- 'import/no-unresolved': warn,
1014
- 'import/no-unused-modules': warn,
1015
- // Disabled due to slow performance:
1016
- 'import/no-useless-path-segments': off,
1017
- 'import/no-webpack-loader-syntax': warn,
1018
- /* 'import/order': [warn, {
1019
- alphabetize: {
1020
- caseInsensitive: false,
1021
- order: 'asc'
1122
+ languageOptions: {
1123
+ globals: {
1124
+ ...globals.jest,
1125
+ ...globals.mocha,
1022
1126
  },
1023
- groups: [
1024
- 'builtin',
1025
- 'external',
1026
- 'internal',
1027
- 'unknown',
1028
- 'parent',
1029
- 'sibling',
1030
- 'index',
1031
- 'object'
1127
+ },
1128
+ rules: {
1129
+ '@typescript-eslint/no-magic-numbers': off,
1130
+ 'jsdoc/require-jsdoc': off,
1131
+ 'no-empty-character-class': off,
1132
+ 'no-magic-numbers': off,
1133
+ 'no-sparse-arrays': off,
1134
+ 'sonarjs/no-duplicate-string': off,
1135
+ 'sort-keys': off,
1136
+ 'symbol-description': off,
1137
+ 'unicorn/better-regex': off,
1138
+ 'unicorn/consistent-function-scoping': off,
1139
+ 'unicorn/new-for-builtins': off,
1140
+ 'unicorn/no-new-array': off,
1141
+ },
1142
+ },
1143
+ {
1144
+ files: ['**/*.jsx', '**/*.tsx'],
1145
+ plugins: {
1146
+ react: reactPlugin,
1147
+ 'react-hooks': /** @type {any} */ (reactHooksPlugin),
1148
+ 'react-refresh': reactRefreshPlugin,
1149
+ 'jsx-a11y': jsxA11yPlugin,
1150
+ },
1151
+ rules: {
1152
+ 'jsx-a11y/accessible-emoji': warn,
1153
+ 'jsx-a11y/alt-text': warn,
1154
+ 'jsx-a11y/anchor-has-content': warn,
1155
+ 'jsx-a11y/anchor-is-valid': warn,
1156
+ 'jsx-a11y/aria-activedescendant-has-tabindex': warn,
1157
+ 'jsx-a11y/aria-props': warn,
1158
+ 'jsx-a11y/aria-proptypes': warn,
1159
+ 'jsx-a11y/aria-role': warn,
1160
+ 'jsx-a11y/aria-unsupported-elements': warn,
1161
+ 'jsx-a11y/autocomplete-valid': warn,
1162
+ 'jsx-a11y/click-events-have-key-events': warn,
1163
+ 'jsx-a11y/control-has-associated-label': [
1164
+ warn,
1165
+ {
1166
+ ignoreElements: [
1167
+ 'audio',
1168
+ 'canvas',
1169
+ 'embed',
1170
+ 'input',
1171
+ 'textarea',
1172
+ 'tr',
1173
+ 'video',
1174
+ ],
1175
+ ignoreRoles: [
1176
+ 'grid',
1177
+ 'listbox',
1178
+ 'menu',
1179
+ 'menubar',
1180
+ 'radiogroup',
1181
+ 'row',
1182
+ 'tablist',
1183
+ 'toolbar',
1184
+ 'tree',
1185
+ 'treegrid',
1186
+ ],
1187
+ includeRoles: ['alert', 'dialog'],
1188
+ },
1032
1189
  ],
1033
- 'newlines-between': 'never'
1034
- }], */
1035
- 'import/prefer-default-export': off,
1036
- 'import/unambiguous': off,
1037
- indent: [warn, 2, { SwitchCase: 1 }],
1038
- 'init-declarations': off,
1039
- 'jsx-quotes': warn,
1040
- 'key-spacing': [warn, { afterColon: true, beforeColon: false }],
1041
- 'keyword-spacing': [off, { after: true, before: true }],
1042
- 'line-comment-position': off,
1043
- 'linebreak-style': [warn, 'unix'],
1044
- 'lines-around-comment': off,
1045
- 'lines-between-class-members': [
1046
- warn,
1047
- 'always',
1048
- { exceptAfterSingleLine: true },
1049
- ],
1050
- 'max-classes-per-file': [off, 1],
1051
- 'max-depth': off,
1052
- 'max-len': [
1053
- warn,
1054
- { code: 100, ignoreComments: true, ignoreRegExpLiterals: true },
1055
- ],
1056
- 'max-lines': off,
1057
- 'max-lines-per-function': off,
1058
- 'max-nested-callbacks': warn,
1059
- 'max-params': off,
1060
- 'max-statements': off,
1061
- 'max-statements-per-line': [warn, { max: 1 }],
1062
- 'multiline-comment-style': off,
1063
- 'multiline-ternary': off,
1064
- 'new-cap': [warn, { capIsNew: false, newIsCap: true, properties: true }],
1065
- 'new-parens': warn,
1066
- 'newline-per-chained-call': off,
1067
- 'no-alert': off,
1068
- 'no-array-constructor': warn,
1069
- 'no-async-promise-executor': warn,
1070
- 'no-await-in-loop': off,
1071
- 'no-bitwise': off,
1072
- 'no-buffer-constructor': warn,
1073
- 'no-caller': warn,
1074
- 'no-case-declarations': warn,
1075
- 'no-class-assign': warn,
1076
- 'no-compare-neg-zero': warn,
1077
- 'no-cond-assign': warn,
1078
- 'no-confusing-arrow': off,
1079
- 'no-console': [off, { allow: ['debug', 'error', 'info', 'warn'] }],
1080
- 'no-const-assign': warn,
1081
- 'no-constant-condition': [warn, { checkLoops: false }],
1082
- 'no-continue': off,
1083
- 'no-control-regex': off,
1084
- 'no-debugger': warn,
1085
- 'no-delete-var': warn,
1086
- 'no-div-regex': off,
1087
- 'no-dupe-args': warn,
1088
- 'no-dupe-class-members': warn,
1089
- 'no-dupe-keys': warn,
1090
- 'no-duplicate-case': warn,
1091
- 'no-duplicate-imports': warn,
1092
- 'no-else-return': warn,
1093
- 'no-empty': [off, { allowEmptyCatch: true }],
1094
- 'no-empty-character-class': warn,
1095
- 'no-empty-function': off,
1096
- 'no-empty-pattern': off,
1097
- 'no-eq-null': off,
1098
- 'no-eval': warn,
1099
- 'no-ex-assign': warn,
1100
- 'no-extend-native': warn,
1101
- 'no-extra-bind': warn,
1102
- 'no-extra-boolean-cast': warn,
1103
- 'no-extra-label': warn,
1104
- 'no-extra-parens': [off, 'all', { nestedBinaryExpressions: false }],
1105
- 'no-extra-semi': warn,
1106
- 'no-fallthrough': warn,
1107
- 'no-floating-decimal': warn,
1108
- 'no-func-assign': warn,
1109
- 'no-global-assign': warn,
1110
- 'no-implicit-coercion': [warn, { boolean: false, number: false }],
1111
- 'no-implicit-globals': warn,
1112
- 'no-implied-eval': warn,
1113
- 'no-inline-comments': off,
1114
- 'no-inner-declarations': [warn, 'functions'],
1115
- 'no-invalid-regexp': warn,
1116
- 'no-invalid-this': off,
1117
- 'no-irregular-whitespace': warn,
1118
- 'no-iterator': warn,
1119
- 'no-label-var': warn,
1120
- 'no-labels': [off, { allowLoop: false, allowSwitch: false }],
1121
- 'no-lone-blocks': off,
1122
- 'no-lonely-if': warn,
1123
- 'no-loop-func': warn,
1124
- 'no-loss-of-precision': warn,
1125
- 'no-magic-numbers': [
1126
- off,
1127
- { ignore: [-1, 0, 1, 2, 3, '-1n', '0n', '1n', '2n', '3n'] },
1128
- ],
1129
- 'no-misleading-character-class': warn,
1130
- 'no-mixed-operators': [
1131
- warn,
1132
- {
1133
- allowSamePrecedence: true,
1134
- groups: [
1135
- ['==', '!=', '===', '!==', '>', '>=', '<', '<='],
1136
- ['&&', '||'],
1137
- ['in', 'instanceof'],
1138
- ],
1139
- },
1140
- ],
1141
- 'no-mixed-requires': warn,
1142
- 'no-mixed-spaces-and-tabs': warn,
1143
- 'no-multi-assign': off,
1144
- 'no-multi-spaces': warn,
1145
- 'no-multi-str': warn,
1146
- 'no-multiple-empty-lines': [warn, { max: 1, maxEOF: 0 }],
1147
- // Replaced by `unicorn/no-negated-condition`:
1148
- 'no-negated-condition': off,
1149
- 'no-negated-in-lhs': warn,
1150
- 'no-nested-ternary': off,
1151
- 'no-new': warn,
1152
- 'no-new-func': warn,
1153
- 'no-new-object': warn,
1154
- 'no-new-require': warn,
1155
- 'no-new-symbol': warn,
1156
- 'no-new-wrappers': off,
1157
- 'no-obj-calls': warn,
1158
- 'no-octal': warn,
1159
- 'no-octal-escape': warn,
1160
- 'no-param-reassign': off,
1161
- 'no-path-concat': warn,
1162
- 'no-plusplus': off,
1163
- 'no-process-env': off,
1164
- 'no-process-exit': off,
1165
- 'no-proto': warn,
1166
- 'no-prototype-builtins': warn,
1167
- 'no-redeclare': [warn, { builtinGlobals: false }],
1168
- 'no-regex-spaces': warn,
1169
- 'no-restricted-globals': [
1170
- error,
1171
- 'isNaN',
1172
- /*
1173
- * https://github.com/sidoshi/eslint-restricted-globals/blob/master/index.js
1174
- */
1175
- 'addEventListener',
1176
- 'blur',
1177
- 'close',
1178
- 'closed',
1179
- 'confirm',
1180
- 'defaultStatus',
1181
- 'event',
1182
- 'external',
1183
- 'defaultstatus',
1184
- 'find',
1185
- 'focus',
1186
- 'frameElement',
1187
- 'frames',
1188
- 'history',
1189
- 'innerHeight',
1190
- 'innerWidth',
1191
- 'length',
1192
- 'location',
1193
- 'locationbar',
1194
- 'menubar',
1195
- 'moveBy',
1196
- 'moveTo',
1197
- 'name',
1198
- 'onblur',
1199
- 'onerror',
1200
- 'onfocus',
1201
- 'onload',
1202
- 'onresize',
1203
- 'onunload',
1204
- 'open',
1205
- 'opener',
1206
- 'opera',
1207
- 'outerHeight',
1208
- 'outerWidth',
1209
- 'pageXOffset',
1210
- 'pageYOffset',
1211
- 'parent',
1212
- 'print',
1213
- 'removeEventListener',
1214
- 'resizeBy',
1215
- 'resizeTo',
1216
- 'screen',
1217
- 'screenLeft',
1218
- 'screenTop',
1219
- 'screenX',
1220
- 'screenY',
1221
- 'scroll',
1222
- 'scrollbars',
1223
- 'scrollBy',
1224
- 'scrollTo',
1225
- 'scrollX',
1226
- 'scrollY',
1227
- 'self',
1228
- 'status',
1229
- 'statusbar',
1230
- 'stop',
1231
- 'toolbar',
1232
- 'top',
1233
- ],
1234
- 'no-restricted-imports': [
1235
- 'error',
1236
- { paths: ['console', 'node:console', 'test', 'node:test'] },
1237
- ],
1238
- 'no-restricted-modules': warn,
1239
- 'no-restricted-properties': warn,
1240
- 'no-restricted-syntax': [warn, 'WithStatement'],
1241
- 'no-return-assign': [warn, 'except-parens'],
1242
- 'no-return-await': off,
1243
- 'no-script-url': warn,
1244
- 'no-self-assign': [warn, { props: true }],
1245
- 'no-self-compare': warn,
1246
- 'no-sequences': warn,
1247
- 'no-shadow': warn,
1248
- 'no-shadow-restricted-names': warn,
1249
- 'no-sparse-arrays': warn,
1250
- 'no-sync': off,
1251
- 'no-tabs': warn,
1252
- 'no-template-curly-in-string': off,
1253
- 'no-ternary': off,
1254
- 'no-this-before-super': warn,
1255
- 'no-throw-literal': warn,
1256
- 'no-trailing-spaces': warn,
1257
- 'no-undef': error,
1258
- 'no-undef-init': warn,
1259
- 'no-undefined': off,
1260
- 'no-underscore-dangle': off,
1261
- 'no-unexpected-multiline': warn,
1262
- 'no-unmodified-loop-condition': warn,
1263
- 'no-unneeded-ternary': [warn, { defaultAssignment: false }],
1264
- 'no-unreachable': warn,
1265
- 'no-unsafe-finally': warn,
1266
- 'no-unsafe-negation': warn,
1267
- 'no-unused-expressions': [
1268
- warn,
1269
- {
1270
- allowShortCircuit: true,
1271
- allowTaggedTemplates: true,
1272
- allowTernary: true,
1273
- },
1274
- ],
1275
- 'no-unused-labels': warn,
1276
- 'no-unused-vars': [
1277
- warn,
1278
- {
1279
- args: 'none',
1280
- argsIgnorePattern: '^_.*$',
1281
- vars: 'all',
1282
- varsIgnorePattern: '^_.*$|^T$',
1283
- },
1284
- ],
1285
- 'no-use-before-define': [
1286
- error,
1287
- { classes: false, functions: false, variables: false },
1288
- ],
1289
- 'no-useless-call': warn,
1290
- 'no-useless-catch': warn,
1291
- 'no-useless-computed-key': warn,
1292
- 'no-useless-concat': warn,
1293
- 'no-useless-constructor': warn,
1294
- 'no-useless-escape': warn,
1295
- 'no-useless-rename': warn,
1296
- 'no-useless-return': warn,
1297
- 'no-var': warn,
1298
- 'no-void': warn,
1299
- 'no-warning-comments': off,
1300
- 'no-whitespace-before-property': warn,
1301
- 'no-with': warn,
1302
- 'nonblock-statement-body-position': warn,
1303
- 'object-curly-newline': [warn, { consistent: true, multiline: true }],
1304
- 'object-curly-spacing': [warn, 'always'],
1305
- 'object-property-newline': [warn, { allowMultiplePropertiesPerLine: true }],
1306
- 'object-shorthand': [warn, 'always'],
1307
- 'one-var': [warn, 'never'],
1308
- 'one-var-declaration-per-line': warn,
1309
- 'operator-assignment': [warn, 'always'],
1310
- 'operator-linebreak': [
1311
- warn,
1312
- 'after',
1313
- { overrides: { ':': 'before', '?': 'before', '??': 'before' } },
1314
- ],
1315
- 'padded-blocks': [
1316
- warn,
1317
- { blocks: 'never', classes: 'never', switches: 'never' },
1318
- ],
1319
- 'padding-line-between-statements': warn,
1320
- // You may want to use `fn(function () {})` for some advanced cases:
1321
- 'prefer-arrow-callback': off,
1322
- 'prefer-const': [warn, { destructuring: 'all' }],
1323
- 'prefer-destructuring': [off, { array: false, object: true }],
1324
- 'prefer-named-capture-group': off,
1325
- 'prefer-numeric-literals': warn,
1326
- 'prefer-object-spread': warn,
1327
- 'prefer-promise-reject-errors': warn,
1328
- 'prefer-regex-literals': warn,
1329
- 'prefer-rest-params': warn,
1330
- 'prefer-spread': warn,
1331
- 'prefer-template': off,
1332
- 'quote-props': [warn, 'as-needed'],
1333
- quotes: [
1334
- warn,
1335
- 'single',
1336
- { allowTemplateLiterals: false, avoidEscape: true },
1337
- ],
1338
- radix: warn,
1339
- // Disabled due to false (?) positives:
1340
- 'require-atomic-updates': off,
1341
- 'require-await': warn,
1342
- 'require-unicode-regexp': off,
1343
- 'require-yield': warn,
1344
- 'rest-spread-spacing': [warn, 'never'],
1345
- semi: [warn, 'always'],
1346
- 'semi-spacing': [warn, { after: true, before: false }],
1347
- 'semi-style': [warn, 'last'],
1348
- 'sonarjs/cognitive-complexity': off,
1349
- 'sonarjs/elseif-without-else': off,
1350
- 'sonarjs/max-switch-cases': off,
1351
- 'sonarjs/no-all-duplicated-branches': warn,
1352
- 'sonarjs/no-collapsible-if': warn,
1353
- 'sonarjs/no-collection-size-mischeck': warn,
1354
- 'sonarjs/no-duplicate-string': off,
1355
- 'sonarjs/no-duplicated-branches': off,
1356
- 'sonarjs/no-element-overwrite': warn,
1357
- 'sonarjs/no-empty-collection': warn,
1358
- 'sonarjs/no-extra-arguments': warn,
1359
- // Disabled due to slow performance:
1360
- 'sonarjs/no-gratuitous-expressions': off,
1361
- 'sonarjs/no-identical-conditions': warn,
1362
- 'sonarjs/no-identical-expressions': warn,
1363
- 'sonarjs/no-identical-functions': off,
1364
- 'sonarjs/no-ignored-return': warn,
1365
- 'sonarjs/no-inverted-boolean-check': off,
1366
- 'sonarjs/no-nested-switch': off,
1367
- 'sonarjs/no-nested-template-literals': off,
1368
- 'sonarjs/no-redundant-boolean': warn,
1369
- 'sonarjs/no-redundant-jump': warn,
1370
- 'sonarjs/no-same-line-conditional': warn,
1371
- 'sonarjs/no-small-switch': off,
1372
- 'sonarjs/no-unused-collection': warn,
1373
- 'sonarjs/no-use-of-empty-return-value': warn,
1374
- 'sonarjs/no-useless-catch': warn,
1375
- 'sonarjs/non-existent-operator': warn,
1376
- 'sonarjs/prefer-immediate-return': warn,
1377
- 'sonarjs/prefer-object-literal': warn,
1378
- 'sonarjs/prefer-single-boolean-return': warn,
1379
- 'sonarjs/prefer-while': warn,
1380
- 'sort-imports': [
1381
- off,
1382
- {
1383
- ignoreCase: false,
1384
- ignoreDeclarationSort: false,
1385
- ignoreMemberSort: false,
1386
- memberSyntaxSortOrder: ['none', 'all', 'single', 'multiple'],
1387
- },
1388
- ],
1389
- 'sort-keys': off,
1390
- 'sort-keys/sort-keys-fix': [off, 'asc', { natural: false }],
1391
- 'sort-vars': warn,
1392
- 'space-before-blocks': [warn, 'always'],
1393
- 'space-before-function-paren': [warn, 'always'],
1394
- 'space-in-parens': [warn, 'never'],
1395
- 'space-infix-ops': warn,
1396
- 'space-unary-ops': [warn, { nonwords: false, words: true }],
1397
- 'spaced-comment': [
1398
- warn,
1399
- 'always',
1400
- {
1401
- block: { balanced: true, exceptions: ['*'] },
1402
- line: { markers: ['!', '?', '*', '/', '//'] },
1403
- },
1404
- ],
1405
- strict: [warn, 'never'],
1406
- 'switch-colon-spacing': [warn, { after: true, before: false }],
1407
- 'symbol-description': warn,
1408
- 'template-curly-spacing': [warn, 'never'],
1409
- 'template-tag-spacing': [warn, 'never'],
1410
- 'unicode-bom': [warn, 'never'],
1411
- 'unicorn/better-regex': warn,
1412
- 'unicorn/catch-error-name': warn,
1413
- 'unicorn/consistent-destructuring': warn,
1414
- 'unicorn/consistent-function-scoping': warn,
1415
- 'unicorn/custom-error-definition': off,
1416
- 'unicorn/empty-brace-spaces': off,
1417
- 'unicorn/error-message': warn,
1418
- 'unicorn/escape-case': warn,
1419
- 'unicorn/expiring-todo-comments': warn,
1420
- 'unicorn/explicit-length-check': warn,
1421
- 'unicorn/filename-case': [
1422
- warn,
1423
- { cases: { kebabCase: true, pascalCase: true } },
1424
- ],
1425
- 'unicorn/import-style': off,
1426
- 'unicorn/new-for-builtins': warn,
1427
- 'unicorn/no-abusive-eslint-disable': warn,
1428
- 'unicorn/no-array-callback-reference': warn,
1429
- 'unicorn/no-array-for-each': warn,
1430
- 'unicorn/no-array-method-this-argument': warn,
1431
- 'unicorn/no-array-push-push': off,
1432
- 'unicorn/no-array-reduce': warn,
1433
- 'unicorn/no-await-expression-member': warn,
1434
- 'unicorn/no-console-spaces': warn,
1435
- 'unicorn/no-document-cookie': off,
1436
- 'unicorn/no-empty-file': off,
1437
- 'unicorn/no-for-loop': warn,
1438
- 'unicorn/no-hex-escape': off,
1439
- 'unicorn/no-instanceof-array': warn,
1440
- 'unicorn/no-invalid-remove-event-listener': warn,
1441
- 'unicorn/no-keyword-prefix': off,
1442
- // Duplicated by `sonarjs/no-collapsible-if`, but with more annoying highlighting.
1443
- // It has auto-fix however, which is sometimes wanted and sometimes not:
1444
- 'unicorn/no-lonely-if': off,
1445
- 'unicorn/no-negated-condition': warn,
1446
- 'unicorn/no-nested-ternary': off,
1447
- 'unicorn/no-new-array': off,
1448
- 'unicorn/no-new-buffer': warn,
1449
- 'unicorn/no-null': off,
1450
- 'unicorn/no-object-as-default-parameter': off,
1451
- 'unicorn/no-process-exit': off,
1452
- 'unicorn/no-static-only-class': warn,
1453
- // Disabled due to slow performance:
1454
- 'unicorn/no-thenable': off,
1455
- 'unicorn/no-this-assignment': warn,
1456
- 'unicorn/no-typeof-undefined': [warn, { checkGlobalVariables: true }],
1457
- 'unicorn/no-unnecessary-await': warn,
1458
- 'unicorn/no-unreadable-array-destructuring': warn,
1459
- 'unicorn/no-unreadable-iife': warn,
1460
- 'unicorn/no-unused-properties': off,
1461
- 'unicorn/no-useless-fallback-in-spread': warn,
1462
- 'unicorn/no-useless-length-check': warn,
1463
- 'unicorn/no-useless-promise-resolve-reject': warn,
1464
- 'unicorn/no-useless-spread': warn,
1465
- 'unicorn/no-useless-switch-case': warn,
1466
- 'unicorn/no-useless-undefined': off,
1467
- 'unicorn/no-zero-fractions': warn,
1468
- 'unicorn/number-literal-case': off,
1469
- 'unicorn/numeric-separators-style': warn,
1470
- 'unicorn/prefer-add-event-listener': warn,
1471
- 'unicorn/prefer-array-find': warn,
1472
- 'unicorn/prefer-array-flat-map': warn,
1473
- // Disabled due to slow performance:
1474
- 'unicorn/prefer-array-flat': off,
1475
- 'unicorn/prefer-array-index-of': warn,
1476
- 'unicorn/prefer-array-some': warn,
1477
- 'unicorn/prefer-at': warn,
1478
- 'unicorn/prefer-blob-reading-methods': warn,
1479
- 'unicorn/prefer-code-point': off,
1480
- 'unicorn/prefer-date-now': warn,
1481
- 'unicorn/prefer-default-parameters': warn,
1482
- 'unicorn/prefer-dom-node-append': warn,
1483
- 'unicorn/prefer-dom-node-dataset': warn,
1484
- 'unicorn/prefer-dom-node-remove': warn,
1485
- 'unicorn/prefer-dom-node-text-content': warn,
1486
- 'unicorn/prefer-event-target': warn,
1487
- 'unicorn/prefer-export-from': warn,
1488
- 'unicorn/prefer-includes': warn,
1489
- 'unicorn/prefer-json-parse-buffer': off,
1490
- 'unicorn/prefer-keyboard-event-key': warn,
1491
- 'unicorn/prefer-logical-operator-over-ternary': warn,
1492
- 'unicorn/prefer-math-trunc': warn,
1493
- 'unicorn/prefer-modern-dom-apis': warn,
1494
- 'unicorn/prefer-modern-math-apis': warn,
1495
- 'unicorn/prefer-module': off,
1496
- 'unicorn/prefer-native-coercion-functions': warn,
1497
- 'unicorn/prefer-negative-index': warn,
1498
- 'unicorn/prefer-node-protocol': warn,
1499
- 'unicorn/prefer-number-properties': [
1500
- warn,
1501
- { checkInfinity: false, checkNaN: false },
1502
- ],
1503
- 'unicorn/prefer-object-from-entries': warn,
1504
- 'unicorn/prefer-optional-catch-binding': warn,
1505
- 'unicorn/prefer-prototype-methods': warn,
1506
- 'unicorn/prefer-query-selector': warn,
1507
- 'unicorn/prefer-reflect-apply': warn,
1508
- 'unicorn/prefer-regexp-test': warn,
1509
- 'unicorn/prefer-set-has': warn,
1510
- 'unicorn/prefer-set-size': warn,
1511
- // Disabled due to slow performance:
1512
- 'unicorn/prefer-spread': off,
1513
- 'unicorn/prefer-string-replace-all': warn,
1514
- 'unicorn/prefer-string-slice': warn,
1515
- 'unicorn/prefer-string-starts-ends-with': warn,
1516
- 'unicorn/prefer-string-trim-start-end': warn,
1517
- 'unicorn/prefer-switch': off,
1518
- 'unicorn/prefer-ternary': off,
1519
- // Not available in all Node.js versions or without specific settings:
1520
- 'unicorn/prefer-top-level-await': off,
1521
- 'unicorn/prefer-type-error': warn,
1522
- 'unicorn/prevent-abbreviations': off,
1523
- 'unicorn/relative-url-style': off,
1524
- 'unicorn/require-array-join-separator': warn,
1525
- 'unicorn/require-number-to-fixed-digits-argument': warn,
1526
- 'unicorn/require-post-message-target-origin': warn,
1527
- 'unicorn/string-content': off,
1528
- 'unicorn/switch-case-braces': off,
1529
- 'unicorn/template-indent': warn,
1530
- 'unicorn/text-encoding-identifier-case': warn,
1531
- 'unicorn/throw-new-error': warn,
1532
- 'use-isnan': warn,
1533
- 'valid-typeof': [off, { requireStringLiterals: true }],
1534
- 'vars-on-top': warn,
1535
- 'wrap-iife': [warn, 'any', { functionPrototypeMethods: true }],
1536
- 'wrap-regex': off,
1537
- 'yield-star-spacing': [warn, 'both'],
1538
- yoda: [warn, 'never'],
1190
+ 'jsx-a11y/heading-has-content': warn,
1191
+ 'jsx-a11y/html-has-lang': warn,
1192
+ 'jsx-a11y/iframe-has-title': warn,
1193
+ 'jsx-a11y/img-redundant-alt': warn,
1194
+ 'jsx-a11y/interactive-supports-focus': [
1195
+ warn,
1196
+ {
1197
+ tabbable: [
1198
+ 'button',
1199
+ 'checkbox',
1200
+ 'link',
1201
+ 'progressbar',
1202
+ 'searchbox',
1203
+ 'slider',
1204
+ 'spinbutton',
1205
+ 'switch',
1206
+ 'textbox',
1207
+ ],
1208
+ },
1209
+ ],
1210
+ 'jsx-a11y/label-has-associated-control': warn,
1211
+ 'jsx-a11y/label-has-for': off,
1212
+ 'jsx-a11y/media-has-caption': warn,
1213
+ 'jsx-a11y/mouse-events-have-key-events': warn,
1214
+ 'jsx-a11y/no-access-key': warn,
1215
+ 'jsx-a11y/no-autofocus': warn,
1216
+ 'jsx-a11y/no-distracting-elements': warn,
1217
+ 'jsx-a11y/no-interactive-element-to-noninteractive-role': warn,
1218
+ 'jsx-a11y/no-noninteractive-element-interactions': [
1219
+ warn,
1220
+ {
1221
+ body: ['onError', 'onLoad'],
1222
+ iframe: ['onError', 'onLoad'],
1223
+ img: ['onError', 'onLoad'],
1224
+ },
1225
+ ],
1226
+ 'jsx-a11y/no-noninteractive-element-to-interactive-role': warn,
1227
+ 'jsx-a11y/no-noninteractive-tabindex': warn,
1228
+ 'jsx-a11y/no-redundant-roles': warn,
1229
+ 'jsx-a11y/no-static-element-interactions': warn,
1230
+ 'jsx-a11y/role-has-required-aria-props': warn,
1231
+ 'jsx-a11y/role-supports-aria-props': warn,
1232
+ 'jsx-a11y/scope': warn,
1233
+ 'jsx-a11y/tabindex-no-positive': warn,
1234
+ 'react/boolean-prop-naming': warn,
1235
+ 'react/button-has-type': warn,
1236
+ 'react/default-props-match-prop-types': warn,
1237
+ 'react/destructuring-assignment': off,
1238
+ 'react/display-name': warn,
1239
+ 'react/forbid-component-props': off,
1240
+ 'react/forbid-dom-props': warn,
1241
+ 'react/forbid-elements': warn,
1242
+ 'react/forbid-foreign-prop-types': warn,
1243
+ 'react/forbid-prop-types': warn,
1244
+ 'react/function-component-definition': [
1245
+ warn,
1246
+ {
1247
+ namedComponents: 'arrow-function',
1248
+ unnamedComponents: 'arrow-function',
1249
+ },
1250
+ ],
1251
+ 'react/jsx-boolean-value': warn,
1252
+ 'react/jsx-child-element-spacing': warn,
1253
+ 'react/jsx-closing-bracket-location': warn,
1254
+ 'react/jsx-closing-tag-location': warn,
1255
+ 'react/jsx-curly-brace-presence': [
1256
+ warn,
1257
+ { children: 'always', props: 'never' },
1258
+ ],
1259
+ 'react/jsx-curly-newline': off,
1260
+ 'react/jsx-curly-spacing': warn,
1261
+ 'react/jsx-equals-spacing': warn,
1262
+ 'react/jsx-filename-extension': [warn, { extensions: ['.jsx', '.tsx'] }],
1263
+ 'react/jsx-first-prop-new-line': warn,
1264
+ 'react/jsx-fragments': warn,
1265
+ 'react/jsx-handler-names': warn,
1266
+ 'react/jsx-indent': [warn, 2, { indentLogicalExpressions: true }],
1267
+ 'react/jsx-indent-props': [warn, 2],
1268
+ 'react/jsx-key': warn,
1269
+ 'react/jsx-max-depth': off,
1270
+ 'react/jsx-max-props-per-line': [warn, { maximum: 1, when: 'multiline' }],
1271
+ 'react/jsx-newline': off,
1272
+ 'react/jsx-no-bind': [
1273
+ warn,
1274
+ {
1275
+ allowArrowFunctions: true,
1276
+ allowBind: true,
1277
+ allowFunctions: false,
1278
+ ignoreDOMComponents: false,
1279
+ ignoreRefs: false,
1280
+ },
1281
+ ],
1282
+ 'react/jsx-no-comment-textnodes': warn,
1283
+ 'react/jsx-no-constructed-context-values': warn,
1284
+ 'react/jsx-no-duplicate-props': warn,
1285
+ 'react/jsx-no-literals': warn,
1286
+ 'react/jsx-no-script-url': warn,
1287
+ 'react/jsx-no-target-blank': warn,
1288
+ 'react/jsx-no-undef': warn,
1289
+ 'react/jsx-no-useless-fragment': off,
1290
+ 'react/jsx-one-expression-per-line': warn,
1291
+ 'react/jsx-pascal-case': warn,
1292
+ 'react/jsx-props-no-multi-spaces': warn,
1293
+ 'react/jsx-props-no-spreading': off,
1294
+ 'react/jsx-sort-props': warn,
1295
+ /** @deprecated */
1296
+ 'react/jsx-space-before-closing': off,
1297
+ 'react/jsx-tag-spacing': [
1298
+ warn,
1299
+ {
1300
+ afterOpening: 'never',
1301
+ beforeClosing: 'allow',
1302
+ beforeSelfClosing: 'always',
1303
+ closingSlash: 'never',
1304
+ },
1305
+ ],
1306
+ 'react/jsx-uses-react': warn,
1307
+ 'react/jsx-uses-vars': warn,
1308
+ 'react/jsx-wrap-multilines': [
1309
+ warn,
1310
+ {
1311
+ arrow: 'ignore',
1312
+ assignment: 'ignore',
1313
+ condition: 'ignore',
1314
+ declaration: 'ignore',
1315
+ logical: 'ignore',
1316
+ prop: 'ignore',
1317
+ return: 'parens',
1318
+ },
1319
+ ],
1320
+ 'react/no-access-state-in-setstate': warn,
1321
+ 'react/no-adjacent-inline-elements': off,
1322
+ 'react/no-array-index-key': warn,
1323
+ 'react/no-children-prop': warn,
1324
+ 'react/no-danger': warn,
1325
+ 'react/no-danger-with-children': warn,
1326
+ 'react/no-deprecated': warn,
1327
+ 'react/no-did-mount-set-state': warn,
1328
+ 'react/no-did-update-set-state': warn,
1329
+ 'react/no-direct-mutation-state': warn,
1330
+ 'react/no-find-dom-node': warn,
1331
+ 'react/no-is-mounted': warn,
1332
+ 'react/no-multi-comp': off,
1333
+ 'react/no-redundant-should-component-update': warn,
1334
+ 'react/no-render-return-value': warn,
1335
+ 'react/no-set-state': off,
1336
+ 'react/no-string-refs': warn,
1337
+ 'react/no-this-in-sfc': warn,
1338
+ 'react/no-typos': warn,
1339
+ 'react/no-unescaped-entities': warn,
1340
+ 'react/no-unknown-property': warn,
1341
+ 'react/no-unsafe': warn,
1342
+ 'react/no-unused-prop-types': warn,
1343
+ 'react/no-unused-state': warn,
1344
+ 'react/no-will-update-set-state': warn,
1345
+ 'react/prefer-es6-class': warn,
1346
+ // Props are seldom mutated anyway:
1347
+ 'react/prefer-read-only-props': off,
1348
+ 'react/prefer-stateless-function': warn,
1349
+ 'react/prop-types': off,
1350
+ 'react/react-in-jsx-scope': off,
1351
+ 'react/require-default-props': off,
1352
+ 'react/require-optimization': off,
1353
+ 'react/require-render-return': warn,
1354
+ 'react/self-closing-comp': warn,
1355
+ 'react/sort-comp': [
1356
+ warn,
1357
+ {
1358
+ groups: {
1359
+ lifecycle: [
1360
+ 'displayName',
1361
+ 'propTypes',
1362
+ 'contextTypes',
1363
+ 'childContextTypes',
1364
+ 'mixins',
1365
+ 'statics',
1366
+ 'defaultProps',
1367
+ 'constructor',
1368
+ 'getDefaultProps',
1369
+ 'state',
1370
+ 'getInitialState',
1371
+ 'getChildContext',
1372
+ 'getDerivedStateFromProps',
1373
+ 'componentWillMount',
1374
+ 'UNSAFE_componentWillMount',
1375
+ 'componentDidMount',
1376
+ 'componentWillReceiveProps',
1377
+ 'UNSAFE_componentWillReceiveProps',
1378
+ 'shouldComponentUpdate',
1379
+ 'componentWillUpdate',
1380
+ 'UNSAFE_componentWillUpdate',
1381
+ 'getSnapshotBeforeUpdate',
1382
+ 'componentDidUpdate',
1383
+ 'componentDidCatch',
1384
+ 'componentWillUnmount',
1385
+ ],
1386
+ },
1387
+ order: [
1388
+ 'static-variables',
1389
+ 'static-methods',
1390
+ 'everything-else',
1391
+ 'instance-variables',
1392
+ 'instance-methods',
1393
+ 'lifecycle',
1394
+ 'render',
1395
+ ],
1396
+ },
1397
+ ],
1398
+ 'react/sort-default-props': warn,
1399
+ 'react/sort-prop-types': warn,
1400
+ 'react/state-in-constructor': off,
1401
+ 'react/static-property-placement': warn,
1402
+ 'react/style-prop-object': warn,
1403
+ 'react/void-dom-elements-no-children': warn,
1404
+ 'react-hooks/exhaustive-deps': warn,
1405
+ 'react-hooks/rules-of-hooks': error,
1406
+ 'react-refresh/only-export-components': [
1407
+ warn,
1408
+ { allowConstantExport: true },
1409
+ ],
1410
+ },
1539
1411
  },
1540
- settings: {
1541
- 'import/extensions': ['.js', '.ts'],
1542
- 'import/internal-regex': '^@',
1543
- jsdoc: {
1544
- mode: 'closure',
1412
+ {
1413
+ files: ['**/*.d.ts'],
1414
+ rules: {
1415
+ '@typescript-eslint/consistent-type-definitions': off,
1416
+ '@typescript-eslint/no-extraneous-class': off,
1417
+ '@typescript-eslint/no-use-before-define': off,
1418
+ 'import/no-default-export': off,
1419
+ 'jsdoc/require-jsdoc': off,
1420
+ 'max-classes-per-file': off,
1545
1421
  },
1546
- react: {
1547
- version: 'detect',
1422
+ },
1423
+ {
1424
+ files: ['**/*.config.js', '**/*.config.ts'],
1425
+ rules: {
1426
+ '@typescript-eslint/no-magic-numbers': off,
1427
+ 'no-magic-numbers': off,
1548
1428
  },
1549
1429
  },
1550
- });
1430
+ {
1431
+ files: ['**/*.js'],
1432
+ rules: {
1433
+ 'jsdoc/check-access': warn,
1434
+ 'jsdoc/check-alignment': warn,
1435
+ 'jsdoc/check-examples': off,
1436
+ 'jsdoc/check-indentation': [off, { excludeTags: ['example'] }],
1437
+ 'jsdoc/check-line-alignment': warn,
1438
+ 'jsdoc/check-param-names': warn,
1439
+ 'jsdoc/check-property-names': warn,
1440
+ 'jsdoc/check-syntax': warn,
1441
+ 'jsdoc/check-tag-names': warn,
1442
+ 'jsdoc/check-types': [warn, { noDefaults: true }],
1443
+ 'jsdoc/check-values': warn,
1444
+ 'jsdoc/empty-tags': warn,
1445
+ 'jsdoc/implements-on-classes': warn,
1446
+ 'jsdoc/match-description': warn,
1447
+ 'jsdoc/no-bad-blocks': warn,
1448
+ 'jsdoc/no-defaults': warn,
1449
+ 'jsdoc/no-types': off,
1450
+ // Disabled due to false positives when referring to a generic type from inside its function:
1451
+ 'jsdoc/no-undefined-types': [
1452
+ off,
1453
+ {
1454
+ definedTypes: [
1455
+ 'unknown',
1456
+ /**
1457
+ * @see typescript\lib\lib.es5.d.ts
1458
+ * @version 4.1.2
1459
+ */
1460
+ 'PropertyKey',
1461
+ 'PropertyDescriptor',
1462
+ 'PropertyDescriptorMap',
1463
+ 'ObjectConstructor',
1464
+ 'FunctionConstructor',
1465
+ 'ThisParameterType',
1466
+ 'OmitThisParameter',
1467
+ 'CallableFunction',
1468
+ 'NewableFunction',
1469
+ 'IArguments',
1470
+ 'StringConstructor',
1471
+ 'BooleanConstructor',
1472
+ 'NumberConstructor',
1473
+ 'TemplateStringsArray',
1474
+ 'ImportMeta',
1475
+ 'DateConstructor',
1476
+ 'RegExpMatchArray',
1477
+ 'RegExpExecArray',
1478
+ 'RegExpConstructor',
1479
+ 'ErrorConstructor',
1480
+ 'EvalErrorConstructor',
1481
+ 'RangeErrorConstructor',
1482
+ 'ReferenceErrorConstructor',
1483
+ 'SyntaxErrorConstructor',
1484
+ 'TypeErrorConstructor',
1485
+ 'URIErrorConstructor',
1486
+ 'ReadonlyArray',
1487
+ 'ConcatArray',
1488
+ 'ArrayConstructor',
1489
+ 'TypedPropertyDescriptor',
1490
+ 'ClassDecorator',
1491
+ 'PropertyDecorator',
1492
+ 'MethodDecorator',
1493
+ 'ParameterDecorator',
1494
+ 'PromiseConstructorLike',
1495
+ 'PromiseLike',
1496
+ 'ArrayLike',
1497
+ 'Partial',
1498
+ 'Required',
1499
+ 'Readonly',
1500
+ 'Pick',
1501
+ 'Exclude',
1502
+ 'Extract',
1503
+ 'Omit',
1504
+ 'NonNullable',
1505
+ 'Parameters',
1506
+ 'ConstructorParameters',
1507
+ 'ReturnType',
1508
+ 'InstanceType',
1509
+ 'ThisType',
1510
+ 'ArrayBufferTypes',
1511
+ 'ArrayBufferLike',
1512
+ 'ArrayBufferConstructor',
1513
+ 'ArrayBufferView',
1514
+ 'DataViewConstructor',
1515
+ 'Int8ArrayConstructor',
1516
+ 'Uint8ArrayConstructor',
1517
+ 'Uint8ClampedArrayConstructor',
1518
+ 'Int16ArrayConstructor',
1519
+ 'Uint16ArrayConstructor',
1520
+ 'Int32ArrayConstructor',
1521
+ 'Uint32ArrayConstructor',
1522
+ 'Float32ArrayConstructor',
1523
+ 'Float64ArrayConstructor',
1524
+ ],
1525
+ },
1526
+ ],
1527
+ 'jsdoc/require-description': [
1528
+ off,
1529
+ { contexts: ['any'], descriptionStyle: 'body' },
1530
+ ],
1531
+ 'jsdoc/require-description-complete-sentence': off,
1532
+ 'jsdoc/require-example': off,
1533
+ 'jsdoc/require-file-overview': off,
1534
+ 'jsdoc/require-hyphen-before-param-description': [warn, 'never'],
1535
+ 'jsdoc/require-jsdoc': [
1536
+ off,
1537
+ {
1538
+ exemptEmptyFunctions: true,
1539
+ publicOnly: false,
1540
+ require: {
1541
+ ArrowFunctionExpression: true,
1542
+ ClassDeclaration: false,
1543
+ ClassExpression: false,
1544
+ FunctionDeclaration: true,
1545
+ FunctionExpression: true,
1546
+ MethodDefinition: true,
1547
+ },
1548
+ },
1549
+ ],
1550
+ 'jsdoc/require-param': [
1551
+ warn,
1552
+ {
1553
+ checkConstructors: true,
1554
+ checkDestructured: true,
1555
+ checkDestructuredRoots: true,
1556
+ checkGetters: true,
1557
+ checkSetters: true,
1558
+ },
1559
+ ],
1560
+ 'jsdoc/require-param-description': off,
1561
+ 'jsdoc/require-param-name': warn,
1562
+ 'jsdoc/require-param-type': [warn, { contexts: ['any'] }],
1563
+ 'jsdoc/require-property': warn,
1564
+ 'jsdoc/require-property-description': off,
1565
+ 'jsdoc/require-property-name': warn,
1566
+ 'jsdoc/require-property-type': warn,
1567
+ 'jsdoc/require-returns': off,
1568
+ 'jsdoc/require-returns-check': warn,
1569
+ 'jsdoc/require-returns-description': off,
1570
+ 'jsdoc/require-returns-type': warn,
1571
+ 'jsdoc/valid-types': off,
1572
+ },
1573
+ },
1574
+ ];
1575
+
1576
+ export default config;