eslint-config-silverwind 94.4.0 → 96.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +398 -103
  2. package/dist/index.json +1060 -81
  3. package/package.json +9 -12
package/dist/index.js CHANGED
@@ -18,12 +18,8 @@ import react from "eslint-plugin-react";
18
18
  import reactHooks from "eslint-plugin-react-hooks";
19
19
  import reactRefresh from "eslint-plugin-react-refresh";
20
20
  import validateJsxNesting from "eslint-plugin-validate-jsx-nesting";
21
- import reactConfig from "eslint-config-silverwind-react";
22
- import typescriptConfig from "eslint-config-silverwind-typescript";
23
21
  import typescriptPlugin from "typescript-eslint";
24
22
  import typescriptParser from "@typescript-eslint/parser";
25
- import deprecation from "eslint-plugin-deprecation";
26
- import { fixupPluginRules } from "@eslint/compat";
27
23
  const browserGlobals = ["addEventListener", "blur", "close", "closed", "confirm", "defaultStatus", "defaultstatus", "error", "event", "external", "find", "focus", "frameElement", "frames", "history", "innerHeight", "innerWidth", "isFinite", "isNaN", "length", "locationbar", "menubar", "moveBy", "moveTo", "name", "onblur", "onerror", "onfocus", "onload", "onresize", "onunload", "open", "opener", "opera", "outerHeight", "outerWidth", "pageXOffset", "pageYOffset", "parent", "print", "removeEventListener", "resizeBy", "resizeTo", "screen", "screenLeft", "screenTop", "screenX", "screenY", "scroll", "scrollbars", "scrollBy", "scrollTo", "scrollX", "scrollY", "status", "statusbar", "stop", "toolbar", "top"];
28
24
  const nodeGlobals = ["__dirname", "__filename"];
29
25
  const restrictedWorkerGlobals = [...browserGlobals, ...nodeGlobals, "window"];
