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.
@@ -25,9 +25,10 @@ export default [
25
25
  // TypeScript parser setup
26
26
  ...tseslint.configs.strictTypeChecked.slice(0, 2),
27
27
 
28
- // Base rules — all effective rules for *.ts files
28
+ // Base rules — all effective rules for TS plus shared JS/TS rules
29
29
  {
30
30
  name: "eslint-config-setup/base",
31
+ ignores: ["**/*.{md,mdx}"],
31
32
  plugins: {
32
33
  "@cspell": cspellPlugin,
33
34
  "@typescript-eslint": tseslint.plugin,
@@ -71,7 +72,13 @@ export default [
71
72
  "@typescript-eslint/no-confusing-void-expression": "error",
72
73
  "@typescript-eslint/no-deprecated": "warn",
73
74
  "@typescript-eslint/no-duplicate-type-constituents": "error",
74
- "@typescript-eslint/no-floating-promises": "error",
75
+ "@typescript-eslint/no-floating-promises": [
76
+ "error",
77
+ {
78
+ "checkThenables": true,
79
+ "ignoreIIFE": true
80
+ }
81
+ ],
75
82
  "@typescript-eslint/no-for-in-array": "error",
76
83
  "@typescript-eslint/no-implied-eval": "error",
77
84
  "@typescript-eslint/no-meaningless-void-operator": "error",
@@ -93,6 +100,7 @@ export default [
93
100
  "@typescript-eslint/no-unsafe-enum-comparison": "error",
94
101
  "@typescript-eslint/no-unsafe-member-access": "error",
95
102
  "@typescript-eslint/no-unsafe-return": "error",
103
+ "@typescript-eslint/no-unsafe-type-assertion": "error",
96
104
  "@typescript-eslint/no-unsafe-unary-minus": "error",
97
105
  "@typescript-eslint/no-useless-default-assignment": "error",
98
106
  "@typescript-eslint/non-nullable-type-assertion-style": "error",
@@ -102,11 +110,19 @@ export default [
102
110
  "@typescript-eslint/prefer-nullish-coalescing": "error",
103
111
  "@typescript-eslint/prefer-optional-chain": "error",
104
112
  "@typescript-eslint/prefer-promise-reject-errors": "error",
113
+ "@typescript-eslint/prefer-readonly": "warn",
105
114
  "@typescript-eslint/prefer-reduce-type-parameter": "error",
106
115
  "@typescript-eslint/prefer-regexp-exec": "error",
107
116
  "@typescript-eslint/prefer-return-this-type": "error",
108
117
  "@typescript-eslint/prefer-string-starts-ends-with": "error",
118
+ "@typescript-eslint/promise-function-async": "error",
109
119
  "@typescript-eslint/related-getter-setter-pairs": "error",
120
+ "@typescript-eslint/require-array-sort-compare": [
121
+ "error",
122
+ {
123
+ "ignoreStringArrays": true
124
+ }
125
+ ],
110
126
  "@typescript-eslint/require-await": "error",
111
127
  "@typescript-eslint/restrict-plus-operands": [
112
128
  "error",
@@ -136,6 +152,13 @@ export default [
136
152
  }
137
153
  ],
138
154
  "@typescript-eslint/strict-void-return": "error",
155
+ "@typescript-eslint/switch-exhaustiveness-check": [
156
+ "error",
157
+ {
158
+ "allowDefaultCaseForExhaustiveSwitch": false,
159
+ "requireDefaultForNonUnion": true
160
+ }
161
+ ],
139
162
  "@typescript-eslint/unbound-method": "error",
140
163
  "@typescript-eslint/use-unknown-in-catch-callback-variable": "error",
141
164
  "accessor-pairs": [
@@ -167,7 +190,12 @@ export default [
167
190
  "getBeforeSet"
168
191
  ],
169
192
  "guard-for-in": "error",
170
- "import/newline-after-import": "error",
193
+ "import/no-extraneous-dependencies": [
194
+ "error",
195
+ {
196
+ "includeTypes": true
197
+ }
198
+ ],
171
199
  "import/no-useless-path-segments": "error",
172
200
  "jsdoc/check-alignment": "error",
173
201
  "jsdoc/check-param-names": "error",
@@ -182,9 +210,7 @@ export default [
182
210
  "jsdoc/reject-function-type": "error",
183
211
  "jsdoc/require-next-type": "error",
184
212
  "jsdoc/require-returns-check": "error",
185
- "jsdoc/require-throws-type": "error",
186
213
  "jsdoc/require-yields-check": "error",
187
- "jsdoc/require-yields-type": "error",
188
214
  "jsdoc/ts-no-empty-object-type": "error",
189
215
  "jsdoc/valid-types": "error",
190
216
  "max-depth": [
@@ -226,6 +252,7 @@ export default [
226
252
  "no-extend-native": "error",
227
253
  "no-extra-bind": "error",
228
254
  "no-fallthrough": "error",
255
+ "no-implicit-globals": "error",
229
256
  "no-labels": "error",
230
257
  "no-lone-blocks": "error",
231
258
  "no-multi-str": "error",
@@ -239,18 +266,40 @@ export default [
239
266
  "no-proto": "error",
240
267
  "no-prototype-builtins": "error",
241
268
  "no-regex-spaces": "error",
269
+ "no-return-assign": [
270
+ "error",
271
+ "always"
272
+ ],
242
273
  "no-script-url": "error",
243
274
  "no-self-compare": "error",
244
- "no-sequences": "error",
275
+ "no-sequences": [
276
+ "error",
277
+ {
278
+ "allowInParentheses": false
279
+ }
280
+ ],
245
281
  "no-template-curly-in-string": "error",
246
282
  "no-unmodified-loop-condition": "error",
247
283
  "no-unreachable-loop": "error",
248
284
  "no-useless-assignment": "error",
249
285
  "no-useless-call": "error",
250
- "no-useless-computed-key": "error",
286
+ "no-useless-computed-key": [
287
+ "error",
288
+ {
289
+ "enforceForClassMembers": true
290
+ }
291
+ ],
251
292
  "no-useless-concat": "error",
252
293
  "no-useless-return": "error",
253
294
  "no-var": "error",
295
+ "object-shorthand": [
296
+ "error",
297
+ "always",
298
+ {
299
+ "avoidExplicitReturnArrows": true,
300
+ "avoidQuotes": true
301
+ }
302
+ ],
254
303
  "perfectionist/sort-exports": "error",
255
304
  "perfectionist/sort-imports": [
256
305
  "error",
@@ -263,12 +312,13 @@ export default [
263
312
  "perfectionist/sort-named-imports": "error",
264
313
  "perfectionist/sort-union-types": "error",
265
314
  "prefer-const": "error",
315
+ "prefer-numeric-literals": "error",
266
316
  "prefer-object-has-own": "error",
267
317
  "prefer-object-spread": "error",
268
318
  "prefer-regex-literals": "error",
269
319
  "prefer-rest-params": "error",
270
320
  "prefer-spread": "error",
271
- "prefer-template": "error",
321
+ "prefer-template": "warn",
272
322
  "preserve-caught-error": "error",
273
323
  "radix": "error",
274
324
  "regexp/confusing-quantifier": "warn",
@@ -375,13 +425,7 @@ export default [
375
425
  "sonarjs/prefer-single-boolean-return": "error",
376
426
  "sonarjs/reduce-initial-value": "error",
377
427
  "symbol-description": "error",
378
- "unicorn/prefer-export-from": [
379
- "error",
380
- {
381
- "ignoreUsedVariables": true
382
- }
383
- ],
384
- "unicorn/prefer-import-meta-properties": "error",
428
+ "unicorn/no-for-loop": "warn",
385
429
  "unused-imports/no-unused-imports": "error",
386
430
  "yoda": "error"
387
431
  },
@@ -453,18 +497,26 @@ export default [
453
497
  "@typescript-eslint/switch-exhaustiveness-check": "off",
454
498
  "@typescript-eslint/unbound-method": "off",
455
499
  "@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
456
- "getter-return": "error",
500
+ "dot-notation": "off",
501
+ "no-array-constructor": "off",
457
502
  "no-dupe-args": "error",
503
+ "no-empty-function": "off",
504
+ "no-implied-eval": "off",
458
505
  "no-new-symbol": "off",
459
506
  "no-redeclare": "error",
507
+ "no-return-await": "off",
508
+ "no-shadow": "off",
509
+ "no-throw-literal": "off",
460
510
  "no-undef": "error",
461
- "no-unreachable": "error",
511
+ "no-useless-constructor": "off",
462
512
  "prefer-const": [
463
513
  "error",
464
514
  {
465
515
  "destructuring": "all"
466
516
  }
467
- ]
517
+ ],
518
+ "prefer-promise-reject-errors": "off",
519
+ "require-await": "off"
468
520
  },
469
521
  },
470
522
 
@@ -506,8 +558,7 @@ export default [
506
558
  "vitest/prefer-spy-on": "error",
507
559
  "vitest/prefer-strict-equal": "error",
508
560
  "vitest/prefer-to-be": "error",
509
- "vitest/prefer-to-have-length": "error",
510
- "vitest/valid-title": "error"
561
+ "vitest/prefer-to-have-length": "error"
511
562
  },
512
563
  },
513
564
 
@@ -678,7 +729,85 @@ export default [
678
729
  // Markdown/MDX code block linting
679
730
  {
680
731
  ...mdxPlugin.flatCodeBlocks,
732
+ languageOptions: {
733
+ ...mdxPlugin.flatCodeBlocks.languageOptions,
734
+ parserOptions: {
735
+ ...mdxPlugin.flatCodeBlocks.languageOptions?.parserOptions,
736
+ projectService: false,
737
+ },
738
+ },
681
739
  rules: {
740
+ ...{
741
+ "@typescript-eslint/await-thenable": "off",
742
+ "@typescript-eslint/consistent-type-exports": "off",
743
+ "@typescript-eslint/dot-notation": "off",
744
+ "@typescript-eslint/no-array-delete": "off",
745
+ "@typescript-eslint/no-base-to-string": "off",
746
+ "@typescript-eslint/no-confusing-void-expression": "off",
747
+ "@typescript-eslint/no-deprecated": "off",
748
+ "@typescript-eslint/no-duplicate-type-constituents": "off",
749
+ "@typescript-eslint/no-floating-promises": "off",
750
+ "@typescript-eslint/no-for-in-array": "off",
751
+ "@typescript-eslint/no-implied-eval": "off",
752
+ "@typescript-eslint/no-meaningless-void-operator": "off",
753
+ "@typescript-eslint/no-misused-promises": "off",
754
+ "@typescript-eslint/no-misused-spread": "off",
755
+ "@typescript-eslint/no-mixed-enums": "off",
756
+ "@typescript-eslint/no-redundant-type-constituents": "off",
757
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
758
+ "@typescript-eslint/no-unnecessary-condition": "off",
759
+ "@typescript-eslint/no-unnecessary-qualifier": "off",
760
+ "@typescript-eslint/no-unnecessary-template-expression": "off",
761
+ "@typescript-eslint/no-unnecessary-type-arguments": "off",
762
+ "@typescript-eslint/no-unnecessary-type-assertion": "off",
763
+ "@typescript-eslint/no-unnecessary-type-conversion": "off",
764
+ "@typescript-eslint/no-unnecessary-type-parameters": "off",
765
+ "@typescript-eslint/no-unsafe-argument": "off",
766
+ "@typescript-eslint/no-unsafe-assignment": "off",
767
+ "@typescript-eslint/no-unsafe-call": "off",
768
+ "@typescript-eslint/no-unsafe-enum-comparison": "off",
769
+ "@typescript-eslint/no-unsafe-member-access": "off",
770
+ "@typescript-eslint/no-unsafe-return": "off",
771
+ "@typescript-eslint/no-unsafe-type-assertion": "off",
772
+ "@typescript-eslint/no-unsafe-unary-minus": "off",
773
+ "@typescript-eslint/no-useless-default-assignment": "off",
774
+ "@typescript-eslint/non-nullable-type-assertion-style": "off",
775
+ "@typescript-eslint/only-throw-error": "off",
776
+ "@typescript-eslint/prefer-find": "off",
777
+ "@typescript-eslint/prefer-includes": "off",
778
+ "@typescript-eslint/prefer-nullish-coalescing": "off",
779
+ "@typescript-eslint/prefer-optional-chain": "off",
780
+ "@typescript-eslint/prefer-promise-reject-errors": "off",
781
+ "@typescript-eslint/prefer-readonly": "off",
782
+ "@typescript-eslint/prefer-reduce-type-parameter": "off",
783
+ "@typescript-eslint/prefer-regexp-exec": "off",
784
+ "@typescript-eslint/prefer-return-this-type": "off",
785
+ "@typescript-eslint/prefer-string-starts-ends-with": "off",
786
+ "@typescript-eslint/promise-function-async": "off",
787
+ "@typescript-eslint/related-getter-setter-pairs": "off",
788
+ "@typescript-eslint/require-array-sort-compare": "off",
789
+ "@typescript-eslint/require-await": "off",
790
+ "@typescript-eslint/restrict-plus-operands": "off",
791
+ "@typescript-eslint/restrict-template-expressions": "off",
792
+ "@typescript-eslint/return-await": "off",
793
+ "@typescript-eslint/strict-boolean-expressions": "off",
794
+ "@typescript-eslint/strict-void-return": "off",
795
+ "@typescript-eslint/switch-exhaustiveness-check": "off",
796
+ "@typescript-eslint/unbound-method": "off",
797
+ "@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
798
+ "dot-notation": "off",
799
+ "no-array-constructor": "off",
800
+ "no-empty-function": "off",
801
+ "no-implied-eval": "off",
802
+ "no-return-await": "off",
803
+ "no-shadow": "off",
804
+ "no-throw-literal": "off",
805
+ "no-useless-constructor": "off",
806
+ "prefer-promise-reject-errors": "off",
807
+ "require-await": "off",
808
+ "strict": "off",
809
+ "unicode-bom": "off"
810
+ },
682
811
  ...mdxPlugin.flatCodeBlocks.rules,
683
812
  "eol-last": "off",
684
813
  "no-undef": "off",
@@ -691,10 +820,10 @@ export default [
691
820
  },
692
821
 
693
822
  // OxLint integration — disables rules already covered by OxLint
694
- ...[oxlintPlugin.configs["flat/recommended"]].flat().map((c) => ({ name: "eslint-config-setup/oxlint", ...c })),
695
- ...[oxlintPlugin.configs["flat/typescript"]].flat().map((c) => ({ name: "eslint-config-setup/oxlint-typescript", ...c })),
696
- ...[oxlintPlugin.configs["flat/unicorn"]].flat().map((c) => ({ name: "eslint-config-setup/oxlint-unicorn", ...c })),
697
- ...[oxlintPlugin.configs["flat/import"]].flat().map((c) => ({ name: "eslint-config-setup/oxlint-import", ...c })),
698
- ...[oxlintPlugin.configs["flat/jsdoc"]].flat().map((c) => ({ name: "eslint-config-setup/oxlint-jsdoc", ...c })),
823
+ ...[oxlintPlugin.configs["flat/recommended"]].flat().map((c, index, array) => ({ ...c, name: "eslint-config-setup/oxlint" + (array.length > 1 ? "-" + (index + 1) : "") })),
824
+ ...[oxlintPlugin.configs["flat/typescript"]].flat().map((c, index, array) => ({ ...c, name: "eslint-config-setup/oxlint-typescript" + (array.length > 1 ? "-" + (index + 1) : "") })),
825
+ ...[oxlintPlugin.configs["flat/unicorn"]].flat().map((c, index, array) => ({ ...c, name: "eslint-config-setup/oxlint-unicorn" + (array.length > 1 ? "-" + (index + 1) : "") })),
826
+ ...[oxlintPlugin.configs["flat/import"]].flat().map((c, index, array) => ({ ...c, name: "eslint-config-setup/oxlint-import" + (array.length > 1 ? "-" + (index + 1) : "") })),
827
+ ...[oxlintPlugin.configs["flat/jsdoc"]].flat().map((c, index, array) => ({ ...c, name: "eslint-config-setup/oxlint-jsdoc" + (array.length > 1 ? "-" + (index + 1) : "") })),
699
828
 
700
829
  ]