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.
@@ -26,9 +26,10 @@ export default [
26
26
  // TypeScript parser setup
27
27
  ...tseslint.configs.strictTypeChecked.slice(0, 2),
28
28
 
29
- // Base rules — all effective rules for *.ts files
29
+ // Base rules — all effective rules for TS plus shared JS/TS rules
30
30
  {
31
31
  name: "eslint-config-setup/base",
32
+ ignores: ["**/*.{md,mdx}"],
32
33
  plugins: {
33
34
  "@cspell": cspellPlugin,
34
35
  "@typescript-eslint": tseslint.plugin,
@@ -75,7 +76,13 @@ export default [
75
76
  "@typescript-eslint/no-confusing-void-expression": "error",
76
77
  "@typescript-eslint/no-deprecated": "warn",
77
78
  "@typescript-eslint/no-duplicate-type-constituents": "error",
78
- "@typescript-eslint/no-floating-promises": "error",
79
+ "@typescript-eslint/no-floating-promises": [
80
+ "error",
81
+ {
82
+ "checkThenables": true,
83
+ "ignoreIIFE": true
84
+ }
85
+ ],
79
86
  "@typescript-eslint/no-for-in-array": "error",
80
87
  "@typescript-eslint/no-implied-eval": "error",
81
88
  "@typescript-eslint/no-meaningless-void-operator": "error",
@@ -97,6 +104,7 @@ export default [
97
104
  "@typescript-eslint/no-unsafe-enum-comparison": "error",
98
105
  "@typescript-eslint/no-unsafe-member-access": "error",
99
106
  "@typescript-eslint/no-unsafe-return": "error",
107
+ "@typescript-eslint/no-unsafe-type-assertion": "error",
100
108
  "@typescript-eslint/no-unsafe-unary-minus": "error",
101
109
  "@typescript-eslint/no-useless-default-assignment": "error",
102
110
  "@typescript-eslint/non-nullable-type-assertion-style": "error",
@@ -106,11 +114,19 @@ export default [
106
114
  "@typescript-eslint/prefer-nullish-coalescing": "error",
107
115
  "@typescript-eslint/prefer-optional-chain": "error",
108
116
  "@typescript-eslint/prefer-promise-reject-errors": "error",
117
+ "@typescript-eslint/prefer-readonly": "warn",
109
118
  "@typescript-eslint/prefer-reduce-type-parameter": "error",
110
119
  "@typescript-eslint/prefer-regexp-exec": "error",
111
120
  "@typescript-eslint/prefer-return-this-type": "error",
112
121
  "@typescript-eslint/prefer-string-starts-ends-with": "error",
122
+ "@typescript-eslint/promise-function-async": "error",
113
123
  "@typescript-eslint/related-getter-setter-pairs": "error",
124
+ "@typescript-eslint/require-array-sort-compare": [
125
+ "error",
126
+ {
127
+ "ignoreStringArrays": true
128
+ }
129
+ ],
114
130
  "@typescript-eslint/require-await": "error",
115
131
  "@typescript-eslint/restrict-plus-operands": [
116
132
  "error",
@@ -140,6 +156,13 @@ export default [
140
156
  }
141
157
  ],
142
158
  "@typescript-eslint/strict-void-return": "error",
159
+ "@typescript-eslint/switch-exhaustiveness-check": [
160
+ "error",
161
+ {
162
+ "allowDefaultCaseForExhaustiveSwitch": false,
163
+ "requireDefaultForNonUnion": true
164
+ }
165
+ ],
143
166
  "@typescript-eslint/unbound-method": "error",
144
167
  "@typescript-eslint/use-unknown-in-catch-callback-variable": "error",
145
168
  "accessor-pairs": [
@@ -170,7 +193,12 @@ export default [
170
193
  "getBeforeSet"
171
194
  ],
172
195
  "guard-for-in": "error",
173
- "import/newline-after-import": "error",
196
+ "import/no-extraneous-dependencies": [
197
+ "error",
198
+ {
199
+ "includeTypes": true
200
+ }
201
+ ],
174
202
  "import/no-useless-path-segments": "error",
175
203
  "jsdoc/check-alignment": "error",
176
204
  "jsdoc/check-param-names": "error",
@@ -185,9 +213,7 @@ export default [
185
213
  "jsdoc/reject-function-type": "error",
186
214
  "jsdoc/require-next-type": "error",
187
215
  "jsdoc/require-returns-check": "error",
188
- "jsdoc/require-throws-type": "error",
189
216
  "jsdoc/require-yields-check": "error",
190
- "jsdoc/require-yields-type": "error",
191
217
  "jsdoc/ts-no-empty-object-type": "error",
192
218
  "jsdoc/valid-types": "error",
193
219
  "max-depth": [
@@ -229,6 +255,7 @@ export default [
229
255
  "no-extend-native": "error",
230
256
  "no-extra-bind": "error",
231
257
  "no-fallthrough": "error",
258
+ "no-implicit-globals": "error",
232
259
  "no-labels": "error",
233
260
  "no-lone-blocks": "error",
234
261
  "no-multi-str": "error",
@@ -242,18 +269,33 @@ export default [
242
269
  "no-proto": "error",
243
270
  "no-prototype-builtins": "error",
244
271
  "no-regex-spaces": "error",
272
+ "no-return-assign": [
273
+ "error",
274
+ "always"
275
+ ],
245
276
  "no-script-url": "error",
246
277
  "no-self-compare": "error",
247
- "no-sequences": "error",
278
+ "no-sequences": [
279
+ "error",
280
+ {
281
+ "allowInParentheses": false
282
+ }
283
+ ],
248
284
  "no-template-curly-in-string": "error",
249
285
  "no-unmodified-loop-condition": "error",
250
286
  "no-unreachable-loop": "error",
251
287
  "no-useless-assignment": "error",
252
288
  "no-useless-call": "error",
253
- "no-useless-computed-key": "error",
289
+ "no-useless-computed-key": [
290
+ "error",
291
+ {
292
+ "enforceForClassMembers": true
293
+ }
294
+ ],
254
295
  "no-useless-concat": "error",
255
296
  "no-useless-return": "error",
256
297
  "no-var": "error",
298
+ "node/handle-callback-err": "error",
257
299
  "node/hashbang": "error",
258
300
  "node/no-deprecated-api": "error",
259
301
  "node/no-exports-assign": "error",
@@ -281,6 +323,15 @@ export default [
281
323
  ],
282
324
  "node/prefer-promises/dns": "error",
283
325
  "node/prefer-promises/fs": "error",
326
+ "node/process-exit-as-throw": "error",
327
+ "object-shorthand": [
328
+ "error",
329
+ "always",
330
+ {
331
+ "avoidExplicitReturnArrows": true,
332
+ "avoidQuotes": true
333
+ }
334
+ ],
284
335
  "perfectionist/sort-exports": "error",
285
336
  "perfectionist/sort-imports": [
286
337
  "error",
@@ -293,12 +344,13 @@ export default [
293
344
  "perfectionist/sort-named-imports": "error",
294
345
  "perfectionist/sort-union-types": "error",
295
346
  "prefer-const": "error",
347
+ "prefer-numeric-literals": "error",
296
348
  "prefer-object-has-own": "error",
297
349
  "prefer-object-spread": "error",
298
350
  "prefer-regex-literals": "error",
299
351
  "prefer-rest-params": "error",
300
352
  "prefer-spread": "error",
301
- "prefer-template": "error",
353
+ "prefer-template": "warn",
302
354
  "preserve-caught-error": "error",
303
355
  "radix": "error",
304
356
  "regexp/confusing-quantifier": "warn",
@@ -405,13 +457,7 @@ export default [
405
457
  "sonarjs/prefer-single-boolean-return": "error",
406
458
  "sonarjs/reduce-initial-value": "error",
407
459
  "symbol-description": "error",
408
- "unicorn/prefer-export-from": [
409
- "error",
410
- {
411
- "ignoreUsedVariables": true
412
- }
413
- ],
414
- "unicorn/prefer-import-meta-properties": "error",
460
+ "unicorn/no-for-loop": "warn",
415
461
  "unused-imports/no-unused-imports": "error",
416
462
  "yoda": "error"
417
463
  },
@@ -483,18 +529,26 @@ export default [
483
529
  "@typescript-eslint/switch-exhaustiveness-check": "off",
484
530
  "@typescript-eslint/unbound-method": "off",
485
531
  "@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
486
- "getter-return": "error",
532
+ "dot-notation": "off",
533
+ "no-array-constructor": "off",
487
534
  "no-dupe-args": "error",
535
+ "no-empty-function": "off",
536
+ "no-implied-eval": "off",
488
537
  "no-new-symbol": "off",
489
538
  "no-redeclare": "error",
539
+ "no-return-await": "off",
540
+ "no-shadow": "off",
541
+ "no-throw-literal": "off",
490
542
  "no-undef": "error",
491
- "no-unreachable": "error",
543
+ "no-useless-constructor": "off",
492
544
  "prefer-const": [
493
545
  "error",
494
546
  {
495
547
  "destructuring": "all"
496
548
  }
497
- ]
549
+ ],
550
+ "prefer-promise-reject-errors": "off",
551
+ "require-await": "off"
498
552
  },
499
553
  },
500
554
 
@@ -536,8 +590,7 @@ export default [
536
590
  "vitest/prefer-spy-on": "error",
537
591
  "vitest/prefer-strict-equal": "error",
538
592
  "vitest/prefer-to-be": "error",
539
- "vitest/prefer-to-have-length": "error",
540
- "vitest/valid-title": "error"
593
+ "vitest/prefer-to-have-length": "error"
541
594
  },
542
595
  },
543
596
 
@@ -708,7 +761,85 @@ export default [
708
761
  // Markdown/MDX code block linting
709
762
  {
710
763
  ...mdxPlugin.flatCodeBlocks,
764
+ languageOptions: {
765
+ ...mdxPlugin.flatCodeBlocks.languageOptions,
766
+ parserOptions: {
767
+ ...mdxPlugin.flatCodeBlocks.languageOptions?.parserOptions,
768
+ projectService: false,
769
+ },
770
+ },
711
771
  rules: {
772
+ ...{
773
+ "@typescript-eslint/await-thenable": "off",
774
+ "@typescript-eslint/consistent-type-exports": "off",
775
+ "@typescript-eslint/dot-notation": "off",
776
+ "@typescript-eslint/no-array-delete": "off",
777
+ "@typescript-eslint/no-base-to-string": "off",
778
+ "@typescript-eslint/no-confusing-void-expression": "off",
779
+ "@typescript-eslint/no-deprecated": "off",
780
+ "@typescript-eslint/no-duplicate-type-constituents": "off",
781
+ "@typescript-eslint/no-floating-promises": "off",
782
+ "@typescript-eslint/no-for-in-array": "off",
783
+ "@typescript-eslint/no-implied-eval": "off",
784
+ "@typescript-eslint/no-meaningless-void-operator": "off",
785
+ "@typescript-eslint/no-misused-promises": "off",
786
+ "@typescript-eslint/no-misused-spread": "off",
787
+ "@typescript-eslint/no-mixed-enums": "off",
788
+ "@typescript-eslint/no-redundant-type-constituents": "off",
789
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
790
+ "@typescript-eslint/no-unnecessary-condition": "off",
791
+ "@typescript-eslint/no-unnecessary-qualifier": "off",
792
+ "@typescript-eslint/no-unnecessary-template-expression": "off",
793
+ "@typescript-eslint/no-unnecessary-type-arguments": "off",
794
+ "@typescript-eslint/no-unnecessary-type-assertion": "off",
795
+ "@typescript-eslint/no-unnecessary-type-conversion": "off",
796
+ "@typescript-eslint/no-unnecessary-type-parameters": "off",
797
+ "@typescript-eslint/no-unsafe-argument": "off",
798
+ "@typescript-eslint/no-unsafe-assignment": "off",
799
+ "@typescript-eslint/no-unsafe-call": "off",
800
+ "@typescript-eslint/no-unsafe-enum-comparison": "off",
801
+ "@typescript-eslint/no-unsafe-member-access": "off",
802
+ "@typescript-eslint/no-unsafe-return": "off",
803
+ "@typescript-eslint/no-unsafe-type-assertion": "off",
804
+ "@typescript-eslint/no-unsafe-unary-minus": "off",
805
+ "@typescript-eslint/no-useless-default-assignment": "off",
806
+ "@typescript-eslint/non-nullable-type-assertion-style": "off",
807
+ "@typescript-eslint/only-throw-error": "off",
808
+ "@typescript-eslint/prefer-find": "off",
809
+ "@typescript-eslint/prefer-includes": "off",
810
+ "@typescript-eslint/prefer-nullish-coalescing": "off",
811
+ "@typescript-eslint/prefer-optional-chain": "off",
812
+ "@typescript-eslint/prefer-promise-reject-errors": "off",
813
+ "@typescript-eslint/prefer-readonly": "off",
814
+ "@typescript-eslint/prefer-reduce-type-parameter": "off",
815
+ "@typescript-eslint/prefer-regexp-exec": "off",
816
+ "@typescript-eslint/prefer-return-this-type": "off",
817
+ "@typescript-eslint/prefer-string-starts-ends-with": "off",
818
+ "@typescript-eslint/promise-function-async": "off",
819
+ "@typescript-eslint/related-getter-setter-pairs": "off",
820
+ "@typescript-eslint/require-array-sort-compare": "off",
821
+ "@typescript-eslint/require-await": "off",
822
+ "@typescript-eslint/restrict-plus-operands": "off",
823
+ "@typescript-eslint/restrict-template-expressions": "off",
824
+ "@typescript-eslint/return-await": "off",
825
+ "@typescript-eslint/strict-boolean-expressions": "off",
826
+ "@typescript-eslint/strict-void-return": "off",
827
+ "@typescript-eslint/switch-exhaustiveness-check": "off",
828
+ "@typescript-eslint/unbound-method": "off",
829
+ "@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
830
+ "dot-notation": "off",
831
+ "no-array-constructor": "off",
832
+ "no-empty-function": "off",
833
+ "no-implied-eval": "off",
834
+ "no-return-await": "off",
835
+ "no-shadow": "off",
836
+ "no-throw-literal": "off",
837
+ "no-useless-constructor": "off",
838
+ "prefer-promise-reject-errors": "off",
839
+ "require-await": "off",
840
+ "strict": "off",
841
+ "unicode-bom": "off"
842
+ },
712
843
  ...mdxPlugin.flatCodeBlocks.rules,
713
844
  "eol-last": "off",
714
845
  "no-undef": "off",
@@ -721,11 +852,11 @@ export default [
721
852
  },
722
853
 
723
854
  // OxLint integration — disables rules already covered by OxLint
724
- ...[oxlintPlugin.configs["flat/recommended"]].flat().map((c) => ({ name: "eslint-config-setup/oxlint", ...c })),
725
- ...[oxlintPlugin.configs["flat/node"]].flat().map((c) => ({ name: "eslint-config-setup/oxlint-node", ...c })),
726
- ...[oxlintPlugin.configs["flat/typescript"]].flat().map((c) => ({ name: "eslint-config-setup/oxlint-typescript", ...c })),
727
- ...[oxlintPlugin.configs["flat/unicorn"]].flat().map((c) => ({ name: "eslint-config-setup/oxlint-unicorn", ...c })),
728
- ...[oxlintPlugin.configs["flat/import"]].flat().map((c) => ({ name: "eslint-config-setup/oxlint-import", ...c })),
729
- ...[oxlintPlugin.configs["flat/jsdoc"]].flat().map((c) => ({ name: "eslint-config-setup/oxlint-jsdoc", ...c })),
855
+ ...[oxlintPlugin.configs["flat/recommended"]].flat().map((c, index, array) => ({ ...c, name: "eslint-config-setup/oxlint" + (array.length > 1 ? "-" + (index + 1) : "") })),
856
+ ...[oxlintPlugin.configs["flat/node"]].flat().map((c, index, array) => ({ ...c, name: "eslint-config-setup/oxlint-node" + (array.length > 1 ? "-" + (index + 1) : "") })),
857
+ ...[oxlintPlugin.configs["flat/typescript"]].flat().map((c, index, array) => ({ ...c, name: "eslint-config-setup/oxlint-typescript" + (array.length > 1 ? "-" + (index + 1) : "") })),
858
+ ...[oxlintPlugin.configs["flat/unicorn"]].flat().map((c, index, array) => ({ ...c, name: "eslint-config-setup/oxlint-unicorn" + (array.length > 1 ? "-" + (index + 1) : "") })),
859
+ ...[oxlintPlugin.configs["flat/import"]].flat().map((c, index, array) => ({ ...c, name: "eslint-config-setup/oxlint-import" + (array.length > 1 ? "-" + (index + 1) : "") })),
860
+ ...[oxlintPlugin.configs["flat/jsdoc"]].flat().map((c, index, array) => ({ ...c, name: "eslint-config-setup/oxlint-jsdoc" + (array.length > 1 ? "-" + (index + 1) : "") })),
730
861
 
731
862
  ]