@@ -34,10 +30,14 @@ const eslintrc = {
34
30
  "plugins": [
35
31
  "@eslint-community/eslint-plugin-eslint-comments",
36
32
  "@stylistic/eslint-plugin-js",
33
+ "@typescript-eslint/eslint-plugin",
37
34
  "eslint-plugin-array-func",
38
35
  "eslint-plugin-github",
39
36
  "eslint-plugin-import",
40
37
  "eslint-plugin-no-use-extend-native",
38
+ "eslint-plugin-react",
39
+ "eslint-plugin-react-hooks",
40
+ "eslint-plugin-react-refresh",
41
41
  "eslint-plugin-regexp",
42
42
  "eslint-plugin-sonarjs",
43
43
  "eslint-plugin-unicorn",
@@ -47,7 +47,9 @@ const eslintrc = {
47
47
  "parser": "@typescript-eslint/parser",
48
48
  "parserOptions": {
49
49
  "sourceType": "module",
50
- "ecmaVersion": "latest"
50
+ "ecmaVersion": "latest",
51
+ "project": true,
52
+ "extraFileExtensions": [".html", ".vue", ".md", ".mdx"]
51
53
  },
52
54
  "env": {
53
55
  "browser": true,
@@ -58,7 +60,18 @@ const eslintrc = {
58
60
  "import/extensions": [".js", ".jsx", ".ts", ".tsx"],
59
61
  "import/resolver": {
60
62
  "typescript": true
61
- }
63
+ },
64
+ "import/parsers": {
65
+ "@typescript-eslint/parser": [".js", ".jsx", ".ts", ".tsx"]
66
+ },
67
+ "react": {
68
+ // used by eslint-plugin-react
69
+ version: "detect"
70
+ },
71
+ "linkComponents": [
72
+ // used by eslint-plugin-react
73
+ { name: "Link", linkAttribute: "href" }
74
+ ]
62
75
  },
63
76
  "ignorePatterns": [
64
77
  "**/.git/**",
@@ -72,6 +85,28 @@ const eslintrc = {
72
85
  "!.storybook"
73
86
  ],
74
87
  "overrides": [
88
+ {
89
+ files: ["**/*.ts"],
90
+ rules: {
91
+ "no-array-constructor": [0],
92
+ "no-implied-eval": [0],
93
+ "no-redeclare": [0],
94
+ // for overloads
95
+ "no-unused-vars": [0],
96
+ "no-use-before-define": [0],
97
+ "require-await": [0]
98
+ }
99
+ },
100
+ {
101
+ files: ["**/*.d.ts"],
102
+ rules: {
103
+ "@typescript-eslint/consistent-type-definitions": [0],
104
+ "@typescript-eslint/consistent-type-imports": [0],
105
+ "@typescript-eslint/no-unused-vars": [0],
106
+ "no-undef": [0],
107
+ "no-var": [0]
108
+ }
109
+ },
75
110
  {
76
111
  "files": ["**/*.worker.*"],
77
112
  "env": {
@@ -166,7 +201,109 @@ const eslintrc = {
166
201
  {
167
202
  "files": ["**/*.stories.*"],
168
203
  "plugins": ["eslint-plugin-storybook"],
169
- "extends": "plugin:storybook/recommended"
204
+ "rules": {
205
+ "storybook/await-interactions": [2],
206
+ "storybook/context-in-play-function": [2],
207
+ "storybook/default-exports": [2],
208
+ "storybook/hierarchy-separator": [2],
209
+ "storybook/no-redundant-story-name": [2],
210
+ "storybook/prefer-pascal-case": [2],
211
+ "storybook/story-exports": [2],
212
+ "storybook/use-storybook-expect": [2],
213
+ "storybook/use-storybook-testing-library": [2]
214
+ }
215
+ },
216
+ {
217
+ "files": ["**/*.jsx", "**/*.tsx"],
218
+ "plugins": [
219
+ "@stylistic/eslint-plugin-jsx",
220
+ "eslint-plugin-jsx-a11y",
221
+ "eslint-plugin-validate-jsx-nesting"
222
+ ],
223
+ rules: {
224
+ "@stylistic/jsx/jsx-child-element-spacing": [0],
225
+ "@stylistic/jsx/jsx-closing-bracket-location": [0],
226
+ "@stylistic/jsx/jsx-closing-tag-location": [2],
227
+ "@stylistic/jsx/jsx-curly-brace-presence": [0],
228
+ "@stylistic/jsx/jsx-curly-newline": [2, "consistent"],
229
+ "@stylistic/jsx/jsx-curly-spacing": [2, { when: "never" }],
230
+ "@stylistic/jsx/jsx-equals-spacing": [2, "never"],
231
+ "@stylistic/jsx/jsx-first-prop-new-line": [0],
232
+ "@stylistic/jsx/jsx-function-call-newline": [0],
233
+ "@stylistic/jsx/jsx-indent-props": [2, 2],
234
+ "@stylistic/jsx/jsx-max-props-per-line": [0],
235
+ "@stylistic/jsx/jsx-newline": [0],
236
+ "@stylistic/jsx/jsx-one-expression-per-line": [0],
237
+ "@stylistic/jsx/jsx-pascal-case": [2, { allowAllCaps: true }],
238
+ "@stylistic/jsx/jsx-props-no-multi-spaces": [2],
239
+ "@stylistic/jsx/jsx-self-closing-comp": [2],
240
+ "@stylistic/jsx/jsx-sort-props": [0],
241
+ "@stylistic/jsx/jsx-tag-spacing": [2, { beforeSelfClosing: "never", beforeClosing: "never" }],
242
+ "@stylistic/jsx/jsx-wrap-multilines": [2],
243
+ "jsx-a11y/accessible-emoji": [0],
244
+ "jsx-a11y/alt-text": [0],
245
+ "jsx-a11y/anchor-ambiguous-text": [2],
246
+ "jsx-a11y/anchor-has-content": [2],
247
+ "jsx-a11y/anchor-is-valid": [2],
248
+ "jsx-a11y/aria-activedescendant-has-tabindex": [2],
249
+ "jsx-a11y/aria-props": [2],
250
+ "jsx-a11y/aria-proptypes": [2],
251
+ "jsx-a11y/aria-role": [2],
252
+ "jsx-a11y/aria-unsupported-elements": [2],
253
+ "jsx-a11y/autocomplete-valid": [2],
254
+ "jsx-a11y/click-events-have-key-events": [0],
255
+ "jsx-a11y/control-has-associated-label": [0],
256
+ "jsx-a11y/heading-has-content": [2],
257
+ "jsx-a11y/html-has-lang": [0],
258
+ "jsx-a11y/iframe-has-title": [0],
259
+ "jsx-a11y/img-redundant-alt": [0],
260
+ "jsx-a11y/interactive-supports-focus": [0],
261
+ "jsx-a11y/label-has-associated-control": [2],
262
+ "jsx-a11y/label-has-for": [0],
263
+ "jsx-a11y/lang": [2],
264
+ "jsx-a11y/media-has-caption": [0],
265
+ "jsx-a11y/mouse-events-have-key-events": [0],
266
+ "jsx-a11y/no-access-key": [2],
267
+ "jsx-a11y/no-aria-hidden-on-focusable": [0],
268
+ "jsx-a11y/no-autofocus": [0],
269
+ "jsx-a11y/no-distracting-elements": [2],
270
+ "jsx-a11y/no-interactive-element-to-noninteractive-role": [0],
271
+ "jsx-a11y/no-noninteractive-element-interactions": [0],
272
+ "jsx-a11y/no-noninteractive-element-to-interactive-role": [0],
273
+ "jsx-a11y/no-noninteractive-tabindex": [0],
274
+ "jsx-a11y/no-onchange": [0],
275
+ "jsx-a11y/no-redundant-roles": [2],
276
+ "jsx-a11y/no-static-element-interactions": [0],
277
+ "jsx-a11y/prefer-tag-over-role": [0],
278
+ "jsx-a11y/role-has-required-aria-props": [2],
279
+ "jsx-a11y/role-supports-aria-props": [2],
280
+ "jsx-a11y/scope": [0],
281
+ "jsx-a11y/tabindex-no-positive": [2],
282
+ "react/jsx-boolean-value": [2, "always"],
283
+ "react/jsx-filename-extension": [0],
284
+ "react/jsx-fragments": [2, "element"],
285
+ "react/jsx-handler-names": [0],
286
+ "react/jsx-key": [2, { warnOnDuplicates: true }],
287
+ "react/jsx-max-depth": [0],
288
+ "react/jsx-no-bind": [0],
289
+ "react/jsx-no-comment-textnodes": [2],
290
+ "react/jsx-no-constructed-context-values": [2],
291
+ "react/jsx-no-duplicate-props": [2],
292
+ "react/jsx-no-leaked-render": [0],
293
+ "react/jsx-no-literals": [0],
294
+ "react/jsx-no-script-url": [2, { includeFromSettings: true }],
295
+ "react/jsx-no-target-blank": [0],
296
+ "react/jsx-no-undef": [2],
297
+ "react/jsx-no-useless-fragment": [2, { allowExpressions: false }],
298
+ "react/jsx-pascal-case": [0],
299
+ // covered by @stylistic/jsx/jsx-pascal-case
300
+ "react/jsx-props-no-spread-multi": [2],
301
+ "react/jsx-props-no-spreading": [0],
302
+ "react/jsx-space-before-closing": [0],
303
+ "react/jsx-uses-react": [0],
304
+ "react/jsx-uses-vars": [2],
305
+ "validate-jsx-nesting/no-invalid-jsx-nesting": [2]
306
+ }
170
307
  }
171
308
  ],
172
309
  "rules": {
@@ -247,14 +384,133 @@ const eslintrc = {
247
384
  "@stylistic/js/wrap-iife": [2, "inside"],
248
385
  "@stylistic/js/wrap-regex": [0],
249
386
  "@stylistic/js/yield-star-spacing": [2, "after"],
387
+ "@typescript-eslint/adjacent-overload-signatures": [0],
388
+ "@typescript-eslint/array-type": [0],
389
+ "@typescript-eslint/await-thenable": [2],
390
+ "@typescript-eslint/ban-ts-comment": [2, { "ts-expect-error": false, "ts-ignore": true, "ts-nocheck": false, "ts-check": false }],
391
+ "@typescript-eslint/ban-tslint-comment": [0],
392
+ "@typescript-eslint/class-literal-property-style": [0],
393
+ "@typescript-eslint/class-methods-use-this": [0],
394
+ "@typescript-eslint/consistent-generic-constructors": [0],
395
+ "@typescript-eslint/consistent-indexed-object-style": [0],
396
+ "@typescript-eslint/consistent-return": [0],
397
+ "@typescript-eslint/consistent-type-assertions": [2, { assertionStyle: "as", objectLiteralTypeAssertions: "allow" }],
398
+ "@typescript-eslint/consistent-type-definitions": [2, "type"],
399
+ "@typescript-eslint/consistent-type-exports": [2, { fixMixedExportsWithInlineTypeSpecifier: false }],
400
+ "@typescript-eslint/consistent-type-imports": [2, { prefer: "type-imports", fixStyle: "separate-type-imports", disallowTypeAnnotations: true }],
401
+ "@typescript-eslint/default-param-last": [0],
402
+ "@typescript-eslint/dot-notation": [0],
403
+ "@typescript-eslint/explicit-function-return-type": [0],
404
+ "@typescript-eslint/explicit-member-accessibility": [0],
405
+ "@typescript-eslint/explicit-module-boundary-types": [0],
406
+ "@typescript-eslint/init-declarations": [0],
407
+ "@typescript-eslint/max-params": [0],
408
+ "@typescript-eslint/member-ordering": [0],
409
+ "@typescript-eslint/method-signature-style": [0],
410
+ "@typescript-eslint/naming-convention": [0],
411
+ "@typescript-eslint/no-array-constructor": [2],
412
+ "@typescript-eslint/no-array-delete": [2],
413
+ "@typescript-eslint/no-base-to-string": [0],
414
+ "@typescript-eslint/no-confusing-non-null-assertion": [2],
415
+ "@typescript-eslint/no-confusing-void-expression": [0],
416
+ "@typescript-eslint/no-deprecated": [2],
417
+ "@typescript-eslint/no-dupe-class-members": [0],
418
+ "@typescript-eslint/no-duplicate-enum-values": [2],
419
+ "@typescript-eslint/no-duplicate-type-constituents": [2, { ignoreUnions: true }],
420
+ "@typescript-eslint/no-dynamic-delete": [0],
421
+ "@typescript-eslint/no-empty-function": [0],
422
+ "@typescript-eslint/no-empty-interface": [0],
423
+ "@typescript-eslint/no-empty-object-type": [2],
424
+ "@typescript-eslint/no-explicit-any": [0],
425
+ "@typescript-eslint/no-extra-non-null-assertion": [2],
426
+ "@typescript-eslint/no-extraneous-class": [0],
427
+ "@typescript-eslint/no-floating-promises": [0],
428
+ "@typescript-eslint/no-for-in-array": [2],
429
+ "@typescript-eslint/no-implied-eval": [2],
430
+ "@typescript-eslint/no-import-type-side-effects": [0],
431
+ // dupe with consistent-type-imports
432
+ "@typescript-eslint/no-inferrable-types": [0],
433
+ "@typescript-eslint/no-invalid-this": [0],
434
+ "@typescript-eslint/no-invalid-void-type": [0],
435
+ "@typescript-eslint/no-loop-func": [0],
436
+ "@typescript-eslint/no-magic-numbers": [0],
437
+ "@typescript-eslint/no-meaningless-void-operator": [0],
438
+ "@typescript-eslint/no-misused-new": [2],
439
+ "@typescript-eslint/no-misused-promises": [2, { checksVoidReturn: { attributes: false, arguments: false } }],
440
+ "@typescript-eslint/no-mixed-enums": [0],
441
+ "@typescript-eslint/no-namespace": [2],
442
+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing": [0],
443
+ "@typescript-eslint/no-non-null-asserted-optional-chain": [2],
444
+ "@typescript-eslint/no-non-null-assertion": [0],
445
+ "@typescript-eslint/no-redeclare": [0],
446
+ "@typescript-eslint/no-redundant-type-constituents": [2],
447
+ "@typescript-eslint/no-require-imports": [2],
448
+ "@typescript-eslint/no-restricted-imports": [0],
449
+ "@typescript-eslint/no-restricted-types": [0],
450
+ "@typescript-eslint/no-shadow": [0],
451
+ "@typescript-eslint/no-this-alias": [2],
452
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": [0],
453
+ "@typescript-eslint/no-unnecessary-condition": [0],
454
+ "@typescript-eslint/no-unnecessary-parameter-property-assignment": [2],
455
+ "@typescript-eslint/no-unnecessary-qualifier": [0],
456
+ "@typescript-eslint/no-unnecessary-template-expression": [0],
457
+ "@typescript-eslint/no-unnecessary-type-arguments": [2],
458
+ "@typescript-eslint/no-unnecessary-type-assertion": [2],
459
+ // previously had typesToIgnore: [HTMLElement, NodeListOf<HTMLElement>]
460
+ "@typescript-eslint/no-unnecessary-type-constraint": [2],
461
+ "@typescript-eslint/no-unsafe-argument": [0],
462
+ "@typescript-eslint/no-unsafe-assignment": [0],
463
+ "@typescript-eslint/no-unsafe-call": [0],
464
+ "@typescript-eslint/no-unsafe-declaration-merging": [2],
465
+ "@typescript-eslint/no-unsafe-enum-comparison": [2],
466
+ "@typescript-eslint/no-unsafe-function-type": [0],
467
+ "@typescript-eslint/no-unsafe-member-access": [0],
468
+ "@typescript-eslint/no-unsafe-return": [0],
469
+ "@typescript-eslint/no-unsafe-unary-minus": [2],
470
+ "@typescript-eslint/no-unused-expressions": [0],
471
+ "@typescript-eslint/no-unused-vars": [2, { vars: "all", args: "all", caughtErrors: "all", ignoreRestSiblings: false, argsIgnorePattern: "^_", varsIgnorePattern: "^_[^_]*$", caughtErrorsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_" }],
472
+ "@typescript-eslint/no-use-before-define": [2, { "functions": false, "classes": true, "variables": true, "allowNamedExports": true, "typedefs": false, "enums": false, "ignoreTypeReferences": true }],
473
+ "@typescript-eslint/no-useless-constructor": [0],
474
+ "@typescript-eslint/no-useless-empty-export": [0],
475
+ "@typescript-eslint/no-wrapper-object-types": [2],
476
+ "@typescript-eslint/non-nullable-type-assertion-style": [0],
477
+ "@typescript-eslint/only-throw-error": [2],
478
+ "@typescript-eslint/parameter-properties": [0],
479
+ "@typescript-eslint/prefer-as-const": [2],
480
+ "@typescript-eslint/prefer-destructuring": [0],
481
+ "@typescript-eslint/prefer-enum-initializers": [0],
482
+ "@typescript-eslint/prefer-find": [2],
483
+ "@typescript-eslint/prefer-for-of": [2],
484
+ "@typescript-eslint/prefer-function-type": [2],
485
+ "@typescript-eslint/prefer-includes": [2],
486
+ "@typescript-eslint/prefer-literal-enum-member": [0],
487
+ "@typescript-eslint/prefer-namespace-keyword": [0],
488
+ "@typescript-eslint/prefer-nullish-coalescing": [0],
489
+ "@typescript-eslint/prefer-optional-chain": [2, { requireNullish: true }],
490
+ "@typescript-eslint/prefer-promise-reject-errors": [0],
491
+ "@typescript-eslint/prefer-readonly": [0],
492
+ "@typescript-eslint/prefer-readonly-parameter-types": [0],
493
+ "@typescript-eslint/prefer-reduce-type-parameter": [0],
494
+ "@typescript-eslint/prefer-regexp-exec": [0],
495
+ "@typescript-eslint/prefer-return-this-type": [0],
496
+ "@typescript-eslint/prefer-string-starts-ends-with": [2, { allowSingleElementEquality: "always" }],
497
+ "@typescript-eslint/promise-function-async": [0],
498
+ "@typescript-eslint/require-array-sort-compare": [0],
499
+ "@typescript-eslint/require-await": [2],
500
+ "@typescript-eslint/restrict-plus-operands": [2],
501
+ "@typescript-eslint/restrict-template-expressions": [0],
502
+ "@typescript-eslint/return-await": [0],
503
+ "@typescript-eslint/strict-boolean-expressions": [0],
504
+ "@typescript-eslint/switch-exhaustiveness-check": [0],
505
+ "@typescript-eslint/triple-slash-reference": [2],
506
+ "@typescript-eslint/typedef": [0],
507
+ "@typescript-eslint/unbound-method": [0],
508
+ // too many false-positives
509
+ "@typescript-eslint/unified-signatures": [2],
250
510
  "accessor-pairs": [2],
251
511
  "array-callback-return": [2, { "checkForEach": true }],
252
- "array-func/avoid-reverse": [2],
253
- "array-func/from-map": [2],
254
- "array-func/no-unnecessary-this-arg": [2],
255
- "array-func/prefer-array-from": [2],
256
- "array-func/prefer-flat-map": [0],
257
512
  "array-func/prefer-flat": [0],
513
+ "array-func/prefer-flat-map": [0],
258
514
  "arrow-body-style": [0],
259
515
  "block-scoped-var": [2],
260
516
  "camelcase": [0],
@@ -265,8 +521,8 @@ const eslintrc = {
265
521
  "consistent-this": [0],
266
522
  "constructor-super": [2],
267
523
  "curly": [0],
268
- "default-case-last": [2],
269
524
  "default-case": [0],
525
+ "default-case-last": [2],
270
526
  "default-param-last": [0],
271
527
  "dot-notation": [0],
272
528
  "eqeqeq": [2],
@@ -293,13 +549,17 @@ const eslintrc = {
293
549
  "github/no-implicit-buggy-globals": [2],
294
550
  "github/no-inner-html": [0],
295
551
  "github/no-innerText": [2],
296
- "github/no-then": [2],
552
+ "github/no-then": [0],
297
553
  "github/no-useless-passive": [2],
298
- "github/prefer-observers": [2],
554
+ "github/prefer-observers": [0],
299
555
  "github/require-passive-events": [2],
300
556
  "github/unescaped-html-literal": [0],
301
557
  "grouped-accessor-pairs": [2],
302
558
  "guard-for-in": [0],
559
+ "id-blacklist": [0],
560
+ "id-denylist": [0],
561
+ "id-length": [0],
562
+ "id-match": [0],
303
563
  "import/consistent-type-specifier-style": [0],
304
564
  "import/default": [2],
305
565
  "import/dynamic-import-chunkname": [0],
@@ -326,8 +586,8 @@ const eslintrc = {
326
586
  "import/no-import-module-exports": [0],
327
587
  "import/no-internal-modules": [0],
328
588
  "import/no-mutable-exports": [0],
329
- "import/no-named-as-default-member": [0],
330
589
  "import/no-named-as-default": [0],
590
+ "import/no-named-as-default-member": [0],
331
591
  "import/no-named-default": [0],
332
592
  "import/no-named-export": [0],
333
593
  "import/no-namespace": [0],
@@ -344,17 +604,13 @@ const eslintrc = {
344
604
  "import/order": [0],
345
605
  "import/prefer-default-export": [0],
346
606
  "import/unambiguous": [0],
347
- "id-blacklist": [0],
348
- "id-denylist": [0],
349
- "id-length": [0],
350
- "id-match": [0],
351
607
  "init-declarations": [0],
352
608
  "line-comment-position": [0],
353
609
  "logical-assignment-operators": [0],
354
610
  "max-classes-per-file": [0],
355
611
  "max-depth": [0],
356
- "max-lines-per-function": [0],
357
612
  "max-lines": [0],
613
+ "max-lines-per-function": [0],
358
614
  "max-nested-callbacks": [0],
359
615
  "max-params": [0],
360
616
  "max-statements": [0],
@@ -388,11 +644,11 @@ const eslintrc = {
388
644
  "no-duplicate-case": [2],
389
645
  "no-duplicate-imports": [0],
390
646
  "no-else-return": [0],
647
+ "no-empty": [2, { "allowEmptyCatch": true }],
391
648
  "no-empty-character-class": [2],
392
649
  "no-empty-function": [0],
393
650
  "no-empty-pattern": [2],
394
651
  "no-empty-static-block": [2],
395
- "no-empty": [2, { "allowEmptyCatch": true }],
396
652
  "no-eq-null": [2],
397
653
  "no-eval": [2],
398
654
  "no-ex-assign": [2],
@@ -425,16 +681,16 @@ const eslintrc = {
425
681
  "no-multi-str": [2],
426
682
  "no-negated-condition": [0],
427
683
  "no-nested-ternary": [0],
684
+ "no-new": [0],
428
685
  "no-new-func": [2],
429
686
  "no-new-native-nonconstructor": [2],
430
687
  "no-new-symbol": [2],
431
688
  "no-new-wrappers": [2],
432
- "no-new": [0],
433
689
  "no-nonoctal-decimal-escape": [2],
434
690
  "no-obj-calls": [2],
435
691
  "no-object-constructor": [2],
436
- "no-octal-escape": [2],
437
692
  "no-octal": [2],
693
+ "no-octal-escape": [2],
438
694
  "no-param-reassign": [0],
439
695
  "no-plusplus": [0],
440
696
  "no-promise-executor-return": [0],
@@ -454,34 +710,30 @@ const eslintrc = {
454
710
  "no-self-compare": [2],
455
711
  "no-sequences": [2],
456
712
  "no-setter-return": [2],
457
- "no-shadow-restricted-names": [2],
458
713
  "no-shadow": [0],
714
+ "no-shadow-restricted-names": [2],
459
715
  "no-sparse-arrays": [2],
460
716
  "no-template-curly-in-string": [2],
461
717
  "no-ternary": [0],
462
718
  "no-this-before-super": [2],
463
719
  "no-throw-literal": [2],
464
- "no-undef-init": [2],
465
720
  "no-undef": [2, { "typeof": true }],
721
+ "no-undef-init": [2],
466
722
  "no-undefined": [0],
467
723
  "no-underscore-dangle": [0],
468
724
  "no-unexpected-multiline": [2],
469
725
  "no-unmodified-loop-condition": [2],
470
726
  "no-unneeded-ternary": [0],
471
- "no-unreachable-loop": [2],
472
727
  "no-unreachable": [2],
728
+ "no-unreachable-loop": [2],
473
729
  "no-unsafe-finally": [2],
474
730
  "no-unsafe-negation": [2],
475
731
  "no-unsafe-optional-chaining": [2],
476
732
  "no-unused-expressions": [2],
477
733
  "no-unused-labels": [2],
478
734
  "no-unused-private-class-members": [2],
479
- "no-unused-vars": [
480
- 2,
481
- { "vars": "all", "args": "all", "caughtErrors": "all", "ignoreRestSiblings": false, "argsIgnorePattern": "^_", "varsIgnorePattern": "^_[^_]*$", "caughtErrorsIgnorePattern": "^_", "destructuredArrayIgnorePattern": "^_" }
482
- ],
735
+ "no-unused-vars": [2, { "vars": "all", "args": "all", "caughtErrors": "all", "ignoreRestSiblings": false, "argsIgnorePattern": "^_", "varsIgnorePattern": "^_[^_]*$", "caughtErrorsIgnorePattern": "^_", "destructuredArrayIgnorePattern": "^_" }],
483
736
  "no-use-before-define": [2, { "functions": false, "classes": true, "variables": true, "allowNamedExports": true }],
484
- "no-use-extend-native/no-use-extend-native": [2],
485
737
  "no-useless-backreference": [2],
486
738
  "no-useless-call": [2],
487
739
  "no-useless-catch": [2],
@@ -512,6 +764,69 @@ const eslintrc = {
512
764
  "prefer-spread": [2],
513
765
  "prefer-template": [2],
514
766
  "radix": [2, "as-needed"],
767
+ "rules-of-hooks/exhaustive-deps": [2],
768
+ "rules-of-hooks/rules-of-hooks": [2],
769
+ "react-refresh/only-export-components": [2, { allowConstantExport: true }],
770
+ "react/boolean-prop-naming": [0],
771
+ "react/button-has-type": [0],
772
+ "react/default-props-match-prop-types": [0],
773
+ "react/destructuring-assignment": [0],
774
+ "react/display-name": [2],
775
+ "react/forbid-component-props": [0],
776
+ "react/forbid-dom-props": [0],
777
+ "react/forbid-elements": [0],
778
+ "react/forbid-foreign-prop-types": [0],
779
+ "react/forbid-prop-types": [0],
780
+ "react/function-component-definition": [0],
781
+ "react/hook-use-state": [2, { allowDestructuredState: true }],
782
+ "react/iframe-missing-sandbox": [0],
783
+ "react/no-access-state-in-setstate": [0],
784
+ "react/no-adjacent-inline-elements": [0],
785
+ "react/no-array-index-key": [0],
786
+ "react/no-arrow-function-lifecycle": [2],
787
+ "react/no-children-prop": [2],
788
+ "react/no-danger": [0],
789
+ "react/no-danger-with-children": [0],
790
+ "react/no-deprecated": [2],
791
+ "react/no-did-mount-set-state": [0],
792
+ "react/no-did-update-set-state": [0],
793
+ "react/no-direct-mutation-state": [0],
794
+ // slow
795
+ "react/no-find-dom-node": [2],
796
+ "react/no-invalid-html-attribute": [2],
797
+ "react/no-is-mounted": [0],
798
+ "react/no-multi-comp": [0],
799
+ "react/no-namespace": [2],
800
+ "react/no-object-type-as-default-prop": [2],
801
+ "react/no-redundant-should-component-update": [2],
802
+ "react/no-render-return-value": [0],
803
+ "react/no-set-state": [0],
804
+ "react/no-string-refs": [2],
805
+ "react/no-this-in-sfc": [2],
806
+ "react/no-typos": [2],
807
+ "react/no-unescaped-entities": [2],
808
+ "react/no-unknown-property": [2, { ignore: ["css"], requireDataLowercase: true }],
809
+ "react/no-unsafe": [0],
810
+ "react/no-unused-class-component-methods": [2],
811
+ "react/no-unused-prop-types": [0],
812
+ "react/no-unused-state": [2],
813
+ "react/no-will-update-set-state": [0],
814
+ "react/prefer-es6-class": [0],
815
+ "react/prefer-exact-props": [0],
816
+ "react/prefer-read-only-props": [0],
817
+ "react/prefer-stateless-function": [0],
818
+ "react/prop-types": [0],
819
+ "react/react-in-jsx-scope": [0],
820
+ "react/require-default-props": [0],
821
+ "react/require-optimization": [0],
822
+ "react/require-render-return": [2],
823
+ "react/sort-comp": [0],
824
+ "react/sort-default-props": [0],
825
+ "react/sort-prop-types": [0],
826
+ "react/state-in-constructor": [0],
827
+ "react/static-property-placement": [0],
828
+ "react/style-prop-object": [2],
829
+ "react/void-dom-elements-no-children": [2],
515
830
  "regexp/confusing-quantifier": [2],
516
831
  "regexp/control-character-escape": [2],
517
832
  "regexp/hexadecimal-escape": [0],
@@ -765,7 +1080,14 @@ const eslintrc = {
765
1080
  "yoda": [2, "never"]
766
1081
  }
767
1082
  };
768
- const baseRules = eslintrc.rules;
1083
+ const baseRules = {
1084
+ ...eslintrc.rules,
1085
+ "no-use-extend-native/no-use-extend-native": [2],
1086
+ "array-func/avoid-reverse": [2],
1087
+ "array-func/from-map": [2],
1088
+ "array-func/no-unnecessary-this-arg": [2],
1089
+ "array-func/prefer-array-from": [2]
1090
+ };
769
1091
  const overrides = eslintrc.overrides;
770
1092
  const jsExts = [".js", ".jsx", ".mjs", ".cjs"];
771
1093
  const tsExts = [".ts", ".tsx", ".mts", ".cts"];
@@ -801,18 +1123,14 @@ const common = {
801
1123
  }
802
1124
  },
803
1125
  linterOptions: {
804
- reportUnusedDisableDirectives: "warn"
1126
+ reportUnusedDisableDirectives: 2
805
1127
  },
806
1128
  plugins: {
807
1129
  "@eslint-community/eslint-comments": comments,
808
1130
  "@stylistic/js": stylisticJs,
809
- "@stylistic/jsx": stylisticJsx,
810
1131
  "@typescript-eslint": typescriptPlugin.plugin,
811
1132
  "array-func": arrayFunc,
812
- deprecation: fixupPluginRules(deprecation),
813
- // https://github.com/gund/eslint-plugin-deprecation/issues/78
814
1133
  "i": importPlugin,
815
- "jsx-a11y": jsxA11y,
816
1134
  "no-use-extend-native": noUseExtendNative,
817
1135
  react,
818
1136
  "react-hooks": reactHooks,
@@ -820,8 +1138,7 @@ const common = {
820
1138
  regexp,
821
1139
  sonarjs,
822
1140
  unicorn,
823
- github,
824
- "validate-jsx-nesting": validateJsxNesting
1141
+ github
825
1142
  },
826
1143
  settings: {
827
1144
  "import/extensions": [...jsExts, tsExts],
@@ -831,84 +1148,62 @@ const common = {
831
1148
  "react": { version: "detect" }
832
1149
  }
833
1150
  };
1151
+ const [
1152
+ tsOverride,
1153
+ dtsOverride,
1154
+ workerOverride,
1155
+ testOverride,
1156
+ configOverride,
1157
+ playwrightOverride,
1158
+ _storybookOverride,
1159
+ jsxOverride
1160
+ ] = overrides;
834
1161
  const index = [
835
- // run ts rules on js as well, may need to disable it for certain incompatible plugins like
836
- // deprecation - https://github.com/gund/eslint-plugin-deprecation/issues/78#issuecomment-2153190684
837
1162
  deepMerge(common, {
838
- files: [...jsExts, tsExts].map((ext) => `**/*${ext}`),
839
- rules: {
840
- ...baseRules,
841
- ...reactConfig.rules,
842
- ...typescriptConfig.rules
843
- }
1163
+ files: [...jsExts, ...tsExts].map((ext) => `**/*${ext}`),
1164
+ rules: baseRules
844
1165
  }, { arrayExtend: true }),
845
1166
  deepMerge(common, {
846
- files: [
847
- "**/*.d.ts"
848
- ],
849
- rules: {
850
- "@typescript-eslint/consistent-type-definitions": [0],
851
- "@typescript-eslint/consistent-type-imports": [0]
852
- }
1167
+ files: tsOverride.files,
1168
+ rules: tsOverride.rules
853
1169
  }, { arrayExtend: true }),
854
1170
  deepMerge(common, {
855
- files: [
856
- "**/*.worker.*"
857
- ],
858
- languageOptions: { globals: { ...globals.worker } },
859
- rules: {
860
- ...baseRules,
861
- "no-restricted-globals": [2, ...restrictedWorkerGlobals]
862
- }
1171
+ files: dtsOverride.files,
1172
+ rules: dtsOverride.rules
863
1173
  }, { arrayExtend: true }),
864
1174
  deepMerge(common, {
865
- "files": [
866
- "**/*.test.*",
867
- "vitest.setup.*",
868
- "integration/**"
869
- ],
870
- plugins: {
871
- vitest
872
- },
873
- languageOptions: {
874
- globals: {
875
- ...vitestGlobalsPlugin.environments.env.globals
876
- }
877
- },
878
- rules: {
879
- ...baseRules,
880
- ...overrides[1].rules
881
- }
1175
+ files: workerOverride.files,
1176
+ languageOptions: { globals: { ...globals.worker } },
1177
+ rules: workerOverride.rules
882
1178
  }, { arrayExtend: true }),
883
1179
  deepMerge(common, {
884
- files: [
885
- "**/*.config.*",
886
- "**/*.stories.*",
887
- "vitest.global.*"
888
- ],
889
- rules: {
890
- ...baseRules
891
- }
1180
+ plugins: { vitest },
1181
+ files: testOverride.files,
1182
+ languageOptions: { globals: { ...vitestGlobalsPlugin.environments.env.globals } },
1183
+ rules: testOverride.files
892
1184
  }, { arrayExtend: true }),
893
1185
  deepMerge(common, {
894
- files: [
895
- "**/.storybook/**",
896
- "**/*.config.test.*"
897
- ],
898
- rules: {
899
- ...baseRules
900
- }
1186
+ files: configOverride.files,
1187
+ rules: configOverride.rules
901
1188
  }, { arrayExtend: true }),
902
1189
  deepMerge(common, {
903
1190
  ...playwright.configs["flat/recommended"],
904
- files: [
905
- "tests/**"
906
- ],
907
- rules: {
908
- ...baseRules,
909
- ...playwright.configs["flat/recommended"].rules,
910
- "playwright/expect-expect": [0]
911
- }
1191
+ files: playwrightOverride.files,
1192
+ rules: playwrightOverride.rules
1193
+ }, { arrayExtend: true }),
1194
+ // deepMerge(common, {
1195
+ // plugins: {storybook},
1196
+ // files: storybookOverride.files,
1197
+ // rules: storybookOverride.rules,
1198
+ // } satisfies Linter.Config, {arrayExtend: true}),
1199
+ deepMerge(common, {
1200
+ plugins: {
1201
+ "@stylistic/jsx": stylisticJsx,
1202
+ "jsx-a11y": jsxA11y,
1203
+ "validate-jsx-nesting": validateJsxNesting
1204
+ },
1205
+ files: jsxOverride.files,
1206
+ rules: jsxOverride.rules
912
1207
  }, { arrayExtend: true })
913
1208
  ];
914
1209
  export {