eslint-config-setup 0.3.3 → 0.5.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.
@@ -27,13 +27,99 @@ import unicornPlugin from "eslint-plugin-unicorn"
27
27
  import unusedImportsPlugin from "eslint-plugin-unused-imports"
28
28
  import vitestPlugin from "@vitest/eslint-plugin"
29
29
 
30
+ // React compat plugin — maps @eslint-react rule families into the `react/` namespace
31
+ // and aliases rules to legacy eslint-plugin-react names for OxLint compatibility.
32
+ const reactCompatPlugin = (() => {
33
+ const core = eslintReactPlugin.rules
34
+ const select = (prefix) => Object.fromEntries(
35
+ Object.entries(core)
36
+ .filter(([name]) => name.startsWith(prefix))
37
+ .map(([name, rule]) => [name.slice(prefix.length), rule]),
38
+ )
39
+ const dom = select("dom-")
40
+ const jsx = select("jsx-")
41
+ const naming = select("naming-convention-")
42
+ const rsc = select("rsc-")
43
+ const webApi = select("web-api-")
44
+
45
+ // Legacy aliases: legacy name → [source, original name]
46
+ const aliases = {
47
+ "jsx-key": [core, "no-missing-key"],
48
+ "jsx-key-before-spread": [jsx, "no-key-after-spread"],
49
+ "jsx-no-constructed-context-values": [core, "no-unstable-context-value"],
50
+ "jsx-no-leaked-render": [core, "no-leaked-conditional-rendering"],
51
+ "jsx-no-useless-fragment": [jsx, "no-useless-fragment"],
52
+ "no-object-type-as-default-prop": [core, "no-unstable-default-props"],
53
+ "no-unstable-nested-components": [core, "no-nested-component-definitions"],
54
+ "display-name": [core, "no-missing-component-display-name"],
55
+ "forward-ref-uses-ref": [core, "no-forward-ref"],
56
+ "no-did-mount-set-state": [core, "no-set-state-in-component-did-mount"],
57
+ "no-did-update-set-state": [core, "no-set-state-in-component-did-update"],
58
+ "no-will-update-set-state": [core, "no-set-state-in-component-will-update"],
59
+ "hook-use-state": [core, "use-state"],
60
+ "no-danger": [dom, "no-dangerously-set-innerhtml"],
61
+ "no-danger-with-children": [dom, "no-dangerously-set-innerhtml-with-children"],
62
+ "no-find-dom-node": [dom, "no-find-dom-node"],
63
+ "no-namespace": [jsx, "no-namespace"],
64
+ "no-render-return-value": [dom, "no-render-return-value"],
65
+ "jsx-no-script-url": [dom, "no-script-url"],
66
+ "jsx-no-target-blank": [dom, "no-unsafe-target-blank"],
67
+ "no-unknown-property": [dom, "no-unknown-property"],
68
+ "void-dom-elements-no-children": [dom, "no-void-elements-with-children"],
69
+ "button-has-type": [dom, "no-missing-button-type"],
70
+ "iframe-missing-sandbox": [dom, "no-missing-iframe-sandbox"],
71
+ "style-prop-object": [dom, "no-string-style-prop"],
72
+ }
73
+
74
+ // Identical-name aliases (core rules where legacy name = @eslint-react name)
75
+ const identicalCore = [
76
+ "no-access-state-in-setstate", "no-array-index-key",
77
+ "no-direct-mutation-state",
78
+ "no-unused-class-component-members", "no-unused-state",
79
+ ]
80
+ for (const n of identicalCore) aliases[n] = [core, n]
81
+ aliases["no-children-prop"] = [jsx, "no-children-prop"]
82
+ aliases["jsx-no-comment-textnodes"] = [jsx, "no-comment-textnodes"]
83
+
84
+ // Build aliased originals set
85
+ const aliasedCore = new Set()
86
+ for (const [src, name] of Object.values(aliases)) {
87
+ if (src === core) aliasedCore.add(name)
88
+ else if (src === dom) aliasedCore.add("dom-" + name)
89
+ else if (src === jsx) aliasedCore.add("jsx-" + name)
90
+ else if (src === naming) aliasedCore.add("naming-convention-" + name)
91
+ else if (src === rsc) aliasedCore.add("rsc-" + name)
92
+ else if (src === webApi) aliasedCore.add("web-api-" + name)
93
+ }
94
+ const rules = {}
95
+
96
+ // Core rules (skip aliased originals)
97
+ for (const [n, r] of Object.entries(core)) { if (!aliasedCore.has(n)) rules[n] = r }
98
+
99
+ // Sub-plugin rules (skip aliased + prefer-namespace-import collision)
100
+ const subs = [[dom, new Set(['prefer-namespace-import'])], [jsx], [webApi], [naming], [rsc]]
101
+ for (const [src, skip] of subs) {
102
+ for (const [n, r] of Object.entries(src)) {
103
+ if (skip && skip.has(n)) continue
104
+ if (Object.values(aliases).some(([s, o]) => s === src && o === n)) continue
105
+ rules[n] = r
106
+ }
107
+ }
108
+
109
+ // Add legacy aliases
110
+ for (const [legacy, [src, orig]] of Object.entries(aliases)) rules[legacy] = src[orig]
111
+
112
+ return { meta: { name: "react-compat", version: "1.0.0" }, rules }
113
+ })()
114
+
30
115
  export default [
31
116
  // TypeScript parser setup
32
117
  ...tseslint.configs.strictTypeChecked.slice(0, 2),
33
118
 
34
- // Base rules — all effective rules for *.ts files
119
+ // Base rules — all effective rules for TS plus shared JS/TS rules
35
120
  {
36
121
  name: "eslint-config-setup/base",
122
+ ignores: ["**/*.{md,mdx}"],
37
123
  plugins: {
38
124
  "@cspell": cspellPlugin,
39
125
  "@stylistic": stylisticPlugin,
@@ -44,11 +130,9 @@ export default [
44
130
  "jsx-a11y": jsxA11yPlugin,
45
131
  "node": nodePlugin,
46
132
  "perfectionist": perfectionistPlugin,
47
- "react": eslintReactPlugin,
48
- "react-dom": eslintReactPlugin.configs.dom.plugins["@eslint-react/dom"],
133
+ "react": reactCompatPlugin,
49
134
  "react-hooks": reactHooksPlugin,
50
135
  "react-refresh": reactRefreshPlugin,
51
- "react-web-api": eslintReactPlugin.configs["web-api"].plugins["@eslint-react/web-api"],
52
136
  "react-you-might-not-need-an-effect": reactEffectPlugin,
53
137
  "regexp": regexpPlugin,
54
138
  "security": securityPlugin,
@@ -96,7 +180,7 @@ export default [
96
180
  "@typescript-eslint/ban-ts-comment": [
97
181
  "error",
98
182
  {
99
- "minimumDescriptionLength": 10
183
+ "ts-expect-error": "allow-with-description"
100
184
  }
101
185
  ],
102
186
  "@typescript-eslint/ban-tslint-comment": "error",
@@ -104,7 +188,10 @@ export default [
104
188
  "@typescript-eslint/consistent-generic-constructors": "error",
105
189
  "@typescript-eslint/consistent-indexed-object-style": "error",
106
190
  "@typescript-eslint/consistent-type-assertions": "error",
107
- "@typescript-eslint/consistent-type-definitions": "error",
191
+ "@typescript-eslint/consistent-type-definitions": [
192
+ "error",
193
+ "type"
194
+ ],
108
195
  "@typescript-eslint/consistent-type-exports": [
109
196
  "error",
110
197
  {
@@ -114,10 +201,14 @@ export default [
114
201
  "@typescript-eslint/consistent-type-imports": [
115
202
  "error",
116
203
  {
117
- "fixStyle": "inline-type-imports"
204
+ "fixStyle": "separate-type-imports"
118
205
  }
119
206
  ],
120
207
  "@typescript-eslint/dot-notation": "error",
208
+ "@typescript-eslint/method-signature-style": [
209
+ "error",
210
+ "property"
211
+ ],
121
212
  "@typescript-eslint/no-array-constructor": "error",
122
213
  "@typescript-eslint/no-array-delete": "error",
123
214
  "@typescript-eslint/no-base-to-string": "error",
@@ -129,10 +220,21 @@ export default [
129
220
  "@typescript-eslint/no-dynamic-delete": "error",
130
221
  "@typescript-eslint/no-empty-function": "error",
131
222
  "@typescript-eslint/no-empty-object-type": "error",
132
- "@typescript-eslint/no-explicit-any": "error",
223
+ "@typescript-eslint/no-explicit-any": [
224
+ "warn",
225
+ {
226
+ "fixToUnknown": true
227
+ }
228
+ ],
133
229
  "@typescript-eslint/no-extra-non-null-assertion": "error",
134
230
  "@typescript-eslint/no-extraneous-class": "error",
135
- "@typescript-eslint/no-floating-promises": "error",
231
+ "@typescript-eslint/no-floating-promises": [
232
+ "error",
233
+ {
234
+ "checkThenables": true,
235
+ "ignoreIIFE": true
236
+ }
237
+ ],
136
238
  "@typescript-eslint/no-for-in-array": "error",
137
239
  "@typescript-eslint/no-implied-eval": "error",
138
240
  "@typescript-eslint/no-import-type-side-effects": "error",
@@ -140,7 +242,12 @@ export default [
140
242
  "@typescript-eslint/no-invalid-void-type": "error",
141
243
  "@typescript-eslint/no-meaningless-void-operator": "error",
142
244
  "@typescript-eslint/no-misused-new": "error",
143
- "@typescript-eslint/no-misused-promises": "error",
245
+ "@typescript-eslint/no-misused-promises": [
246
+ "error",
247
+ {
248
+ "checksVoidReturn": false
249
+ }
250
+ ],
144
251
  "@typescript-eslint/no-misused-spread": "error",
145
252
  "@typescript-eslint/no-mixed-enums": "error",
146
253
  "@typescript-eslint/no-namespace": "error",
@@ -183,6 +290,7 @@ export default [
183
290
  "@typescript-eslint/no-unsafe-function-type": "error",
184
291
  "@typescript-eslint/no-unsafe-member-access": "error",
185
292
  "@typescript-eslint/no-unsafe-return": "error",
293
+ "@typescript-eslint/no-unsafe-type-assertion": "error",
186
294
  "@typescript-eslint/no-unsafe-unary-minus": "error",
187
295
  "@typescript-eslint/no-unused-expressions": "error",
188
296
  "@typescript-eslint/no-unused-vars": [
@@ -213,11 +321,19 @@ export default [
213
321
  "@typescript-eslint/prefer-nullish-coalescing": "error",
214
322
  "@typescript-eslint/prefer-optional-chain": "error",
215
323
  "@typescript-eslint/prefer-promise-reject-errors": "error",
324
+ "@typescript-eslint/prefer-readonly": "warn",
216
325
  "@typescript-eslint/prefer-reduce-type-parameter": "error",
217
326
  "@typescript-eslint/prefer-regexp-exec": "error",
218
327
  "@typescript-eslint/prefer-return-this-type": "error",
219
328
  "@typescript-eslint/prefer-string-starts-ends-with": "error",
329
+ "@typescript-eslint/promise-function-async": "error",
220
330
  "@typescript-eslint/related-getter-setter-pairs": "error",
331
+ "@typescript-eslint/require-array-sort-compare": [
332
+ "error",
333
+ {
334
+ "ignoreStringArrays": true
335
+ }
336
+ ],
221
337
  "@typescript-eslint/require-await": "error",
222
338
  "@typescript-eslint/restrict-plus-operands": [
223
339
  "error",
@@ -247,6 +363,13 @@ export default [
247
363
  }
248
364
  ],
249
365
  "@typescript-eslint/strict-void-return": "error",
366
+ "@typescript-eslint/switch-exhaustiveness-check": [
367
+ "error",
368
+ {
369
+ "allowDefaultCaseForExhaustiveSwitch": false,
370
+ "requireDefaultForNonUnion": true
371
+ }
372
+ ],
250
373
  "@typescript-eslint/triple-slash-reference": "error",
251
374
  "@typescript-eslint/unbound-method": "error",
252
375
  "@typescript-eslint/unified-signatures": "error",
@@ -289,17 +412,35 @@ export default [
289
412
  "maxDepth": 3
290
413
  }
291
414
  ],
292
- "import/no-duplicates": [
415
+ "import/no-duplicates": "error",
416
+ "import/no-empty-named-blocks": "error",
417
+ "import/no-extraneous-dependencies": [
293
418
  "error",
294
419
  {
295
- "prefer-inline": true
420
+ "includeTypes": true
296
421
  }
297
422
  ],
298
- "import/no-empty-named-blocks": "error",
299
423
  "import/no-mutable-exports": "error",
300
424
  "import/no-named-as-default": "error",
301
425
  "import/no-named-as-default-member": "error",
426
+ "import/no-named-default": "error",
302
427
  "import/no-self-import": "error",
428
+ "import/no-unassigned-import": [
429
+ "error",
430
+ {
431
+ "allow": [
432
+ "@babel/polyfill",
433
+ "**/register",
434
+ "**/register.*",
435
+ "**/register/**",
436
+ "**/register/**.*",
437
+ "**/*.css",
438
+ "**/*.scss",
439
+ "**/*.sass",
440
+ "**/*.less"
441
+ ]
442
+ }
443
+ ],
303
444
  "import/no-useless-path-segments": "error",
304
445
  "jsdoc/check-access": "error",
305
446
  "jsdoc/check-alignment": "error",
@@ -416,6 +557,7 @@ export default [
416
557
  "no-extra-boolean-cast": "error",
417
558
  "no-fallthrough": "error",
418
559
  "no-global-assign": "error",
560
+ "no-implicit-globals": "error",
419
561
  "no-irregular-whitespace": "error",
420
562
  "no-iterator": "error",
421
563
  "no-labels": "error",
@@ -434,10 +576,19 @@ export default [
434
576
  "no-proto": "error",
435
577
  "no-prototype-builtins": "error",
436
578
  "no-regex-spaces": "error",
579
+ "no-return-assign": [
580
+ "error",
581
+ "always"
582
+ ],
437
583
  "no-script-url": "error",
438
584
  "no-self-assign": "error",
439
585
  "no-self-compare": "error",
440
- "no-sequences": "error",
586
+ "no-sequences": [
587
+ "error",
588
+ {
589
+ "allowInParentheses": false
590
+ }
591
+ ],
441
592
  "no-shadow-restricted-names": "error",
442
593
  "no-sparse-arrays": "error",
443
594
  "no-template-curly-in-string": "error",
@@ -451,12 +602,18 @@ export default [
451
602
  "no-useless-assignment": "error",
452
603
  "no-useless-call": "error",
453
604
  "no-useless-catch": "error",
454
- "no-useless-computed-key": "error",
605
+ "no-useless-computed-key": [
606
+ "error",
607
+ {
608
+ "enforceForClassMembers": true
609
+ }
610
+ ],
455
611
  "no-useless-concat": "error",
456
612
  "no-useless-escape": "error",
457
613
  "no-useless-rename": "error",
458
614
  "no-useless-return": "error",
459
615
  "no-var": "error",
616
+ "node/handle-callback-err": "error",
460
617
  "node/hashbang": "error",
461
618
  "node/no-deprecated-api": "error",
462
619
  "node/no-exports-assign": "error",
@@ -484,6 +641,15 @@ export default [
484
641
  ],
485
642
  "node/prefer-promises/dns": "error",
486
643
  "node/prefer-promises/fs": "error",
644
+ "node/process-exit-as-throw": "error",
645
+ "object-shorthand": [
646
+ "error",
647
+ "always",
648
+ {
649
+ "avoidExplicitReturnArrows": true,
650
+ "avoidQuotes": true
651
+ }
652
+ ],
487
653
  "perfectionist/sort-exports": "error",
488
654
  "perfectionist/sort-imports": [
489
655
  "error",
@@ -496,60 +662,117 @@ export default [
496
662
  "perfectionist/sort-named-imports": "error",
497
663
  "perfectionist/sort-union-types": "error",
498
664
  "prefer-const": "error",
665
+ "prefer-numeric-literals": "error",
499
666
  "prefer-object-has-own": "error",
500
667
  "prefer-object-spread": "error",
501
668
  "prefer-regex-literals": "error",
502
669
  "prefer-rest-params": "error",
503
670
  "prefer-spread": "error",
504
- "prefer-template": "error",
671
+ "prefer-template": "warn",
505
672
  "preserve-caught-error": "error",
506
673
  "radix": "error",
507
- "react-dom/no-dangerously-set-innerhtml": "warn",
508
- "react-dom/no-dangerously-set-innerhtml-with-children": "error",
509
- "react-dom/no-missing-button-type": "error",
510
- "react-dom/no-missing-iframe-sandbox": "error",
511
- "react-dom/no-string-style-prop": "error",
512
- "react-dom/no-unknown-property": "error",
513
- "react-dom/no-unsafe-target-blank": "error",
514
- "react-dom/no-void-elements-with-children": "error",
515
- "react-hooks/exhaustive-deps": "error",
674
+ "react-hooks/config": "error",
675
+ "react-hooks/error-boundaries": "error",
676
+ "react-hooks/exhaustive-deps": "warn",
677
+ "react-hooks/gating": "error",
678
+ "react-hooks/globals": "error",
679
+ "react-hooks/immutability": "error",
680
+ "react-hooks/incompatible-library": "warn",
681
+ "react-hooks/preserve-manual-memoization": "error",
682
+ "react-hooks/purity": "error",
683
+ "react-hooks/refs": "error",
516
684
  "react-hooks/rules-of-hooks": "error",
685
+ "react-hooks/set-state-in-effect": "error",
686
+ "react-hooks/set-state-in-render": "error",
687
+ "react-hooks/static-components": "error",
688
+ "react-hooks/unsupported-syntax": "warn",
689
+ "react-hooks/use-memo": "error",
690
+ "react-hooks/void-use-memo": "error",
517
691
  "react-refresh/only-export-components": [
518
692
  "warn",
519
693
  {
520
694
  "allowConstantExport": true
521
695
  }
522
696
  ],
523
- "react-web-api/no-leaked-event-listener": "error",
524
- "react-web-api/no-leaked-interval": "error",
525
- "react-web-api/no-leaked-resize-observer": "error",
526
- "react-web-api/no-leaked-timeout": "error",
527
697
  "react-you-might-not-need-an-effect/no-adjust-state-on-prop-change": "warn",
528
698
  "react-you-might-not-need-an-effect/no-chain-state-updates": "error",
529
699
  "react-you-might-not-need-an-effect/no-derived-state": "error",
530
- "react-you-might-not-need-an-effect/no-empty-effect": "error",
531
700
  "react-you-might-not-need-an-effect/no-event-handler": "error",
701
+ "react-you-might-not-need-an-effect/no-external-store-subscription": "error",
532
702
  "react-you-might-not-need-an-effect/no-initialize-state": "error",
533
703
  "react-you-might-not-need-an-effect/no-pass-data-to-parent": "error",
534
704
  "react-you-might-not-need-an-effect/no-pass-live-state-to-parent": "error",
535
705
  "react-you-might-not-need-an-effect/no-reset-all-state-on-prop-change": "error",
536
- "react/jsx-no-comment-textnodes": "error",
537
- "react/jsx-shorthand-boolean": "error",
706
+ "react/button-has-type": "warn",
707
+ "react/context-name": "warn",
708
+ "react/forward-ref-uses-ref": "warn",
709
+ "react/function-definition": "error",
710
+ "react/hook-use-state": "warn",
711
+ "react/id-name": "warn",
712
+ "react/iframe-missing-sandbox": "warn",
713
+ "react/jsx-key": "error",
714
+ "react/jsx-key-before-spread": "error",
715
+ "react/jsx-no-children-prop-with-children": "error",
716
+ "react/jsx-no-comment-textnodes": "warn",
717
+ "react/jsx-no-constructed-context-values": "warn",
718
+ "react/jsx-no-leaked-dollar": "warn",
719
+ "react/jsx-no-leaked-render": "error",
720
+ "react/jsx-no-leaked-semicolon": "warn",
721
+ "react/jsx-no-script-url": "warn",
722
+ "react/jsx-no-target-blank": "warn",
723
+ "react/jsx-no-useless-fragment": "warn",
538
724
  "react/no-access-state-in-setstate": "error",
539
- "react/no-array-index-key": "error",
725
+ "react/no-array-index-key": "warn",
726
+ "react/no-children-count": "warn",
727
+ "react/no-children-for-each": "warn",
728
+ "react/no-children-map": "warn",
729
+ "react/no-children-only": "warn",
540
730
  "react/no-children-prop": "error",
541
- "react/no-context-provider": "error",
731
+ "react/no-children-to-array": "warn",
732
+ "react/no-class-component": "error",
733
+ "react/no-clone-element": "warn",
734
+ "react/no-component-will-mount": "error",
735
+ "react/no-component-will-receive-props": "error",
736
+ "react/no-component-will-update": "error",
737
+ "react/no-context-provider": "warn",
738
+ "react/no-create-ref": "error",
739
+ "react/no-danger": "warn",
740
+ "react/no-danger-with-children": "error",
741
+ "react/no-did-mount-set-state": "warn",
742
+ "react/no-did-update-set-state": "warn",
542
743
  "react/no-direct-mutation-state": "error",
543
744
  "react/no-duplicate-key": "error",
544
- "react/no-forward-ref": "error",
545
- "react/no-leaked-conditional-rendering": "error",
546
- "react/no-missing-key": "error",
547
- "react/no-nested-component-definitions": "error",
548
- "react/no-unstable-context-value": "error",
549
- "react/no-unstable-default-props": "error",
550
- "react/no-unused-state": "error",
551
- "react/no-use-context": "error",
552
- "react/no-useless-fragment": "error",
745
+ "react/no-find-dom-node": "error",
746
+ "react/no-flush-sync": "error",
747
+ "react/no-hydrate": "error",
748
+ "react/no-implicit-key": "error",
749
+ "react/no-leaked-event-listener": "warn",
750
+ "react/no-leaked-fetch": "warn",
751
+ "react/no-leaked-intersection-observer": "warn",
752
+ "react/no-leaked-interval": "warn",
753
+ "react/no-leaked-resize-observer": "warn",
754
+ "react/no-leaked-timeout": "warn",
755
+ "react/no-misused-capture-owner-stack": "error",
756
+ "react/no-namespace": "error",
757
+ "react/no-nested-lazy-component-declarations": "error",
758
+ "react/no-object-type-as-default-prop": "warn",
759
+ "react/no-render": "error",
760
+ "react/no-render-return-value": "error",
761
+ "react/no-unknown-property": "error",
762
+ "react/no-unnecessary-use-prefix": "warn",
763
+ "react/no-unsafe-component-will-mount": "warn",
764
+ "react/no-unsafe-component-will-receive-props": "warn",
765
+ "react/no-unsafe-component-will-update": "warn",
766
+ "react/no-unsafe-iframe-sandbox": "warn",
767
+ "react/no-unstable-nested-components": "error",
768
+ "react/no-unused-class-component-members": "warn",
769
+ "react/no-unused-props": "warn",
770
+ "react/no-use-context": "warn",
771
+ "react/no-use-form-state": "error",
772
+ "react/no-will-update-set-state": "warn",
773
+ "react/ref-name": "warn",
774
+ "react/style-prop-object": "error",
775
+ "react/void-dom-elements-no-children": "error",
553
776
  "regexp/confusing-quantifier": "warn",
554
777
  "regexp/control-character-escape": "error",
555
778
  "regexp/match-any": "error",
@@ -664,15 +887,31 @@ export default [
664
887
  "unicorn/consistent-date-clone": "error",
665
888
  "unicorn/consistent-empty-array-spread": "error",
666
889
  "unicorn/consistent-existence-index-check": "error",
890
+ "unicorn/consistent-function-scoping": "warn",
667
891
  "unicorn/error-message": "error",
892
+ "unicorn/filename-case": [
893
+ "error",
894
+ {
895
+ "cases": {
896
+ "camelCase": true,
897
+ "pascalCase": true,
898
+ "kebabCase": true
899
+ },
900
+ "ignore": [
901
+ "__tests__"
902
+ ]
903
+ }
904
+ ],
668
905
  "unicorn/new-for-builtins": "error",
669
906
  "unicorn/no-abusive-eslint-disable": "error",
670
907
  "unicorn/no-accessor-recursion": "error",
671
908
  "unicorn/no-anonymous-default-export": "error",
672
909
  "unicorn/no-array-callback-reference": "error",
673
910
  "unicorn/no-array-method-this-argument": "error",
911
+ "unicorn/no-array-reduce": "warn",
674
912
  "unicorn/no-await-expression-member": "error",
675
913
  "unicorn/no-await-in-promise-methods": "error",
914
+ "unicorn/no-for-loop": "warn",
676
915
  "unicorn/no-instanceof-builtins": "error",
677
916
  "unicorn/no-invalid-fetch-options": "error",
678
917
  "unicorn/no-invalid-remove-event-listener": "error",
@@ -690,7 +929,12 @@ export default [
690
929
  "unicorn/no-useless-length-check": "error",
691
930
  "unicorn/no-useless-promise-resolve-reject": "error",
692
931
  "unicorn/no-useless-spread": "error",
693
- "unicorn/no-useless-undefined": "error",
932
+ "unicorn/no-useless-undefined": [
933
+ "warn",
934
+ {
935
+ "checkArguments": false
936
+ }
937
+ ],
694
938
  "unicorn/no-zero-fractions": "error",
695
939
  "unicorn/numeric-separators-style": "error",
696
940
  "unicorn/prefer-array-find": "error",
@@ -700,10 +944,11 @@ export default [
700
944
  "unicorn/prefer-array-some": "error",
701
945
  "unicorn/prefer-at": "error",
702
946
  "unicorn/prefer-date-now": "error",
947
+ "unicorn/prefer-dom-node-dataset": "error",
703
948
  "unicorn/prefer-export-from": [
704
949
  "error",
705
950
  {
706
- "ignoreUsedVariables": true
951
+ "checkUsedVariables": false
707
952
  }
708
953
  ],
709
954
  "unicorn/prefer-global-this": "error",
@@ -731,8 +976,19 @@ export default [
731
976
  "unicorn/text-encoding-identifier-case": "error",
732
977
  "unicorn/throw-new-error": "error",
733
978
  "unused-imports/no-unused-imports": "error",
734
- "use-isnan": "error",
735
- "valid-typeof": "error",
979
+ "use-isnan": [
980
+ "error",
981
+ {
982
+ "enforceForIndexOf": true,
983
+ "enforceForSwitchCase": true
984
+ }
985
+ ],
986
+ "valid-typeof": [
987
+ "error",
988
+ {
989
+ "requireStringLiterals": true
990
+ }
991
+ ],
736
992
  "yoda": "error"
737
993
  },
738
994
  },
@@ -742,46 +998,91 @@ export default [
742
998
  name: "eslint-config-setup/js-compat",
743
999
  files: ["**/*.{js,mjs,cjs}"],
744
1000
  rules: {
1001
+ "@typescript-eslint/adjacent-overload-signatures": "off",
1002
+ "@typescript-eslint/array-type": "off",
745
1003
  "@typescript-eslint/await-thenable": "off",
1004
+ "@typescript-eslint/ban-ts-comment": "off",
1005
+ "@typescript-eslint/ban-tslint-comment": "off",
1006
+ "@typescript-eslint/class-literal-property-style": "off",
1007
+ "@typescript-eslint/consistent-generic-constructors": "off",
1008
+ "@typescript-eslint/consistent-indexed-object-style": "off",
746
1009
  "@typescript-eslint/consistent-return": "off",
1010
+ "@typescript-eslint/consistent-type-assertions": "off",
1011
+ "@typescript-eslint/consistent-type-definitions": "off",
747
1012
  "@typescript-eslint/consistent-type-exports": "off",
1013
+ "@typescript-eslint/consistent-type-imports": "off",
748
1014
  "@typescript-eslint/dot-notation": "off",
1015
+ "@typescript-eslint/method-signature-style": "off",
749
1016
  "@typescript-eslint/naming-convention": "off",
1017
+ "@typescript-eslint/no-array-constructor": "off",
750
1018
  "@typescript-eslint/no-array-delete": "off",
751
1019
  "@typescript-eslint/no-base-to-string": "off",
1020
+ "@typescript-eslint/no-confusing-non-null-assertion": "off",
752
1021
  "@typescript-eslint/no-confusing-void-expression": "off",
753
1022
  "@typescript-eslint/no-deprecated": "off",
1023
+ "@typescript-eslint/no-duplicate-enum-values": "off",
754
1024
  "@typescript-eslint/no-duplicate-type-constituents": "off",
1025
+ "@typescript-eslint/no-dynamic-delete": "off",
1026
+ "@typescript-eslint/no-empty-function": "off",
1027
+ "@typescript-eslint/no-empty-object-type": "off",
1028
+ "@typescript-eslint/no-explicit-any": "off",
1029
+ "@typescript-eslint/no-extra-non-null-assertion": "off",
1030
+ "@typescript-eslint/no-extraneous-class": "off",
755
1031
  "@typescript-eslint/no-floating-promises": "off",
756
1032
  "@typescript-eslint/no-for-in-array": "off",
757
1033
  "@typescript-eslint/no-implied-eval": "off",
1034
+ "@typescript-eslint/no-import-type-side-effects": "off",
1035
+ "@typescript-eslint/no-inferrable-types": "off",
1036
+ "@typescript-eslint/no-invalid-void-type": "off",
758
1037
  "@typescript-eslint/no-meaningless-void-operator": "off",
1038
+ "@typescript-eslint/no-misused-new": "off",
759
1039
  "@typescript-eslint/no-misused-promises": "off",
760
1040
  "@typescript-eslint/no-misused-spread": "off",
761
1041
  "@typescript-eslint/no-mixed-enums": "off",
1042
+ "@typescript-eslint/no-namespace": "off",
1043
+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "off",
1044
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "off",
1045
+ "@typescript-eslint/no-non-null-assertion": "off",
762
1046
  "@typescript-eslint/no-redundant-type-constituents": "off",
1047
+ "@typescript-eslint/no-require-imports": "off",
1048
+ "@typescript-eslint/no-shadow": "off",
1049
+ "@typescript-eslint/no-this-alias": "off",
763
1050
  "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
764
1051
  "@typescript-eslint/no-unnecessary-condition": "off",
1052
+ "@typescript-eslint/no-unnecessary-parameter-property-assignment": "off",
765
1053
  "@typescript-eslint/no-unnecessary-qualifier": "off",
766
1054
  "@typescript-eslint/no-unnecessary-template-expression": "off",
767
1055
  "@typescript-eslint/no-unnecessary-type-arguments": "off",
768
1056
  "@typescript-eslint/no-unnecessary-type-assertion": "off",
1057
+ "@typescript-eslint/no-unnecessary-type-constraint": "off",
769
1058
  "@typescript-eslint/no-unnecessary-type-conversion": "off",
770
1059
  "@typescript-eslint/no-unnecessary-type-parameters": "off",
771
1060
  "@typescript-eslint/no-unsafe-argument": "off",
772
1061
  "@typescript-eslint/no-unsafe-assignment": "off",
773
1062
  "@typescript-eslint/no-unsafe-call": "off",
1063
+ "@typescript-eslint/no-unsafe-declaration-merging": "off",
774
1064
  "@typescript-eslint/no-unsafe-enum-comparison": "off",
1065
+ "@typescript-eslint/no-unsafe-function-type": "off",
775
1066
  "@typescript-eslint/no-unsafe-member-access": "off",
776
1067
  "@typescript-eslint/no-unsafe-return": "off",
777
1068
  "@typescript-eslint/no-unsafe-type-assertion": "off",
778
1069
  "@typescript-eslint/no-unsafe-unary-minus": "off",
1070
+ "@typescript-eslint/no-unused-expressions": "off",
1071
+ "@typescript-eslint/no-unused-vars": "off",
1072
+ "@typescript-eslint/no-useless-constructor": "off",
779
1073
  "@typescript-eslint/no-useless-default-assignment": "off",
1074
+ "@typescript-eslint/no-useless-empty-export": "off",
1075
+ "@typescript-eslint/no-wrapper-object-types": "off",
780
1076
  "@typescript-eslint/non-nullable-type-assertion-style": "off",
781
1077
  "@typescript-eslint/only-throw-error": "off",
1078
+ "@typescript-eslint/prefer-as-const": "off",
782
1079
  "@typescript-eslint/prefer-destructuring": "off",
783
1080
  "@typescript-eslint/prefer-find": "off",
1081
+ "@typescript-eslint/prefer-for-of": "off",
1082
+ "@typescript-eslint/prefer-function-type": "off",
784
1083
  "@typescript-eslint/prefer-includes": "off",
1084
+ "@typescript-eslint/prefer-literal-enum-member": "off",
1085
+ "@typescript-eslint/prefer-namespace-keyword": "off",
785
1086
  "@typescript-eslint/prefer-nullish-coalescing": "off",
786
1087
  "@typescript-eslint/prefer-optional-chain": "off",
787
1088
  "@typescript-eslint/prefer-promise-reject-errors": "off",
@@ -801,33 +1102,47 @@ export default [
801
1102
  "@typescript-eslint/strict-boolean-expressions": "off",
802
1103
  "@typescript-eslint/strict-void-return": "off",
803
1104
  "@typescript-eslint/switch-exhaustiveness-check": "off",
1105
+ "@typescript-eslint/triple-slash-reference": "off",
804
1106
  "@typescript-eslint/unbound-method": "off",
1107
+ "@typescript-eslint/unified-signatures": "off",
805
1108
  "@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
806
1109
  "constructor-super": "error",
1110
+ "dot-notation": "off",
807
1111
  "getter-return": "error",
1112
+ "no-array-constructor": "off",
808
1113
  "no-class-assign": "error",
809
1114
  "no-const-assign": "error",
810
1115
  "no-dupe-args": "error",
811
1116
  "no-dupe-class-members": "error",
812
1117
  "no-dupe-keys": "error",
1118
+ "no-empty-function": "off",
813
1119
  "no-func-assign": "error",
1120
+ "no-implied-eval": "off",
814
1121
  "no-import-assign": "error",
815
1122
  "no-new-native-nonconstructor": "error",
816
1123
  "no-new-symbol": "off",
817
1124
  "no-obj-calls": "error",
818
1125
  "no-redeclare": "error",
1126
+ "no-return-await": "off",
819
1127
  "no-setter-return": "error",
1128
+ "no-shadow": "off",
820
1129
  "no-this-before-super": "error",
1130
+ "no-throw-literal": "off",
821
1131
  "no-undef": "error",
822
1132
  "no-unreachable": "error",
823
1133
  "no-unsafe-negation": "error",
1134
+ "no-unused-expressions": "off",
1135
+ "no-unused-vars": "error",
1136
+ "no-useless-constructor": "off",
824
1137
  "no-with": "error",
825
1138
  "prefer-const": [
826
1139
  "error",
827
1140
  {
828
1141
  "destructuring": "all"
829
1142
  }
830
- ]
1143
+ ],
1144
+ "prefer-promise-reject-errors": "off",
1145
+ "require-await": "off"
831
1146
  },
832
1147
  },
833
1148
 
@@ -1065,7 +1380,131 @@ export default [
1065
1380
  // Markdown/MDX code block linting
1066
1381
  {
1067
1382
  ...mdxPlugin.flatCodeBlocks,
1383
+ languageOptions: {
1384
+ ...mdxPlugin.flatCodeBlocks.languageOptions,
1385
+ parserOptions: {
1386
+ ...mdxPlugin.flatCodeBlocks.languageOptions?.parserOptions,
1387
+ projectService: false,
1388
+ },
1389
+ },
1068
1390
  rules: {
1391
+ ...{
1392
+ "@typescript-eslint/adjacent-overload-signatures": "off",
1393
+ "@typescript-eslint/array-type": "off",
1394
+ "@typescript-eslint/await-thenable": "off",
1395
+ "@typescript-eslint/ban-ts-comment": "off",
1396
+ "@typescript-eslint/ban-tslint-comment": "off",
1397
+ "@typescript-eslint/class-literal-property-style": "off",
1398
+ "@typescript-eslint/consistent-generic-constructors": "off",
1399
+ "@typescript-eslint/consistent-indexed-object-style": "off",
1400
+ "@typescript-eslint/consistent-type-assertions": "off",
1401
+ "@typescript-eslint/consistent-type-definitions": "off",
1402
+ "@typescript-eslint/consistent-type-exports": "off",
1403
+ "@typescript-eslint/consistent-type-imports": "off",
1404
+ "@typescript-eslint/dot-notation": "off",
1405
+ "@typescript-eslint/method-signature-style": "off",
1406
+ "@typescript-eslint/no-array-constructor": "off",
1407
+ "@typescript-eslint/no-array-delete": "off",
1408
+ "@typescript-eslint/no-base-to-string": "off",
1409
+ "@typescript-eslint/no-confusing-non-null-assertion": "off",
1410
+ "@typescript-eslint/no-confusing-void-expression": "off",
1411
+ "@typescript-eslint/no-deprecated": "off",
1412
+ "@typescript-eslint/no-duplicate-enum-values": "off",
1413
+ "@typescript-eslint/no-duplicate-type-constituents": "off",
1414
+ "@typescript-eslint/no-dynamic-delete": "off",
1415
+ "@typescript-eslint/no-empty-function": "off",
1416
+ "@typescript-eslint/no-empty-object-type": "off",
1417
+ "@typescript-eslint/no-explicit-any": "off",
1418
+ "@typescript-eslint/no-extra-non-null-assertion": "off",
1419
+ "@typescript-eslint/no-extraneous-class": "off",
1420
+ "@typescript-eslint/no-floating-promises": "off",
1421
+ "@typescript-eslint/no-for-in-array": "off",
1422
+ "@typescript-eslint/no-implied-eval": "off",
1423
+ "@typescript-eslint/no-import-type-side-effects": "off",
1424
+ "@typescript-eslint/no-inferrable-types": "off",
1425
+ "@typescript-eslint/no-invalid-void-type": "off",
1426
+ "@typescript-eslint/no-meaningless-void-operator": "off",
1427
+ "@typescript-eslint/no-misused-new": "off",
1428
+ "@typescript-eslint/no-misused-spread": "off",
1429
+ "@typescript-eslint/no-mixed-enums": "off",
1430
+ "@typescript-eslint/no-namespace": "off",
1431
+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "off",
1432
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "off",
1433
+ "@typescript-eslint/no-non-null-assertion": "off",
1434
+ "@typescript-eslint/no-redundant-type-constituents": "off",
1435
+ "@typescript-eslint/no-require-imports": "off",
1436
+ "@typescript-eslint/no-shadow": "off",
1437
+ "@typescript-eslint/no-this-alias": "off",
1438
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
1439
+ "@typescript-eslint/no-unnecessary-condition": "off",
1440
+ "@typescript-eslint/no-unnecessary-parameter-property-assignment": "off",
1441
+ "@typescript-eslint/no-unnecessary-qualifier": "off",
1442
+ "@typescript-eslint/no-unnecessary-template-expression": "off",
1443
+ "@typescript-eslint/no-unnecessary-type-arguments": "off",
1444
+ "@typescript-eslint/no-unnecessary-type-assertion": "off",
1445
+ "@typescript-eslint/no-unnecessary-type-constraint": "off",
1446
+ "@typescript-eslint/no-unnecessary-type-conversion": "off",
1447
+ "@typescript-eslint/no-unnecessary-type-parameters": "off",
1448
+ "@typescript-eslint/no-unsafe-argument": "off",
1449
+ "@typescript-eslint/no-unsafe-assignment": "off",
1450
+ "@typescript-eslint/no-unsafe-call": "off",
1451
+ "@typescript-eslint/no-unsafe-declaration-merging": "off",
1452
+ "@typescript-eslint/no-unsafe-enum-comparison": "off",
1453
+ "@typescript-eslint/no-unsafe-function-type": "off",
1454
+ "@typescript-eslint/no-unsafe-member-access": "off",
1455
+ "@typescript-eslint/no-unsafe-return": "off",
1456
+ "@typescript-eslint/no-unsafe-type-assertion": "off",
1457
+ "@typescript-eslint/no-unsafe-unary-minus": "off",
1458
+ "@typescript-eslint/no-unused-expressions": "off",
1459
+ "@typescript-eslint/no-unused-vars": "off",
1460
+ "@typescript-eslint/no-useless-constructor": "off",
1461
+ "@typescript-eslint/no-useless-default-assignment": "off",
1462
+ "@typescript-eslint/no-useless-empty-export": "off",
1463
+ "@typescript-eslint/no-wrapper-object-types": "off",
1464
+ "@typescript-eslint/non-nullable-type-assertion-style": "off",
1465
+ "@typescript-eslint/only-throw-error": "off",
1466
+ "@typescript-eslint/prefer-as-const": "off",
1467
+ "@typescript-eslint/prefer-find": "off",
1468
+ "@typescript-eslint/prefer-for-of": "off",
1469
+ "@typescript-eslint/prefer-function-type": "off",
1470
+ "@typescript-eslint/prefer-includes": "off",
1471
+ "@typescript-eslint/prefer-literal-enum-member": "off",
1472
+ "@typescript-eslint/prefer-namespace-keyword": "off",
1473
+ "@typescript-eslint/prefer-nullish-coalescing": "off",
1474
+ "@typescript-eslint/prefer-optional-chain": "off",
1475
+ "@typescript-eslint/prefer-promise-reject-errors": "off",
1476
+ "@typescript-eslint/prefer-readonly": "off",
1477
+ "@typescript-eslint/prefer-reduce-type-parameter": "off",
1478
+ "@typescript-eslint/prefer-regexp-exec": "off",
1479
+ "@typescript-eslint/prefer-return-this-type": "off",
1480
+ "@typescript-eslint/prefer-string-starts-ends-with": "off",
1481
+ "@typescript-eslint/promise-function-async": "off",
1482
+ "@typescript-eslint/related-getter-setter-pairs": "off",
1483
+ "@typescript-eslint/require-array-sort-compare": "off",
1484
+ "@typescript-eslint/require-await": "off",
1485
+ "@typescript-eslint/restrict-plus-operands": "off",
1486
+ "@typescript-eslint/restrict-template-expressions": "off",
1487
+ "@typescript-eslint/return-await": "off",
1488
+ "@typescript-eslint/strict-boolean-expressions": "off",
1489
+ "@typescript-eslint/strict-void-return": "off",
1490
+ "@typescript-eslint/switch-exhaustiveness-check": "off",
1491
+ "@typescript-eslint/triple-slash-reference": "off",
1492
+ "@typescript-eslint/unbound-method": "off",
1493
+ "@typescript-eslint/unified-signatures": "off",
1494
+ "@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
1495
+ "dot-notation": "off",
1496
+ "no-array-constructor": "off",
1497
+ "no-empty-function": "off",
1498
+ "no-implied-eval": "off",
1499
+ "no-return-await": "off",
1500
+ "no-shadow": "off",
1501
+ "no-throw-literal": "off",
1502
+ "no-useless-constructor": "off",
1503
+ "prefer-promise-reject-errors": "off",
1504
+ "require-await": "off",
1505
+ "strict": "off",
1506
+ "unicode-bom": "off"
1507
+ },
1069
1508
  ...mdxPlugin.flatCodeBlocks.rules,
1070
1509
  "eol-last": "off",
1071
1510
  "no-undef": "off",