eslint-config-setup 0.3.3 → 0.4.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,
@@ -70,12 +71,22 @@ export default [
70
71
  }
71
72
  ],
72
73
  "@typescript-eslint/dot-notation": "error",
74
+ "@typescript-eslint/method-signature-style": [
75
+ "error",
76
+ "property"
77
+ ],
73
78
  "@typescript-eslint/no-array-delete": "error",
74
79
  "@typescript-eslint/no-base-to-string": "error",
75
80
  "@typescript-eslint/no-confusing-void-expression": "error",
76
81
  "@typescript-eslint/no-deprecated": "warn",
77
82
  "@typescript-eslint/no-duplicate-type-constituents": "error",
78
- "@typescript-eslint/no-floating-promises": "error",
83
+ "@typescript-eslint/no-floating-promises": [
84
+ "error",
85
+ {
86
+ "checkThenables": true,
87
+ "ignoreIIFE": true
88
+ }
89
+ ],
79
90
  "@typescript-eslint/no-for-in-array": "error",
80
91
  "@typescript-eslint/no-implied-eval": "error",
81
92
  "@typescript-eslint/no-meaningless-void-operator": "error",
@@ -97,6 +108,7 @@ export default [
97
108
  "@typescript-eslint/no-unsafe-enum-comparison": "error",
98
109
  "@typescript-eslint/no-unsafe-member-access": "error",
99
110
  "@typescript-eslint/no-unsafe-return": "error",
111
+ "@typescript-eslint/no-unsafe-type-assertion": "error",
100
112
  "@typescript-eslint/no-unsafe-unary-minus": "error",
101
113
  "@typescript-eslint/no-useless-default-assignment": "error",
102
114
  "@typescript-eslint/non-nullable-type-assertion-style": "error",
@@ -106,11 +118,19 @@ export default [
106
118
  "@typescript-eslint/prefer-nullish-coalescing": "error",
107
119
  "@typescript-eslint/prefer-optional-chain": "error",
108
120
  "@typescript-eslint/prefer-promise-reject-errors": "error",
121
+ "@typescript-eslint/prefer-readonly": "warn",
109
122
  "@typescript-eslint/prefer-reduce-type-parameter": "error",
110
123
  "@typescript-eslint/prefer-regexp-exec": "error",
111
124
  "@typescript-eslint/prefer-return-this-type": "error",
112
125
  "@typescript-eslint/prefer-string-starts-ends-with": "error",
126
+ "@typescript-eslint/promise-function-async": "error",
113
127
  "@typescript-eslint/related-getter-setter-pairs": "error",
128
+ "@typescript-eslint/require-array-sort-compare": [
129
+ "error",
130
+ {
131
+ "ignoreStringArrays": true
132
+ }
133
+ ],
114
134
  "@typescript-eslint/require-await": "error",
115
135
  "@typescript-eslint/restrict-plus-operands": [
116
136
  "error",
@@ -140,6 +160,13 @@ export default [
140
160
  }
141
161
  ],
142
162
  "@typescript-eslint/strict-void-return": "error",
163
+ "@typescript-eslint/switch-exhaustiveness-check": [
164
+ "error",
165
+ {
166
+ "allowDefaultCaseForExhaustiveSwitch": false,
167
+ "requireDefaultForNonUnion": true
168
+ }
169
+ ],
143
170
  "@typescript-eslint/unbound-method": "error",
144
171
  "@typescript-eslint/use-unknown-in-catch-callback-variable": "error",
145
172
  "accessor-pairs": [
@@ -171,6 +198,12 @@ export default [
171
198
  ],
172
199
  "guard-for-in": "error",
173
200
  "import/newline-after-import": "error",
201
+ "import/no-extraneous-dependencies": [
202
+ "error",
203
+ {
204
+ "includeTypes": true
205
+ }
206
+ ],
174
207
  "import/no-useless-path-segments": "error",
175
208
  "jsdoc/check-alignment": "error",
176
209
  "jsdoc/check-param-names": "error",
@@ -229,6 +262,7 @@ export default [
229
262
  "no-extend-native": "error",
230
263
  "no-extra-bind": "error",
231
264
  "no-fallthrough": "error",
265
+ "no-implicit-globals": "error",
232
266
  "no-labels": "error",
233
267
  "no-lone-blocks": "error",
234
268
  "no-multi-str": "error",
@@ -242,18 +276,33 @@ export default [
242
276
  "no-proto": "error",
243
277
  "no-prototype-builtins": "error",
244
278
  "no-regex-spaces": "error",
279
+ "no-return-assign": [
280
+ "error",
281
+ "always"
282
+ ],
245
283
  "no-script-url": "error",
246
284
  "no-self-compare": "error",
247
- "no-sequences": "error",
285
+ "no-sequences": [
286
+ "error",
287
+ {
288
+ "allowInParentheses": false
289
+ }
290
+ ],
248
291
  "no-template-curly-in-string": "error",
249
292
  "no-unmodified-loop-condition": "error",
250
293
  "no-unreachable-loop": "error",
251
294
  "no-useless-assignment": "error",
252
295
  "no-useless-call": "error",
253
- "no-useless-computed-key": "error",
296
+ "no-useless-computed-key": [
297
+ "error",
298
+ {
299
+ "enforceForClassMembers": true
300
+ }
301
+ ],
254
302
  "no-useless-concat": "error",
255
303
  "no-useless-return": "error",
256
304
  "no-var": "error",
305
+ "node/handle-callback-err": "error",
257
306
  "node/hashbang": "error",
258
307
  "node/no-deprecated-api": "error",
259
308
  "node/no-exports-assign": "error",
@@ -281,6 +330,15 @@ export default [
281
330
  ],
282
331
  "node/prefer-promises/dns": "error",
283
332
  "node/prefer-promises/fs": "error",
333
+ "node/process-exit-as-throw": "error",
334
+ "object-shorthand": [
335
+ "error",
336
+ "always",
337
+ {
338
+ "avoidExplicitReturnArrows": true,
339
+ "avoidQuotes": true
340
+ }
341
+ ],
284
342
  "perfectionist/sort-exports": "error",
285
343
  "perfectionist/sort-imports": [
286
344
  "error",
@@ -293,12 +351,13 @@ export default [
293
351
  "perfectionist/sort-named-imports": "error",
294
352
  "perfectionist/sort-union-types": "error",
295
353
  "prefer-const": "error",
354
+ "prefer-numeric-literals": "error",
296
355
  "prefer-object-has-own": "error",
297
356
  "prefer-object-spread": "error",
298
357
  "prefer-regex-literals": "error",
299
358
  "prefer-rest-params": "error",
300
359
  "prefer-spread": "error",
301
- "prefer-template": "error",
360
+ "prefer-template": "warn",
302
361
  "preserve-caught-error": "error",
303
362
  "radix": "error",
304
363
  "regexp/confusing-quantifier": "warn",
@@ -405,13 +464,13 @@ export default [
405
464
  "sonarjs/prefer-single-boolean-return": "error",
406
465
  "sonarjs/reduce-initial-value": "error",
407
466
  "symbol-description": "error",
467
+ "unicorn/no-for-loop": "warn",
408
468
  "unicorn/prefer-export-from": [
409
469
  "error",
410
470
  {
411
471
  "ignoreUsedVariables": true
412
472
  }
413
473
  ],
414
- "unicorn/prefer-import-meta-properties": "error",
415
474
  "unused-imports/no-unused-imports": "error",
416
475
  "yoda": "error"
417
476
  },
@@ -426,6 +485,7 @@ export default [
426
485
  "@typescript-eslint/consistent-return": "off",
427
486
  "@typescript-eslint/consistent-type-exports": "off",
428
487
  "@typescript-eslint/dot-notation": "off",
488
+ "@typescript-eslint/method-signature-style": "off",
429
489
  "@typescript-eslint/naming-convention": "off",
430
490
  "@typescript-eslint/no-array-delete": "off",
431
491
  "@typescript-eslint/no-base-to-string": "off",
@@ -483,18 +543,28 @@ export default [
483
543
  "@typescript-eslint/switch-exhaustiveness-check": "off",
484
544
  "@typescript-eslint/unbound-method": "off",
485
545
  "@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
546
+ "dot-notation": "off",
486
547
  "getter-return": "error",
548
+ "no-array-constructor": "off",
487
549
  "no-dupe-args": "error",
550
+ "no-empty-function": "off",
551
+ "no-implied-eval": "off",
488
552
  "no-new-symbol": "off",
489
553
  "no-redeclare": "error",
554
+ "no-return-await": "off",
555
+ "no-shadow": "off",
556
+ "no-throw-literal": "off",
490
557
  "no-undef": "error",
491
558
  "no-unreachable": "error",
559
+ "no-useless-constructor": "off",
492
560
  "prefer-const": [
493
561
  "error",
494
562
  {
495
563
  "destructuring": "all"
496
564
  }
497
- ]
565
+ ],
566
+ "prefer-promise-reject-errors": "off",
567
+ "require-await": "off"
498
568
  },
499
569
  },
500
570
 
@@ -536,8 +606,7 @@ export default [
536
606
  "vitest/prefer-spy-on": "error",
537
607
  "vitest/prefer-strict-equal": "error",
538
608
  "vitest/prefer-to-be": "error",
539
- "vitest/prefer-to-have-length": "error",
540
- "vitest/valid-title": "error"
609
+ "vitest/prefer-to-have-length": "error"
541
610
  },
542
611
  },
543
612
 
@@ -708,7 +777,86 @@ export default [
708
777
  // Markdown/MDX code block linting
709
778
  {
710
779
  ...mdxPlugin.flatCodeBlocks,
780
+ languageOptions: {
781
+ ...mdxPlugin.flatCodeBlocks.languageOptions,
782
+ parserOptions: {
783
+ ...mdxPlugin.flatCodeBlocks.languageOptions?.parserOptions,
784
+ projectService: false,
785
+ },
786
+ },
711
787
  rules: {
788
+ ...{
789
+ "@typescript-eslint/await-thenable": "off",
790
+ "@typescript-eslint/consistent-type-exports": "off",
791
+ "@typescript-eslint/dot-notation": "off",
792
+ "@typescript-eslint/method-signature-style": "off",
793
+ "@typescript-eslint/no-array-delete": "off",
794
+ "@typescript-eslint/no-base-to-string": "off",
795
+ "@typescript-eslint/no-confusing-void-expression": "off",
796
+ "@typescript-eslint/no-deprecated": "off",
797
+ "@typescript-eslint/no-duplicate-type-constituents": "off",
798
+ "@typescript-eslint/no-floating-promises": "off",
799
+ "@typescript-eslint/no-for-in-array": "off",
800
+ "@typescript-eslint/no-implied-eval": "off",
801
+ "@typescript-eslint/no-meaningless-void-operator": "off",
802
+ "@typescript-eslint/no-misused-promises": "off",
803
+ "@typescript-eslint/no-misused-spread": "off",
804
+ "@typescript-eslint/no-mixed-enums": "off",
805
+ "@typescript-eslint/no-redundant-type-constituents": "off",
806
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
807
+ "@typescript-eslint/no-unnecessary-condition": "off",
808
+ "@typescript-eslint/no-unnecessary-qualifier": "off",
809
+ "@typescript-eslint/no-unnecessary-template-expression": "off",
810
+ "@typescript-eslint/no-unnecessary-type-arguments": "off",
811
+ "@typescript-eslint/no-unnecessary-type-assertion": "off",
812
+ "@typescript-eslint/no-unnecessary-type-conversion": "off",
813
+ "@typescript-eslint/no-unnecessary-type-parameters": "off",
814
+ "@typescript-eslint/no-unsafe-argument": "off",
815
+ "@typescript-eslint/no-unsafe-assignment": "off",
816
+ "@typescript-eslint/no-unsafe-call": "off",
817
+ "@typescript-eslint/no-unsafe-enum-comparison": "off",
818
+ "@typescript-eslint/no-unsafe-member-access": "off",
819
+ "@typescript-eslint/no-unsafe-return": "off",
820
+ "@typescript-eslint/no-unsafe-type-assertion": "off",
821
+ "@typescript-eslint/no-unsafe-unary-minus": "off",
822
+ "@typescript-eslint/no-useless-default-assignment": "off",
823
+ "@typescript-eslint/non-nullable-type-assertion-style": "off",
824
+ "@typescript-eslint/only-throw-error": "off",
825
+ "@typescript-eslint/prefer-find": "off",
826
+ "@typescript-eslint/prefer-includes": "off",
827
+ "@typescript-eslint/prefer-nullish-coalescing": "off",
828
+ "@typescript-eslint/prefer-optional-chain": "off",
829
+ "@typescript-eslint/prefer-promise-reject-errors": "off",
830
+ "@typescript-eslint/prefer-readonly": "off",
831
+ "@typescript-eslint/prefer-reduce-type-parameter": "off",
832
+ "@typescript-eslint/prefer-regexp-exec": "off",
833
+ "@typescript-eslint/prefer-return-this-type": "off",
834
+ "@typescript-eslint/prefer-string-starts-ends-with": "off",
835
+ "@typescript-eslint/promise-function-async": "off",
836
+ "@typescript-eslint/related-getter-setter-pairs": "off",
837
+ "@typescript-eslint/require-array-sort-compare": "off",
838
+ "@typescript-eslint/require-await": "off",
839
+ "@typescript-eslint/restrict-plus-operands": "off",
840
+ "@typescript-eslint/restrict-template-expressions": "off",
841
+ "@typescript-eslint/return-await": "off",
842
+ "@typescript-eslint/strict-boolean-expressions": "off",
843
+ "@typescript-eslint/strict-void-return": "off",
844
+ "@typescript-eslint/switch-exhaustiveness-check": "off",
845
+ "@typescript-eslint/unbound-method": "off",
846
+ "@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
847
+ "dot-notation": "off",
848
+ "no-array-constructor": "off",
849
+ "no-empty-function": "off",
850
+ "no-implied-eval": "off",
851
+ "no-return-await": "off",
852
+ "no-shadow": "off",
853
+ "no-throw-literal": "off",
854
+ "no-useless-constructor": "off",
855
+ "prefer-promise-reject-errors": "off",
856
+ "require-await": "off",
857
+ "strict": "off",
858
+ "unicode-bom": "off"
859
+ },
712
860
  ...mdxPlugin.flatCodeBlocks.rules,
713
861
  "eol-last": "off",
714
862
  "no-undef": "off",