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
  "jsdoc": jsdocPlugin,
45
131
  "jsx-a11y": jsxA11yPlugin,
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,
@@ -95,7 +179,7 @@ export default [
95
179
  "@typescript-eslint/ban-ts-comment": [
96
180
  "error",
97
181
  {
98
- "minimumDescriptionLength": 10
182
+ "ts-expect-error": "allow-with-description"
99
183
  }
100
184
  ],
101
185
  "@typescript-eslint/ban-tslint-comment": "error",
@@ -103,7 +187,10 @@ export default [
103
187
  "@typescript-eslint/consistent-generic-constructors": "error",
104
188
  "@typescript-eslint/consistent-indexed-object-style": "error",
105
189
  "@typescript-eslint/consistent-type-assertions": "error",
106
- "@typescript-eslint/consistent-type-definitions": "error",
190
+ "@typescript-eslint/consistent-type-definitions": [
191
+ "error",
192
+ "type"
193
+ ],
107
194
  "@typescript-eslint/consistent-type-exports": [
108
195
  "error",
109
196
  {
@@ -113,10 +200,14 @@ export default [
113
200
  "@typescript-eslint/consistent-type-imports": [
114
201
  "error",
115
202
  {
116
- "fixStyle": "inline-type-imports"
203
+ "fixStyle": "separate-type-imports"
117
204
  }
118
205
  ],
119
206
  "@typescript-eslint/dot-notation": "error",
207
+ "@typescript-eslint/method-signature-style": [
208
+ "error",
209
+ "property"
210
+ ],
120
211
  "@typescript-eslint/no-array-constructor": "error",
121
212
  "@typescript-eslint/no-array-delete": "error",
122
213
  "@typescript-eslint/no-base-to-string": "error",
@@ -128,10 +219,21 @@ export default [
128
219
  "@typescript-eslint/no-dynamic-delete": "error",
129
220
  "@typescript-eslint/no-empty-function": "error",
130
221
  "@typescript-eslint/no-empty-object-type": "error",
131
- "@typescript-eslint/no-explicit-any": "error",
222
+ "@typescript-eslint/no-explicit-any": [
223
+ "warn",
224
+ {
225
+ "fixToUnknown": true
226
+ }
227
+ ],
132
228
  "@typescript-eslint/no-extra-non-null-assertion": "error",
133
229
  "@typescript-eslint/no-extraneous-class": "error",
134
- "@typescript-eslint/no-floating-promises": "error",
230
+ "@typescript-eslint/no-floating-promises": [
231
+ "error",
232
+ {
233
+ "checkThenables": true,
234
+ "ignoreIIFE": true
235
+ }
236
+ ],
135
237
  "@typescript-eslint/no-for-in-array": "error",
136
238
  "@typescript-eslint/no-implied-eval": "error",
137
239
  "@typescript-eslint/no-import-type-side-effects": "error",
@@ -139,7 +241,12 @@ export default [
139
241
  "@typescript-eslint/no-invalid-void-type": "error",
140
242
  "@typescript-eslint/no-meaningless-void-operator": "error",
141
243
  "@typescript-eslint/no-misused-new": "error",
142
- "@typescript-eslint/no-misused-promises": "error",
244
+ "@typescript-eslint/no-misused-promises": [
245
+ "error",
246
+ {
247
+ "checksVoidReturn": false
248
+ }
249
+ ],
143
250
  "@typescript-eslint/no-misused-spread": "error",
144
251
  "@typescript-eslint/no-mixed-enums": "error",
145
252
  "@typescript-eslint/no-namespace": "error",
@@ -182,6 +289,7 @@ export default [
182
289
  "@typescript-eslint/no-unsafe-function-type": "error",
183
290
  "@typescript-eslint/no-unsafe-member-access": "error",
184
291
  "@typescript-eslint/no-unsafe-return": "error",
292
+ "@typescript-eslint/no-unsafe-type-assertion": "error",
185
293
  "@typescript-eslint/no-unsafe-unary-minus": "error",
186
294
  "@typescript-eslint/no-unused-expressions": "error",
187
295
  "@typescript-eslint/no-unused-vars": [
@@ -212,11 +320,19 @@ export default [
212
320
  "@typescript-eslint/prefer-nullish-coalescing": "error",
213
321
  "@typescript-eslint/prefer-optional-chain": "error",
214
322
  "@typescript-eslint/prefer-promise-reject-errors": "error",
323
+ "@typescript-eslint/prefer-readonly": "warn",
215
324
  "@typescript-eslint/prefer-reduce-type-parameter": "error",
216
325
  "@typescript-eslint/prefer-regexp-exec": "error",
217
326
  "@typescript-eslint/prefer-return-this-type": "error",
218
327
  "@typescript-eslint/prefer-string-starts-ends-with": "error",
328
+ "@typescript-eslint/promise-function-async": "error",
219
329
  "@typescript-eslint/related-getter-setter-pairs": "error",
330
+ "@typescript-eslint/require-array-sort-compare": [
331
+ "error",
332
+ {
333
+ "ignoreStringArrays": true
334
+ }
335
+ ],
220
336
  "@typescript-eslint/require-await": "error",
221
337
  "@typescript-eslint/restrict-plus-operands": [
222
338
  "error",
@@ -246,6 +362,13 @@ export default [
246
362
  }
247
363
  ],
248
364
  "@typescript-eslint/strict-void-return": "error",
365
+ "@typescript-eslint/switch-exhaustiveness-check": [
366
+ "error",
367
+ {
368
+ "allowDefaultCaseForExhaustiveSwitch": false,
369
+ "requireDefaultForNonUnion": true
370
+ }
371
+ ],
249
372
  "@typescript-eslint/triple-slash-reference": "error",
250
373
  "@typescript-eslint/unbound-method": "error",
251
374
  "@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,25 @@ 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
+ "object-shorthand": [
617
+ "error",
618
+ "always",
619
+ {
620
+ "avoidExplicitReturnArrows": true,
621
+ "avoidQuotes": true
622
+ }
623
+ ],
460
624
  "perfectionist/sort-exports": "error",
461
625
  "perfectionist/sort-imports": [
462
626
  "error",
@@ -469,60 +633,117 @@ export default [
469
633
  "perfectionist/sort-named-imports": "error",
470
634
  "perfectionist/sort-union-types": "error",
471
635
  "prefer-const": "error",
636
+ "prefer-numeric-literals": "error",
472
637
  "prefer-object-has-own": "error",
473
638
  "prefer-object-spread": "error",
474
639
  "prefer-regex-literals": "error",
475
640
  "prefer-rest-params": "error",
476
641
  "prefer-spread": "error",
477
- "prefer-template": "error",
642
+ "prefer-template": "warn",
478
643
  "preserve-caught-error": "error",
479
644
  "radix": "error",
480
- "react-dom/no-dangerously-set-innerhtml": "warn",
481
- "react-dom/no-dangerously-set-innerhtml-with-children": "error",
482
- "react-dom/no-missing-button-type": "error",
483
- "react-dom/no-missing-iframe-sandbox": "error",
484
- "react-dom/no-string-style-prop": "error",
485
- "react-dom/no-unknown-property": "error",
486
- "react-dom/no-unsafe-target-blank": "error",
487
- "react-dom/no-void-elements-with-children": "error",
488
- "react-hooks/exhaustive-deps": "error",
645
+ "react-hooks/config": "error",
646
+ "react-hooks/error-boundaries": "error",
647
+ "react-hooks/exhaustive-deps": "warn",
648
+ "react-hooks/gating": "error",
649
+ "react-hooks/globals": "error",
650
+ "react-hooks/immutability": "error",
651
+ "react-hooks/incompatible-library": "warn",
652
+ "react-hooks/preserve-manual-memoization": "error",
653
+ "react-hooks/purity": "error",
654
+ "react-hooks/refs": "error",
489
655
  "react-hooks/rules-of-hooks": "error",
656
+ "react-hooks/set-state-in-effect": "error",
657
+ "react-hooks/set-state-in-render": "error",
658
+ "react-hooks/static-components": "error",
659
+ "react-hooks/unsupported-syntax": "warn",
660
+ "react-hooks/use-memo": "error",
661
+ "react-hooks/void-use-memo": "error",
490
662
  "react-refresh/only-export-components": [
491
663
  "warn",
492
664
  {
493
665
  "allowConstantExport": true
494
666
  }
495
667
  ],
496
- "react-web-api/no-leaked-event-listener": "error",
497
- "react-web-api/no-leaked-interval": "error",
498
- "react-web-api/no-leaked-resize-observer": "error",
499
- "react-web-api/no-leaked-timeout": "error",
500
668
  "react-you-might-not-need-an-effect/no-adjust-state-on-prop-change": "warn",
501
669
  "react-you-might-not-need-an-effect/no-chain-state-updates": "error",
502
670
  "react-you-might-not-need-an-effect/no-derived-state": "error",
503
- "react-you-might-not-need-an-effect/no-empty-effect": "error",
504
671
  "react-you-might-not-need-an-effect/no-event-handler": "error",
672
+ "react-you-might-not-need-an-effect/no-external-store-subscription": "error",
505
673
  "react-you-might-not-need-an-effect/no-initialize-state": "error",
506
674
  "react-you-might-not-need-an-effect/no-pass-data-to-parent": "error",
507
675
  "react-you-might-not-need-an-effect/no-pass-live-state-to-parent": "error",
508
676
  "react-you-might-not-need-an-effect/no-reset-all-state-on-prop-change": "error",
509
- "react/jsx-no-comment-textnodes": "error",
510
- "react/jsx-shorthand-boolean": "error",
677
+ "react/button-has-type": "warn",
678
+ "react/context-name": "warn",
679
+ "react/forward-ref-uses-ref": "warn",
680
+ "react/function-definition": "error",
681
+ "react/hook-use-state": "warn",
682
+ "react/id-name": "warn",
683
+ "react/iframe-missing-sandbox": "warn",
684
+ "react/jsx-key": "error",
685
+ "react/jsx-key-before-spread": "error",
686
+ "react/jsx-no-children-prop-with-children": "error",
687
+ "react/jsx-no-comment-textnodes": "warn",
688
+ "react/jsx-no-constructed-context-values": "warn",
689
+ "react/jsx-no-leaked-dollar": "warn",
690
+ "react/jsx-no-leaked-render": "error",
691
+ "react/jsx-no-leaked-semicolon": "warn",
692
+ "react/jsx-no-script-url": "warn",
693
+ "react/jsx-no-target-blank": "warn",
694
+ "react/jsx-no-useless-fragment": "warn",
511
695
  "react/no-access-state-in-setstate": "error",
512
- "react/no-array-index-key": "error",
696
+ "react/no-array-index-key": "warn",
697
+ "react/no-children-count": "warn",
698
+ "react/no-children-for-each": "warn",
699
+ "react/no-children-map": "warn",
700
+ "react/no-children-only": "warn",
513
701
  "react/no-children-prop": "error",
514
- "react/no-context-provider": "error",
702
+ "react/no-children-to-array": "warn",
703
+ "react/no-class-component": "error",
704
+ "react/no-clone-element": "warn",
705
+ "react/no-component-will-mount": "error",
706
+ "react/no-component-will-receive-props": "error",
707
+ "react/no-component-will-update": "error",
708
+ "react/no-context-provider": "warn",
709
+ "react/no-create-ref": "error",
710
+ "react/no-danger": "warn",
711
+ "react/no-danger-with-children": "error",
712
+ "react/no-did-mount-set-state": "warn",
713
+ "react/no-did-update-set-state": "warn",
515
714
  "react/no-direct-mutation-state": "error",
516
715
  "react/no-duplicate-key": "error",
517
- "react/no-forward-ref": "error",
518
- "react/no-leaked-conditional-rendering": "error",
519
- "react/no-missing-key": "error",
520
- "react/no-nested-component-definitions": "error",
521
- "react/no-unstable-context-value": "error",
522
- "react/no-unstable-default-props": "error",
523
- "react/no-unused-state": "error",
524
- "react/no-use-context": "error",
525
- "react/no-useless-fragment": "error",
716
+ "react/no-find-dom-node": "error",
717
+ "react/no-flush-sync": "error",
718
+ "react/no-hydrate": "error",
719
+ "react/no-implicit-key": "error",
720
+ "react/no-leaked-event-listener": "warn",
721
+ "react/no-leaked-fetch": "warn",
722
+ "react/no-leaked-intersection-observer": "warn",
723
+ "react/no-leaked-interval": "warn",
724
+ "react/no-leaked-resize-observer": "warn",
725
+ "react/no-leaked-timeout": "warn",
726
+ "react/no-misused-capture-owner-stack": "error",
727
+ "react/no-namespace": "error",
728
+ "react/no-nested-lazy-component-declarations": "error",
729
+ "react/no-object-type-as-default-prop": "warn",
730
+ "react/no-render": "error",
731
+ "react/no-render-return-value": "error",
732
+ "react/no-unknown-property": "error",
733
+ "react/no-unnecessary-use-prefix": "warn",
734
+ "react/no-unsafe-component-will-mount": "warn",
735
+ "react/no-unsafe-component-will-receive-props": "warn",
736
+ "react/no-unsafe-component-will-update": "warn",
737
+ "react/no-unsafe-iframe-sandbox": "warn",
738
+ "react/no-unstable-nested-components": "error",
739
+ "react/no-unused-class-component-members": "warn",
740
+ "react/no-unused-props": "warn",
741
+ "react/no-use-context": "warn",
742
+ "react/no-use-form-state": "error",
743
+ "react/no-will-update-set-state": "warn",
744
+ "react/ref-name": "warn",
745
+ "react/style-prop-object": "error",
746
+ "react/void-dom-elements-no-children": "error",
526
747
  "regexp/confusing-quantifier": "warn",
527
748
  "regexp/control-character-escape": "error",
528
749
  "regexp/match-any": "error",
@@ -637,15 +858,31 @@ export default [
637
858
  "unicorn/consistent-date-clone": "error",
638
859
  "unicorn/consistent-empty-array-spread": "error",
639
860
  "unicorn/consistent-existence-index-check": "error",
861
+ "unicorn/consistent-function-scoping": "warn",
640
862
  "unicorn/error-message": "error",
863
+ "unicorn/filename-case": [
864
+ "error",
865
+ {
866
+ "cases": {
867
+ "camelCase": true,
868
+ "pascalCase": true,
869
+ "kebabCase": true
870
+ },
871
+ "ignore": [
872
+ "__tests__"
873
+ ]
874
+ }
875
+ ],
641
876
  "unicorn/new-for-builtins": "error",
642
877
  "unicorn/no-abusive-eslint-disable": "error",
643
878
  "unicorn/no-accessor-recursion": "error",
644
879
  "unicorn/no-anonymous-default-export": "error",
645
880
  "unicorn/no-array-callback-reference": "error",
646
881
  "unicorn/no-array-method-this-argument": "error",
882
+ "unicorn/no-array-reduce": "warn",
647
883
  "unicorn/no-await-expression-member": "error",
648
884
  "unicorn/no-await-in-promise-methods": "error",
885
+ "unicorn/no-for-loop": "warn",
649
886
  "unicorn/no-instanceof-builtins": "error",
650
887
  "unicorn/no-invalid-fetch-options": "error",
651
888
  "unicorn/no-invalid-remove-event-listener": "error",
@@ -663,7 +900,12 @@ export default [
663
900
  "unicorn/no-useless-length-check": "error",
664
901
  "unicorn/no-useless-promise-resolve-reject": "error",
665
902
  "unicorn/no-useless-spread": "error",
666
- "unicorn/no-useless-undefined": "error",
903
+ "unicorn/no-useless-undefined": [
904
+ "warn",
905
+ {
906
+ "checkArguments": false
907
+ }
908
+ ],
667
909
  "unicorn/no-zero-fractions": "error",
668
910
  "unicorn/numeric-separators-style": "error",
669
911
  "unicorn/prefer-array-find": "error",
@@ -673,10 +915,11 @@ export default [
673
915
  "unicorn/prefer-array-some": "error",
674
916
  "unicorn/prefer-at": "error",
675
917
  "unicorn/prefer-date-now": "error",
918
+ "unicorn/prefer-dom-node-dataset": "error",
676
919
  "unicorn/prefer-export-from": [
677
920
  "error",
678
921
  {
679
- "ignoreUsedVariables": true
922
+ "checkUsedVariables": false
680
923
  }
681
924
  ],
682
925
  "unicorn/prefer-global-this": "error",
@@ -704,8 +947,19 @@ export default [
704
947
  "unicorn/text-encoding-identifier-case": "error",
705
948
  "unicorn/throw-new-error": "error",
706
949
  "unused-imports/no-unused-imports": "error",
707
- "use-isnan": "error",
708
- "valid-typeof": "error",
950
+ "use-isnan": [
951
+ "error",
952
+ {
953
+ "enforceForIndexOf": true,
954
+ "enforceForSwitchCase": true
955
+ }
956
+ ],
957
+ "valid-typeof": [
958
+ "error",
959
+ {
960
+ "requireStringLiterals": true
961
+ }
962
+ ],
709
963
  "yoda": "error"
710
964
  },
711
965
  },
@@ -715,46 +969,91 @@ export default [
715
969
  name: "eslint-config-setup/js-compat",
716
970
  files: ["**/*.{js,mjs,cjs}"],
717
971
  rules: {
972
+ "@typescript-eslint/adjacent-overload-signatures": "off",
973
+ "@typescript-eslint/array-type": "off",
718
974
  "@typescript-eslint/await-thenable": "off",
975
+ "@typescript-eslint/ban-ts-comment": "off",
976
+ "@typescript-eslint/ban-tslint-comment": "off",
977
+ "@typescript-eslint/class-literal-property-style": "off",
978
+ "@typescript-eslint/consistent-generic-constructors": "off",
979
+ "@typescript-eslint/consistent-indexed-object-style": "off",
719
980
  "@typescript-eslint/consistent-return": "off",
981
+ "@typescript-eslint/consistent-type-assertions": "off",
982
+ "@typescript-eslint/consistent-type-definitions": "off",
720
983
  "@typescript-eslint/consistent-type-exports": "off",
984
+ "@typescript-eslint/consistent-type-imports": "off",
721
985
  "@typescript-eslint/dot-notation": "off",
986
+ "@typescript-eslint/method-signature-style": "off",
722
987
  "@typescript-eslint/naming-convention": "off",
988
+ "@typescript-eslint/no-array-constructor": "off",
723
989
  "@typescript-eslint/no-array-delete": "off",
724
990
  "@typescript-eslint/no-base-to-string": "off",
991
+ "@typescript-eslint/no-confusing-non-null-assertion": "off",
725
992
  "@typescript-eslint/no-confusing-void-expression": "off",
726
993
  "@typescript-eslint/no-deprecated": "off",
994
+ "@typescript-eslint/no-duplicate-enum-values": "off",
727
995
  "@typescript-eslint/no-duplicate-type-constituents": "off",
996
+ "@typescript-eslint/no-dynamic-delete": "off",
997
+ "@typescript-eslint/no-empty-function": "off",
998
+ "@typescript-eslint/no-empty-object-type": "off",
999
+ "@typescript-eslint/no-explicit-any": "off",
1000
+ "@typescript-eslint/no-extra-non-null-assertion": "off",
1001
+ "@typescript-eslint/no-extraneous-class": "off",
728
1002
  "@typescript-eslint/no-floating-promises": "off",
729
1003
  "@typescript-eslint/no-for-in-array": "off",
730
1004
  "@typescript-eslint/no-implied-eval": "off",
1005
+ "@typescript-eslint/no-import-type-side-effects": "off",
1006
+ "@typescript-eslint/no-inferrable-types": "off",
1007
+ "@typescript-eslint/no-invalid-void-type": "off",
731
1008
  "@typescript-eslint/no-meaningless-void-operator": "off",
1009
+ "@typescript-eslint/no-misused-new": "off",
732
1010
  "@typescript-eslint/no-misused-promises": "off",
733
1011
  "@typescript-eslint/no-misused-spread": "off",
734
1012
  "@typescript-eslint/no-mixed-enums": "off",
1013
+ "@typescript-eslint/no-namespace": "off",
1014
+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "off",
1015
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "off",
1016
+ "@typescript-eslint/no-non-null-assertion": "off",
735
1017
  "@typescript-eslint/no-redundant-type-constituents": "off",
1018
+ "@typescript-eslint/no-require-imports": "off",
1019
+ "@typescript-eslint/no-shadow": "off",
1020
+ "@typescript-eslint/no-this-alias": "off",
736
1021
  "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
737
1022
  "@typescript-eslint/no-unnecessary-condition": "off",
1023
+ "@typescript-eslint/no-unnecessary-parameter-property-assignment": "off",
738
1024
  "@typescript-eslint/no-unnecessary-qualifier": "off",
739
1025
  "@typescript-eslint/no-unnecessary-template-expression": "off",
740
1026
  "@typescript-eslint/no-unnecessary-type-arguments": "off",
741
1027
  "@typescript-eslint/no-unnecessary-type-assertion": "off",
1028
+ "@typescript-eslint/no-unnecessary-type-constraint": "off",
742
1029
  "@typescript-eslint/no-unnecessary-type-conversion": "off",
743
1030
  "@typescript-eslint/no-unnecessary-type-parameters": "off",
744
1031
  "@typescript-eslint/no-unsafe-argument": "off",
745
1032
  "@typescript-eslint/no-unsafe-assignment": "off",
746
1033
  "@typescript-eslint/no-unsafe-call": "off",
1034
+ "@typescript-eslint/no-unsafe-declaration-merging": "off",
747
1035
  "@typescript-eslint/no-unsafe-enum-comparison": "off",
1036
+ "@typescript-eslint/no-unsafe-function-type": "off",
748
1037
  "@typescript-eslint/no-unsafe-member-access": "off",
749
1038
  "@typescript-eslint/no-unsafe-return": "off",
750
1039
  "@typescript-eslint/no-unsafe-type-assertion": "off",
751
1040
  "@typescript-eslint/no-unsafe-unary-minus": "off",
1041
+ "@typescript-eslint/no-unused-expressions": "off",
1042
+ "@typescript-eslint/no-unused-vars": "off",
1043
+ "@typescript-eslint/no-useless-constructor": "off",
752
1044
  "@typescript-eslint/no-useless-default-assignment": "off",
1045
+ "@typescript-eslint/no-useless-empty-export": "off",
1046
+ "@typescript-eslint/no-wrapper-object-types": "off",
753
1047
  "@typescript-eslint/non-nullable-type-assertion-style": "off",
754
1048
  "@typescript-eslint/only-throw-error": "off",
1049
+ "@typescript-eslint/prefer-as-const": "off",
755
1050
  "@typescript-eslint/prefer-destructuring": "off",
756
1051
  "@typescript-eslint/prefer-find": "off",
1052
+ "@typescript-eslint/prefer-for-of": "off",
1053
+ "@typescript-eslint/prefer-function-type": "off",
757
1054
  "@typescript-eslint/prefer-includes": "off",
1055
+ "@typescript-eslint/prefer-literal-enum-member": "off",
1056
+ "@typescript-eslint/prefer-namespace-keyword": "off",
758
1057
  "@typescript-eslint/prefer-nullish-coalescing": "off",
759
1058
  "@typescript-eslint/prefer-optional-chain": "off",
760
1059
  "@typescript-eslint/prefer-promise-reject-errors": "off",
@@ -774,33 +1073,47 @@ export default [
774
1073
  "@typescript-eslint/strict-boolean-expressions": "off",
775
1074
  "@typescript-eslint/strict-void-return": "off",
776
1075
  "@typescript-eslint/switch-exhaustiveness-check": "off",
1076
+ "@typescript-eslint/triple-slash-reference": "off",
777
1077
  "@typescript-eslint/unbound-method": "off",
1078
+ "@typescript-eslint/unified-signatures": "off",
778
1079
  "@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
779
1080
  "constructor-super": "error",
1081
+ "dot-notation": "off",
780
1082
  "getter-return": "error",
1083
+ "no-array-constructor": "off",
781
1084
  "no-class-assign": "error",
782
1085
  "no-const-assign": "error",
783
1086
  "no-dupe-args": "error",
784
1087
  "no-dupe-class-members": "error",
785
1088
  "no-dupe-keys": "error",
1089
+ "no-empty-function": "off",
786
1090
  "no-func-assign": "error",
1091
+ "no-implied-eval": "off",
787
1092
  "no-import-assign": "error",
788
1093
  "no-new-native-nonconstructor": "error",
789
1094
  "no-new-symbol": "off",
790
1095
  "no-obj-calls": "error",
791
1096
  "no-redeclare": "error",
1097
+ "no-return-await": "off",
792
1098
  "no-setter-return": "error",
1099
+ "no-shadow": "off",
793
1100
  "no-this-before-super": "error",
1101
+ "no-throw-literal": "off",
794
1102
  "no-undef": "error",
795
1103
  "no-unreachable": "error",
796
1104
  "no-unsafe-negation": "error",
1105
+ "no-unused-expressions": "off",
1106
+ "no-unused-vars": "error",
1107
+ "no-useless-constructor": "off",
797
1108
  "no-with": "error",
798
1109
  "prefer-const": [
799
1110
  "error",
800
1111
  {
801
1112
  "destructuring": "all"
802
1113
  }
803
- ]
1114
+ ],
1115
+ "prefer-promise-reject-errors": "off",
1116
+ "require-await": "off"
804
1117
  },
805
1118
  },
806
1119
 
@@ -1038,7 +1351,131 @@ export default [
1038
1351
  // Markdown/MDX code block linting
1039
1352
  {
1040
1353
  ...mdxPlugin.flatCodeBlocks,
1354
+ languageOptions: {
1355
+ ...mdxPlugin.flatCodeBlocks.languageOptions,
1356
+ parserOptions: {
1357
+ ...mdxPlugin.flatCodeBlocks.languageOptions?.parserOptions,
1358
+ projectService: false,
1359
+ },
1360
+ },
1041
1361
  rules: {
1362
+ ...{
1363
+ "@typescript-eslint/adjacent-overload-signatures": "off",
1364
+ "@typescript-eslint/array-type": "off",
1365
+ "@typescript-eslint/await-thenable": "off",
1366
+ "@typescript-eslint/ban-ts-comment": "off",
1367
+ "@typescript-eslint/ban-tslint-comment": "off",
1368
+ "@typescript-eslint/class-literal-property-style": "off",
1369
+ "@typescript-eslint/consistent-generic-constructors": "off",
1370
+ "@typescript-eslint/consistent-indexed-object-style": "off",
1371
+ "@typescript-eslint/consistent-type-assertions": "off",
1372
+ "@typescript-eslint/consistent-type-definitions": "off",
1373
+ "@typescript-eslint/consistent-type-exports": "off",
1374
+ "@typescript-eslint/consistent-type-imports": "off",
1375
+ "@typescript-eslint/dot-notation": "off",
1376
+ "@typescript-eslint/method-signature-style": "off",
1377
+ "@typescript-eslint/no-array-constructor": "off",
1378
+ "@typescript-eslint/no-array-delete": "off",
1379
+ "@typescript-eslint/no-base-to-string": "off",
1380
+ "@typescript-eslint/no-confusing-non-null-assertion": "off",
1381
+ "@typescript-eslint/no-confusing-void-expression": "off",
1382
+ "@typescript-eslint/no-deprecated": "off",
1383
+ "@typescript-eslint/no-duplicate-enum-values": "off",
1384
+ "@typescript-eslint/no-duplicate-type-constituents": "off",
1385
+ "@typescript-eslint/no-dynamic-delete": "off",
1386
+ "@typescript-eslint/no-empty-function": "off",
1387
+ "@typescript-eslint/no-empty-object-type": "off",
1388
+ "@typescript-eslint/no-explicit-any": "off",
1389
+ "@typescript-eslint/no-extra-non-null-assertion": "off",
1390
+ "@typescript-eslint/no-extraneous-class": "off",
1391
+ "@typescript-eslint/no-floating-promises": "off",
1392
+ "@typescript-eslint/no-for-in-array": "off",
1393
+ "@typescript-eslint/no-implied-eval": "off",
1394
+ "@typescript-eslint/no-import-type-side-effects": "off",
1395
+ "@typescript-eslint/no-inferrable-types": "off",
1396
+ "@typescript-eslint/no-invalid-void-type": "off",
1397
+ "@typescript-eslint/no-meaningless-void-operator": "off",
1398
+ "@typescript-eslint/no-misused-new": "off",
1399
+ "@typescript-eslint/no-misused-spread": "off",
1400
+ "@typescript-eslint/no-mixed-enums": "off",
1401
+ "@typescript-eslint/no-namespace": "off",
1402
+ "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "off",
1403
+ "@typescript-eslint/no-non-null-asserted-optional-chain": "off",
1404
+ "@typescript-eslint/no-non-null-assertion": "off",
1405
+ "@typescript-eslint/no-redundant-type-constituents": "off",
1406
+ "@typescript-eslint/no-require-imports": "off",
1407
+ "@typescript-eslint/no-shadow": "off",
1408
+ "@typescript-eslint/no-this-alias": "off",
1409
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
1410
+ "@typescript-eslint/no-unnecessary-condition": "off",
1411
+ "@typescript-eslint/no-unnecessary-parameter-property-assignment": "off",
1412
+ "@typescript-eslint/no-unnecessary-qualifier": "off",
1413
+ "@typescript-eslint/no-unnecessary-template-expression": "off",
1414
+ "@typescript-eslint/no-unnecessary-type-arguments": "off",
1415
+ "@typescript-eslint/no-unnecessary-type-assertion": "off",
1416
+ "@typescript-eslint/no-unnecessary-type-constraint": "off",
1417
+ "@typescript-eslint/no-unnecessary-type-conversion": "off",
1418
+ "@typescript-eslint/no-unnecessary-type-parameters": "off",
1419
+ "@typescript-eslint/no-unsafe-argument": "off",
1420
+ "@typescript-eslint/no-unsafe-assignment": "off",
1421
+ "@typescript-eslint/no-unsafe-call": "off",
1422
+ "@typescript-eslint/no-unsafe-declaration-merging": "off",
1423
+ "@typescript-eslint/no-unsafe-enum-comparison": "off",
1424
+ "@typescript-eslint/no-unsafe-function-type": "off",
1425
+ "@typescript-eslint/no-unsafe-member-access": "off",
1426
+ "@typescript-eslint/no-unsafe-return": "off",
1427
+ "@typescript-eslint/no-unsafe-type-assertion": "off",
1428
+ "@typescript-eslint/no-unsafe-unary-minus": "off",
1429
+ "@typescript-eslint/no-unused-expressions": "off",
1430
+ "@typescript-eslint/no-unused-vars": "off",
1431
+ "@typescript-eslint/no-useless-constructor": "off",
1432
+ "@typescript-eslint/no-useless-default-assignment": "off",
1433
+ "@typescript-eslint/no-useless-empty-export": "off",
1434
+ "@typescript-eslint/no-wrapper-object-types": "off",
1435
+ "@typescript-eslint/non-nullable-type-assertion-style": "off",
1436
+ "@typescript-eslint/only-throw-error": "off",
1437
+ "@typescript-eslint/prefer-as-const": "off",
1438
+ "@typescript-eslint/prefer-find": "off",
1439
+ "@typescript-eslint/prefer-for-of": "off",
1440
+ "@typescript-eslint/prefer-function-type": "off",
1441
+ "@typescript-eslint/prefer-includes": "off",
1442
+ "@typescript-eslint/prefer-literal-enum-member": "off",
1443
+ "@typescript-eslint/prefer-namespace-keyword": "off",
1444
+ "@typescript-eslint/prefer-nullish-coalescing": "off",
1445
+ "@typescript-eslint/prefer-optional-chain": "off",
1446
+ "@typescript-eslint/prefer-promise-reject-errors": "off",
1447
+ "@typescript-eslint/prefer-readonly": "off",
1448
+ "@typescript-eslint/prefer-reduce-type-parameter": "off",
1449
+ "@typescript-eslint/prefer-regexp-exec": "off",
1450
+ "@typescript-eslint/prefer-return-this-type": "off",
1451
+ "@typescript-eslint/prefer-string-starts-ends-with": "off",
1452
+ "@typescript-eslint/promise-function-async": "off",
1453
+ "@typescript-eslint/related-getter-setter-pairs": "off",
1454
+ "@typescript-eslint/require-array-sort-compare": "off",
1455
+ "@typescript-eslint/require-await": "off",
1456
+ "@typescript-eslint/restrict-plus-operands": "off",
1457
+ "@typescript-eslint/restrict-template-expressions": "off",
1458
+ "@typescript-eslint/return-await": "off",
1459
+ "@typescript-eslint/strict-boolean-expressions": "off",
1460
+ "@typescript-eslint/strict-void-return": "off",
1461
+ "@typescript-eslint/switch-exhaustiveness-check": "off",
1462
+ "@typescript-eslint/triple-slash-reference": "off",
1463
+ "@typescript-eslint/unbound-method": "off",
1464
+ "@typescript-eslint/unified-signatures": "off",
1465
+ "@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
1466
+ "dot-notation": "off",
1467
+ "no-array-constructor": "off",
1468
+ "no-empty-function": "off",
1469
+ "no-implied-eval": "off",
1470
+ "no-return-await": "off",
1471
+ "no-shadow": "off",
1472
+ "no-throw-literal": "off",
1473
+ "no-useless-constructor": "off",
1474
+ "prefer-promise-reject-errors": "off",
1475
+ "require-await": "off",
1476
+ "strict": "off",
1477
+ "unicode-bom": "off"
1478
+ },
1042
1479
  ...mdxPlugin.flatCodeBlocks.rules,
1043
1480
  "eol-last": "off",
1044
1481
  "no-undef": "off",