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.
@@ -7,7 +7,6 @@ import globals from "globals"
7
7
  import importXPlugin from "eslint-plugin-import-x"
8
8
  import jsdocPlugin from "eslint-plugin-jsdoc"
9
9
  import jsonPlugin from "@eslint/json"
10
- import jsxA11yPlugin from "eslint-plugin-jsx-a11y"
11
10
  import nodePlugin from "eslint-plugin-n"
12
11
  import oxlintPlugin from "eslint-plugin-oxlint"
13
12
  import packageJsonPlugin from "eslint-plugin-package-json"
@@ -27,16 +26,16 @@ export default [
27
26
  // TypeScript parser setup
28
27
  ...tseslint.configs.strictTypeChecked.slice(0, 2),
29
28
 
30
- // Base rules — all effective rules for *.ts files
29
+ // Base rules — all effective rules for TS plus shared JS/TS rules
31
30
  {
32
31
  name: "eslint-config-setup/base",
32
+ ignores: ["**/*.{md,mdx}"],
33
33
  plugins: {
34
34
  "@cspell": cspellPlugin,
35
35
  "@typescript-eslint": tseslint.plugin,
36
36
  "de-morgan": deMorganPlugin,
37
37
  "import": importXPlugin,
38
38
  "jsdoc": jsdocPlugin,
39
- "jsx-a11y": jsxA11yPlugin,
40
39
  "node": nodePlugin,
41
40
  "perfectionist": perfectionistPlugin,
42
41
  "regexp": regexpPlugin,
@@ -72,7 +71,6 @@ export default [
72
71
  }
73
72
  ],
74
73
  "@typescript-eslint/dot-notation": "error",
75
- "@typescript-eslint/explicit-member-accessibility": "error",
76
74
  "@typescript-eslint/member-ordering": [
77
75
  "warn",
78
76
  {
@@ -376,6 +374,12 @@ export default [
376
374
  ],
377
375
  "guard-for-in": "error",
378
376
  "import/newline-after-import": "error",
377
+ "import/no-extraneous-dependencies": [
378
+ "error",
379
+ {
380
+ "includeTypes": true
381
+ }
382
+ ],
379
383
  "import/no-useless-path-segments": "error",
380
384
  "jsdoc/check-alignment": "error",
381
385
  "jsdoc/check-param-names": "error",
@@ -396,8 +400,6 @@ export default [
396
400
  "jsdoc/require-yields-type": "error",
397
401
  "jsdoc/ts-no-empty-object-type": "error",
398
402
  "jsdoc/valid-types": "error",
399
- "jsx-a11y/interactive-supports-focus": "error",
400
- "jsx-a11y/no-noninteractive-element-interactions": "error",
401
403
  "logical-assignment-operators": [
402
404
  "error",
403
405
  "always",
@@ -420,7 +422,7 @@ export default [
420
422
  "max-lines-per-function": [
421
423
  "error",
422
424
  {
423
- "max": 50,
425
+ "max": 100,
424
426
  "skipBlankLines": true,
425
427
  "skipComments": true
426
428
  }
@@ -452,6 +454,7 @@ export default [
452
454
  "no-extra-bind": "error",
453
455
  "no-fallthrough": "error",
454
456
  "no-implicit-coercion": "error",
457
+ "no-implicit-globals": "error",
455
458
  "no-labels": "error",
456
459
  "no-lone-blocks": "error",
457
460
  "no-lonely-if": "error",
@@ -481,18 +484,29 @@ export default [
481
484
  ],
482
485
  "no-script-url": "error",
483
486
  "no-self-compare": "error",
484
- "no-sequences": "error",
487
+ "no-sequences": [
488
+ "error",
489
+ {
490
+ "allowInParentheses": false
491
+ }
492
+ ],
485
493
  "no-template-curly-in-string": "error",
486
494
  "no-unmodified-loop-condition": "error",
487
495
  "no-unneeded-ternary": "error",
488
496
  "no-unreachable-loop": "error",
489
497
  "no-useless-assignment": "error",
490
498
  "no-useless-call": "error",
491
- "no-useless-computed-key": "error",
499
+ "no-useless-computed-key": [
500
+ "error",
501
+ {
502
+ "enforceForClassMembers": true
503
+ }
504
+ ],
492
505
  "no-useless-concat": "error",
493
506
  "no-useless-return": "error",
494
507
  "no-var": "error",
495
508
  "no-warning-comments": "warn",
509
+ "node/handle-callback-err": "error",
496
510
  "node/hashbang": "error",
497
511
  "node/no-deprecated-api": "error",
498
512
  "node/no-exports-assign": "error",
@@ -521,10 +535,12 @@ export default [
521
535
  ],
522
536
  "node/prefer-promises/dns": "error",
523
537
  "node/prefer-promises/fs": "error",
538
+ "node/process-exit-as-throw": "error",
524
539
  "object-shorthand": [
525
540
  "error",
526
541
  "always",
527
542
  {
543
+ "avoidExplicitReturnArrows": true,
528
544
  "avoidQuotes": true
529
545
  }
530
546
  ],
@@ -559,14 +575,10 @@ export default [
559
575
  "allowNamedFunctions": true
560
576
  }
561
577
  ],
562
- "prefer-const": [
563
- "error",
564
- {
565
- "destructuring": "all"
566
- }
567
- ],
578
+ "prefer-const": "error",
568
579
  "prefer-exponentiation-operator": "error",
569
580
  "prefer-named-capture-group": "error",
581
+ "prefer-numeric-literals": "error",
570
582
  "prefer-object-has-own": "error",
571
583
  "prefer-object-spread": "error",
572
584
  "prefer-regex-literals": "error",
@@ -702,7 +714,6 @@ export default [
702
714
  "sonarjs/public-static-readonly": "error",
703
715
  "sonarjs/reduce-initial-value": "error",
704
716
  "symbol-description": "error",
705
- "unicorn/custom-error-definition": "error",
706
717
  "unicorn/no-array-push-push": "error",
707
718
  "unicorn/no-for-loop": "error",
708
719
  "unicorn/prefer-export-from": [
@@ -711,7 +722,6 @@ export default [
711
722
  "ignoreUsedVariables": true
712
723
  }
713
724
  ],
714
- "unicorn/prefer-import-meta-properties": "error",
715
725
  "unicorn/prefer-switch": [
716
726
  "error",
717
727
  {
@@ -731,12 +741,17 @@ export default [
731
741
  rules: {
732
742
  "@typescript-eslint/await-thenable": "off",
733
743
  "@typescript-eslint/consistent-return": "off",
744
+ "@typescript-eslint/consistent-type-exports": "off",
734
745
  "@typescript-eslint/dot-notation": "off",
746
+ "@typescript-eslint/member-ordering": "off",
747
+ "@typescript-eslint/method-signature-style": "off",
748
+ "@typescript-eslint/naming-convention": "off",
735
749
  "@typescript-eslint/no-array-delete": "off",
736
750
  "@typescript-eslint/no-base-to-string": "off",
737
751
  "@typescript-eslint/no-confusing-void-expression": "off",
738
752
  "@typescript-eslint/no-deprecated": "off",
739
753
  "@typescript-eslint/no-duplicate-type-constituents": "off",
754
+ "@typescript-eslint/no-floating-promises": "off",
740
755
  "@typescript-eslint/no-for-in-array": "off",
741
756
  "@typescript-eslint/no-implied-eval": "off",
742
757
  "@typescript-eslint/no-meaningless-void-operator": "off",
@@ -758,6 +773,7 @@ export default [
758
773
  "@typescript-eslint/no-unsafe-enum-comparison": "off",
759
774
  "@typescript-eslint/no-unsafe-member-access": "off",
760
775
  "@typescript-eslint/no-unsafe-return": "off",
776
+ "@typescript-eslint/no-unsafe-type-assertion": "off",
761
777
  "@typescript-eslint/no-unsafe-unary-minus": "off",
762
778
  "@typescript-eslint/no-useless-default-assignment": "off",
763
779
  "@typescript-eslint/non-nullable-type-assertion-style": "off",
@@ -768,26 +784,46 @@ export default [
768
784
  "@typescript-eslint/prefer-nullish-coalescing": "off",
769
785
  "@typescript-eslint/prefer-optional-chain": "off",
770
786
  "@typescript-eslint/prefer-promise-reject-errors": "off",
787
+ "@typescript-eslint/prefer-readonly": "off",
771
788
  "@typescript-eslint/prefer-readonly-parameter-types": "off",
772
789
  "@typescript-eslint/prefer-reduce-type-parameter": "off",
773
790
  "@typescript-eslint/prefer-regexp-exec": "off",
774
791
  "@typescript-eslint/prefer-return-this-type": "off",
775
792
  "@typescript-eslint/prefer-string-starts-ends-with": "off",
793
+ "@typescript-eslint/promise-function-async": "off",
776
794
  "@typescript-eslint/related-getter-setter-pairs": "off",
795
+ "@typescript-eslint/require-array-sort-compare": "off",
777
796
  "@typescript-eslint/require-await": "off",
778
797
  "@typescript-eslint/restrict-plus-operands": "off",
779
798
  "@typescript-eslint/restrict-template-expressions": "off",
780
799
  "@typescript-eslint/return-await": "off",
781
800
  "@typescript-eslint/strict-boolean-expressions": "off",
782
801
  "@typescript-eslint/strict-void-return": "off",
802
+ "@typescript-eslint/switch-exhaustiveness-check": "off",
783
803
  "@typescript-eslint/unbound-method": "off",
784
804
  "@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
805
+ "dot-notation": "off",
785
806
  "getter-return": "error",
807
+ "no-array-constructor": "off",
786
808
  "no-dupe-args": "error",
809
+ "no-empty-function": "off",
810
+ "no-implied-eval": "off",
787
811
  "no-new-symbol": "off",
788
812
  "no-redeclare": "error",
813
+ "no-return-await": "off",
814
+ "no-shadow": "off",
815
+ "no-throw-literal": "off",
789
816
  "no-undef": "error",
790
- "no-unreachable": "error"
817
+ "no-unreachable": "error",
818
+ "no-useless-constructor": "off",
819
+ "prefer-const": [
820
+ "error",
821
+ {
822
+ "destructuring": "all"
823
+ }
824
+ ],
825
+ "prefer-promise-reject-errors": "off",
826
+ "require-await": "off"
791
827
  },
792
828
  },
793
829
 
@@ -834,8 +870,7 @@ export default [
834
870
  "vitest/prefer-strict-equal": "error",
835
871
  "vitest/prefer-to-be": "error",
836
872
  "vitest/prefer-to-have-length": "error",
837
- "vitest/require-top-level-describe": "error",
838
- "vitest/valid-title": "error"
873
+ "vitest/require-top-level-describe": "error"
839
874
  },
840
875
  },
841
876
 
@@ -1016,7 +1051,88 @@ export default [
1016
1051
  // Markdown/MDX code block linting
1017
1052
  {
1018
1053
  ...mdxPlugin.flatCodeBlocks,
1054
+ languageOptions: {
1055
+ ...mdxPlugin.flatCodeBlocks.languageOptions,
1056
+ parserOptions: {
1057
+ ...mdxPlugin.flatCodeBlocks.languageOptions?.parserOptions,
1058
+ projectService: false,
1059
+ },
1060
+ },
1019
1061
  rules: {
1062
+ ...{
1063
+ "@typescript-eslint/await-thenable": "off",
1064
+ "@typescript-eslint/consistent-type-exports": "off",
1065
+ "@typescript-eslint/dot-notation": "off",
1066
+ "@typescript-eslint/member-ordering": "off",
1067
+ "@typescript-eslint/method-signature-style": "off",
1068
+ "@typescript-eslint/naming-convention": "off",
1069
+ "@typescript-eslint/no-array-delete": "off",
1070
+ "@typescript-eslint/no-base-to-string": "off",
1071
+ "@typescript-eslint/no-confusing-void-expression": "off",
1072
+ "@typescript-eslint/no-deprecated": "off",
1073
+ "@typescript-eslint/no-duplicate-type-constituents": "off",
1074
+ "@typescript-eslint/no-floating-promises": "off",
1075
+ "@typescript-eslint/no-for-in-array": "off",
1076
+ "@typescript-eslint/no-implied-eval": "off",
1077
+ "@typescript-eslint/no-meaningless-void-operator": "off",
1078
+ "@typescript-eslint/no-misused-promises": "off",
1079
+ "@typescript-eslint/no-misused-spread": "off",
1080
+ "@typescript-eslint/no-mixed-enums": "off",
1081
+ "@typescript-eslint/no-redundant-type-constituents": "off",
1082
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
1083
+ "@typescript-eslint/no-unnecessary-condition": "off",
1084
+ "@typescript-eslint/no-unnecessary-qualifier": "off",
1085
+ "@typescript-eslint/no-unnecessary-template-expression": "off",
1086
+ "@typescript-eslint/no-unnecessary-type-arguments": "off",
1087
+ "@typescript-eslint/no-unnecessary-type-assertion": "off",
1088
+ "@typescript-eslint/no-unnecessary-type-conversion": "off",
1089
+ "@typescript-eslint/no-unnecessary-type-parameters": "off",
1090
+ "@typescript-eslint/no-unsafe-argument": "off",
1091
+ "@typescript-eslint/no-unsafe-assignment": "off",
1092
+ "@typescript-eslint/no-unsafe-call": "off",
1093
+ "@typescript-eslint/no-unsafe-enum-comparison": "off",
1094
+ "@typescript-eslint/no-unsafe-member-access": "off",
1095
+ "@typescript-eslint/no-unsafe-return": "off",
1096
+ "@typescript-eslint/no-unsafe-type-assertion": "off",
1097
+ "@typescript-eslint/no-unsafe-unary-minus": "off",
1098
+ "@typescript-eslint/no-useless-default-assignment": "off",
1099
+ "@typescript-eslint/non-nullable-type-assertion-style": "off",
1100
+ "@typescript-eslint/only-throw-error": "off",
1101
+ "@typescript-eslint/prefer-find": "off",
1102
+ "@typescript-eslint/prefer-includes": "off",
1103
+ "@typescript-eslint/prefer-nullish-coalescing": "off",
1104
+ "@typescript-eslint/prefer-optional-chain": "off",
1105
+ "@typescript-eslint/prefer-promise-reject-errors": "off",
1106
+ "@typescript-eslint/prefer-readonly": "off",
1107
+ "@typescript-eslint/prefer-reduce-type-parameter": "off",
1108
+ "@typescript-eslint/prefer-regexp-exec": "off",
1109
+ "@typescript-eslint/prefer-return-this-type": "off",
1110
+ "@typescript-eslint/prefer-string-starts-ends-with": "off",
1111
+ "@typescript-eslint/promise-function-async": "off",
1112
+ "@typescript-eslint/related-getter-setter-pairs": "off",
1113
+ "@typescript-eslint/require-array-sort-compare": "off",
1114
+ "@typescript-eslint/require-await": "off",
1115
+ "@typescript-eslint/restrict-plus-operands": "off",
1116
+ "@typescript-eslint/restrict-template-expressions": "off",
1117
+ "@typescript-eslint/return-await": "off",
1118
+ "@typescript-eslint/strict-boolean-expressions": "off",
1119
+ "@typescript-eslint/strict-void-return": "off",
1120
+ "@typescript-eslint/switch-exhaustiveness-check": "off",
1121
+ "@typescript-eslint/unbound-method": "off",
1122
+ "@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
1123
+ "dot-notation": "off",
1124
+ "no-array-constructor": "off",
1125
+ "no-empty-function": "off",
1126
+ "no-implied-eval": "off",
1127
+ "no-return-await": "off",
1128
+ "no-shadow": "off",
1129
+ "no-throw-literal": "off",
1130
+ "no-useless-constructor": "off",
1131
+ "prefer-promise-reject-errors": "off",
1132
+ "require-await": "off",
1133
+ "strict": "off",
1134
+ "unicode-bom": "off"
1135
+ },
1020
1136
  ...mdxPlugin.flatCodeBlocks.rules,
1021
1137
  "eol-last": "off",
1022
1138
  "no-undef": "off",