@ethang/eslint-config 19.4.5 → 19.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.
Files changed (52) hide show
  1. package/README.md +3 -2
  2. package/build/create-config-file.ts +51 -0
  3. package/build/{create-config.js → create-config.ts} +13 -3
  4. package/build/{get-react-version.js → get-react-version.ts} +1 -1
  5. package/build/{list-utils.mjs → list-utils.ts} +21 -26
  6. package/build/{rule-list.mjs → rule-list.ts} +97 -87
  7. package/build/{update-readme.js → update-readme.ts} +29 -13
  8. package/build/{update-rules.js → update-rules.ts} +29 -20
  9. package/build.mjs +2 -2
  10. package/config.solid.js +0 -1
  11. package/eslint.config.js +5 -49
  12. package/package.json +9 -3
  13. package/setup/a11y.ts +13 -0
  14. package/setup/astro.ts +13 -0
  15. package/setup/barrel.ts +13 -0
  16. package/setup/compat.ts +12 -0
  17. package/setup/cspell.ts +8 -0
  18. package/setup/depend.ts +13 -0
  19. package/setup/{deprecated.js → deprecated.ts} +2 -2
  20. package/setup/eslint.ts +233 -0
  21. package/setup/{ethang.js → ethang.ts} +2 -1
  22. package/setup/gen-rules.ts +60 -0
  23. package/setup/json.ts +15 -0
  24. package/setup/lodash.ts +50 -0
  25. package/setup/markdown.ts +12 -0
  26. package/setup/n.ts +85 -0
  27. package/setup/{perfectionist.js → perfectionist.ts} +4 -2
  28. package/setup/react.ts +63 -0
  29. package/setup/solid.ts +15 -0
  30. package/setup/{sonar.js → sonar.ts} +4 -20
  31. package/setup/{stylistic.js → stylistic.ts} +3 -3
  32. package/setup/{tailwind.js → tailwind.ts} +2 -2
  33. package/setup/tanstack-query.ts +7 -0
  34. package/setup/{typescript-eslint.js → typescript-eslint.ts} +6 -26
  35. package/setup/unicorn.ts +37 -0
  36. package/tsconfig.json +5 -1
  37. package/build/create-config-file.js +0 -45
  38. package/setup/a11y.js +0 -25
  39. package/setup/astro.js +0 -7
  40. package/setup/barrel.js +0 -9
  41. package/setup/compat.js +0 -10
  42. package/setup/depend.js +0 -11
  43. package/setup/eslint.js +0 -71
  44. package/setup/gen-rules.js +0 -39
  45. package/setup/json.js +0 -7
  46. package/setup/lodash.js +0 -19
  47. package/setup/markdown.js +0 -7
  48. package/setup/n.js +0 -31
  49. package/setup/react.js +0 -35
  50. package/setup/solid.js +0 -10
  51. package/setup/tanstack-query.js +0 -7
  52. package/setup/unicorn.js +0 -32
@@ -1,15 +1,24 @@
1
- import { createConfigFile } from "./create-config-file.js";
1
+ import type { ConfigOptions } from "./create-config.ts";
2
+
3
+ import { createConfigFile } from "./create-config-file.ts";
4
+
5
+ export type ConfigFile = {
6
+ importString?: string;
7
+ label?: string;
8
+ name: string;
9
+ options?: ConfigOptions;
10
+ };
2
11
 
3
12
  export const coreFile = [
4
13
  {
5
- name: "core",
6
- label: "Core",
7
14
  importString: 'import config from "@ethang/eslint-config/eslint.config.js',
15
+ label: "Core",
16
+ name: "core",
8
17
  options: {
9
- includeReactVersion: true,
10
- includeLanguageOptions: true,
11
- includeIgnores: true,
12
18
  extraImports: ['import { fixupPluginRules } from "@eslint/compat";'], // TODO remove with v9 compat
19
+ includeIgnores: true,
20
+ includeLanguageOptions: true,
21
+ includeReactVersion: true,
13
22
  },
14
23
  },
15
24
  {
@@ -22,46 +31,46 @@ export const coreFile = [
22
31
 
23
32
  const astroFile = [
24
33
  {
25
- name: "astro",
26
- label: "Astro",
27
34
  importString:
28
- 'import astroConfig from "@ethang/eslint-config/config.astro.js',
35
+ 'import astroConfig from "@ethang/eslint-config/config.astro.ts',
36
+ label: "Astro",
37
+ name: "astro",
29
38
  options: {
39
+ extraImports: ['import tseslint from "typescript-eslint";'],
30
40
  includeIgnores: true,
31
41
  includeLanguageOptions: true,
32
- extraImports: ['import tseslint from "typescript-eslint";'],
33
42
  },
34
43
  },
35
44
  ];
36
45
 
37
46
  const reactFile = [
38
47
  {
39
- name: "react",
40
- label: "React",
41
48
  importString:
42
- 'import reactConfig from "@ethang/eslint-config/config.react.js',
49
+ 'import reactConfig from "@ethang/eslint-config/config.react.ts',
50
+ label: "React",
51
+ name: "react",
43
52
  options: {
44
- includeReactVersion: true,
45
- includeIgnores: true,
46
- includeLanguageOptions: true,
47
53
  extraImports: [
48
54
  'import tseslint from "typescript-eslint";',
49
55
  'import { fixupPluginRules } from "@eslint/compat";', // TODO remove with v9 compat
50
56
  ],
57
+ includeIgnores: true,
58
+ includeLanguageOptions: true,
59
+ includeReactVersion: true,
51
60
  },
52
61
  },
53
62
  ];
54
63
 
55
64
  const solidFile = [
56
65
  {
57
- name: "solid",
58
- label: "Solid",
59
66
  importString:
60
- 'import reactConfig from "@ethang/eslint-config/config.solid.js',
67
+ 'import reactConfig from "@ethang/eslint-config/config.solid.ts',
68
+ label: "Solid",
69
+ name: "solid",
61
70
  options: {
71
+ extraImports: ['import tseslint from "typescript-eslint";'],
62
72
  includeIgnores: true,
63
73
  includeLanguageOptions: true,
64
- extraImports: ['import tseslint from "typescript-eslint";'],
65
74
  },
66
75
  },
67
76
  ];
package/build.mjs CHANGED
@@ -7,8 +7,8 @@ await projectBuilder("eslint-config-ethang", "master", {
7
7
  scripts: ["UPDATE", "DEDUPE", "LINT"],
8
8
  postInstall: async () => {
9
9
  console.log("Updating Rules...");
10
- execSync(`pnpx tsx ./build/update-rules.js`, { stdio: "inherit" });
11
- execSync(`pnpx tsx ./build/update-readme.js`, { stdio: "inherit" });
10
+ execSync(`pnpx tsx ./build/update-rules.ts`, { stdio: "inherit" });
11
+ execSync(`pnpx tsx ./build/update-readme.ts`, { stdio: "inherit" });
12
12
  },
13
13
  tsupOptions: {
14
14
  bundle: true,
package/config.solid.js CHANGED
@@ -24,7 +24,6 @@ export default tseslint.config({
24
24
  "solid/no-react-deps": "error",
25
25
  "solid/no-react-specific-props": "error",
26
26
  "solid/no-unknown-namespaces": "error",
27
- "solid/prefer-classlist": "off",
28
27
  "solid/prefer-for": "error",
29
28
  "solid/prefer-show": "error",
30
29
  "solid/reactivity": "error",
package/eslint.config.js CHANGED
@@ -3,6 +3,7 @@ import { ignores, languageOptions } from "./constants.js";
3
3
  import a11y from "eslint-plugin-jsx-a11y/lib/index.js";
4
4
  import barrel from "eslint-plugin-barrel-files";
5
5
  import compat from "eslint-plugin-compat";
6
+ import cspell from "@cspell/eslint-plugin";
6
7
  import depend from "eslint-plugin-depend";
7
8
  import ethang from "@ethang/eslint-plugin";
8
9
  import json from "@eslint/json";
@@ -27,6 +28,7 @@ export default tseslint.config(
27
28
  },
28
29
  plugins: {
29
30
  depend: depend,
31
+ cspell: cspell,
30
32
  barrel: barrel,
31
33
  compat: compat,
32
34
  n: n,
@@ -43,6 +45,7 @@ export default tseslint.config(
43
45
  },
44
46
  rules: {
45
47
  "depend/ban-dependencies": ["error", { allowed: ["lodash"] }],
48
+ "cspell/spellchecker": "error",
46
49
  "barrel/avoid-barrel-files": "error",
47
50
  "barrel/avoid-importing-barrel-files": "error",
48
51
  "barrel/avoid-namespace-import": "error",
@@ -259,7 +262,6 @@ export default tseslint.config(
259
262
  "n/no-exports-assign": "error",
260
263
  "n/no-extraneous-import": "error",
261
264
  "n/no-extraneous-require": "error",
262
- "n/no-hide-core-modules": "off",
263
265
  "n/no-missing-import": "off",
264
266
  "n/no-missing-require": "error",
265
267
  "n/no-mixed-requires": "off",
@@ -287,7 +289,6 @@ export default tseslint.config(
287
289
  "n/prefer-promises/dns": "off",
288
290
  "n/prefer-promises/fs": "off",
289
291
  "n/process-exit-as-throw": "off",
290
- "n/shebang": "off",
291
292
  "@typescript-eslint/adjacent-overload-signatures": "off",
292
293
  "@typescript-eslint/array-type": "error",
293
294
  "@typescript-eslint/await-thenable": "error",
@@ -326,7 +327,6 @@ export default tseslint.config(
326
327
  "@typescript-eslint/no-duplicate-type-constituents": "error",
327
328
  "@typescript-eslint/no-dynamic-delete": "error",
328
329
  "@typescript-eslint/no-empty-function": "error",
329
- "@typescript-eslint/no-empty-interface": "off",
330
330
  "@typescript-eslint/no-empty-object-type": "error",
331
331
  "@typescript-eslint/no-explicit-any": "error",
332
332
  "@typescript-eslint/no-extra-non-null-assertion": "error",
@@ -339,7 +339,6 @@ export default tseslint.config(
339
339
  "@typescript-eslint/no-invalid-this": "off",
340
340
  "@typescript-eslint/no-invalid-void-type": "error",
341
341
  "@typescript-eslint/no-loop-func": "error",
342
- "@typescript-eslint/no-loss-of-precision": "off",
343
342
  "@typescript-eslint/no-magic-numbers": "off",
344
343
  "@typescript-eslint/no-meaningless-void-operator": "error",
345
344
  "@typescript-eslint/no-misused-new": "error",
@@ -356,7 +355,6 @@ export default tseslint.config(
356
355
  "@typescript-eslint/no-restricted-types": "error",
357
356
  "@typescript-eslint/no-shadow": "error",
358
357
  "@typescript-eslint/no-this-alias": "error",
359
- "@typescript-eslint/no-type-alias": "off",
360
358
  "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
361
359
  "@typescript-eslint/no-unnecessary-condition": "error",
362
360
  "@typescript-eslint/no-unnecessary-parameter-property-assignment":
@@ -392,7 +390,6 @@ export default tseslint.config(
392
390
  "@typescript-eslint/no-use-before-define": "off",
393
391
  "@typescript-eslint/no-useless-constructor": "error",
394
392
  "@typescript-eslint/no-useless-empty-export": "error",
395
- "@typescript-eslint/no-var-requires": "off",
396
393
  "@typescript-eslint/no-wrapper-object-types": "error",
397
394
  "@typescript-eslint/non-nullable-type-assertion-style": "error",
398
395
  "@typescript-eslint/only-throw-error": "error",
@@ -415,14 +412,12 @@ export default tseslint.config(
415
412
  "@typescript-eslint/prefer-regexp-exec": "error",
416
413
  "@typescript-eslint/prefer-return-this-type": "error",
417
414
  "@typescript-eslint/prefer-string-starts-ends-with": "error",
418
- "@typescript-eslint/prefer-ts-expect-error": "off",
419
415
  "@typescript-eslint/promise-function-async": "error",
420
416
  "@typescript-eslint/require-array-sort-compare": "error",
421
417
  "@typescript-eslint/require-await": "error",
422
418
  "@typescript-eslint/restrict-plus-operands": "error",
423
419
  "@typescript-eslint/restrict-template-expressions": "error",
424
420
  "@typescript-eslint/return-await": "error",
425
- "@typescript-eslint/sort-type-constituents": "off",
426
421
  "@typescript-eslint/strict-boolean-expressions": "error",
427
422
  "@typescript-eslint/switch-exhaustiveness-check": "error",
428
423
  "@typescript-eslint/triple-slash-reference": "error",
@@ -442,14 +437,12 @@ export default tseslint.config(
442
437
  "unicorn/expiring-todo-comments": "error",
443
438
  "unicorn/explicit-length-check": "off",
444
439
  "unicorn/filename-case": "error",
445
- "unicorn/import-index": "off",
446
440
  "unicorn/import-style": "error",
447
441
  "unicorn/new-for-builtins": "error",
448
442
  "unicorn/no-abusive-eslint-disable": "error",
449
443
  "unicorn/no-anonymous-default-export": "error",
450
444
  "unicorn/no-array-callback-reference": "error",
451
445
  "unicorn/no-array-for-each": "error",
452
- "unicorn/no-array-instanceof": "off",
453
446
  "unicorn/no-array-method-this-argument": "error",
454
447
  "unicorn/no-array-push-push": "error",
455
448
  "unicorn/no-array-reduce": "error",
@@ -458,7 +451,6 @@ export default tseslint.config(
458
451
  "unicorn/no-console-spaces": "error",
459
452
  "unicorn/no-document-cookie": "error",
460
453
  "unicorn/no-empty-file": "error",
461
- "unicorn/no-fn-reference-in-iterator": "off",
462
454
  "unicorn/no-for-loop": "error",
463
455
  "unicorn/no-hex-escape": "error",
464
456
  "unicorn/no-instanceof-array": "error",
@@ -476,7 +468,6 @@ export default tseslint.config(
476
468
  "unicorn/no-null": "off",
477
469
  "unicorn/no-object-as-default-parameter": "error",
478
470
  "unicorn/no-process-exit": "error",
479
- "unicorn/no-reduce": "off",
480
471
  "unicorn/no-single-promise-in-promise-methods": "error",
481
472
  "unicorn/no-static-only-class": "error",
482
473
  "unicorn/no-thenable": "error",
@@ -486,7 +477,6 @@ export default tseslint.config(
486
477
  "unicorn/no-unnecessary-polyfills": "error",
487
478
  "unicorn/no-unreadable-array-destructuring": "error",
488
479
  "unicorn/no-unreadable-iife": "error",
489
- "unicorn/no-unsafe-regex": "off",
490
480
  "unicorn/no-unused-properties": "error",
491
481
  "unicorn/no-useless-fallback-in-spread": "error",
492
482
  "unicorn/no-useless-length-check": "error",
@@ -506,18 +496,14 @@ export default tseslint.config(
506
496
  "unicorn/prefer-at": "error",
507
497
  "unicorn/prefer-blob-reading-methods": "error",
508
498
  "unicorn/prefer-code-point": "error",
509
- "unicorn/prefer-dataset": "off",
510
499
  "unicorn/prefer-date-now": "error",
511
500
  "unicorn/prefer-default-parameters": "error",
512
501
  "unicorn/prefer-dom-node-append": "error",
513
502
  "unicorn/prefer-dom-node-dataset": "error",
514
503
  "unicorn/prefer-dom-node-remove": "error",
515
504
  "unicorn/prefer-dom-node-text-content": "error",
516
- "unicorn/prefer-event-key": "off",
517
505
  "unicorn/prefer-event-target": "error",
518
- "unicorn/prefer-exponentiation-operator": "off",
519
506
  "unicorn/prefer-export-from": "error",
520
- "unicorn/prefer-flat-map": "off",
521
507
  "unicorn/prefer-includes": "error",
522
508
  "unicorn/prefer-json-parse-buffer": "error",
523
509
  "unicorn/prefer-keyboard-event-key": "error",
@@ -528,22 +514,17 @@ export default tseslint.config(
528
514
  "unicorn/prefer-module": "error",
529
515
  "unicorn/prefer-native-coercion-functions": "error",
530
516
  "unicorn/prefer-negative-index": "error",
531
- "unicorn/prefer-node-append": "off",
532
517
  "unicorn/prefer-node-protocol": "error",
533
- "unicorn/prefer-node-remove": "off",
534
518
  "unicorn/prefer-number-properties": "error",
535
519
  "unicorn/prefer-object-from-entries": "error",
536
- "unicorn/prefer-object-has-own": "off",
537
520
  "unicorn/prefer-optional-catch-binding": "error",
538
521
  "unicorn/prefer-prototype-methods": "error",
539
522
  "unicorn/prefer-query-selector": "error",
540
523
  "unicorn/prefer-reflect-apply": "error",
541
524
  "unicorn/prefer-regexp-test": "error",
542
- "unicorn/prefer-replace-all": "off",
543
525
  "unicorn/prefer-set-has": "error",
544
526
  "unicorn/prefer-set-size": "error",
545
527
  "unicorn/prefer-spread": "error",
546
- "unicorn/prefer-starts-ends-with": "off",
547
528
  "unicorn/prefer-string-raw": "error",
548
529
  "unicorn/prefer-string-replace-all": "error",
549
530
  "unicorn/prefer-string-slice": "error",
@@ -552,12 +533,9 @@ export default tseslint.config(
552
533
  "unicorn/prefer-structured-clone": "error",
553
534
  "unicorn/prefer-switch": "error",
554
535
  "unicorn/prefer-ternary": "error",
555
- "unicorn/prefer-text-content": "off",
556
536
  "unicorn/prefer-top-level-await": "error",
557
- "unicorn/prefer-trim-start-end": "off",
558
537
  "unicorn/prefer-type-error": "error",
559
538
  "unicorn/prevent-abbreviations": "error",
560
- "unicorn/regex-shorthand": "off",
561
539
  "unicorn/relative-url-style": "error",
562
540
  "unicorn/require-array-join-separator": "error",
563
541
  "unicorn/require-number-to-fixed-digits-argument": "error",
@@ -635,14 +613,12 @@ export default tseslint.config(
635
613
  "sonar/aws-s3-bucket-granted-access": "error",
636
614
  "sonar/aws-s3-bucket-insecure-http": "error",
637
615
  "sonar/aws-s3-bucket-public-access": "error",
638
- "sonar/aws-s3-bucket-server-encryption": "off",
639
616
  "sonar/aws-s3-bucket-versioning": "error",
640
617
  "sonar/aws-sagemaker-unencrypted-notebook": "error",
641
618
  "sonar/aws-sns-unencrypted-topics": "error",
642
619
  "sonar/aws-sqs-unencrypted-queue": "error",
643
620
  "sonar/bitwise-operators": "error",
644
621
  "sonar/bool-param-default": "error",
645
- "sonar/brace-style": "off",
646
622
  "sonar/call-argument-line": "error",
647
623
  "sonar/certificate-transparency": "error",
648
624
  "sonar/chai-determinate-assertion": "error",
@@ -653,13 +629,11 @@ export default tseslint.config(
653
629
  "sonar/comma-or-logical-or-case": "error",
654
630
  "sonar/comment-regex": "off",
655
631
  "sonar/concise-regex": "error",
656
- "sonar/conditional-indentation": "off",
657
632
  "sonar/confidential-information-logging": "error",
658
633
  "sonar/constructor-for-side-effects": "error",
659
634
  "sonar/content-length": "error",
660
635
  "sonar/content-security-policy": "error",
661
636
  "sonar/cookie-no-httponly": "error",
662
- "sonar/cookies": "off",
663
637
  "sonar/cors": "error",
664
638
  "sonar/csrf": "error",
665
639
  "sonar/cyclomatic-complexity": "off",
@@ -671,13 +645,10 @@ export default tseslint.config(
671
645
  "sonar/disabled-auto-escaping": "error",
672
646
  "sonar/disabled-resource-integrity": "error",
673
647
  "sonar/disabled-timeout": "error",
674
- "sonar/dns-prefetching": "off",
675
648
  "sonar/duplicates-in-character-class": "error",
676
649
  "sonar/elseif-without-else": "error",
677
650
  "sonar/empty-string-repetition": "error",
678
- "sonar/encryption": "off",
679
651
  "sonar/encryption-secure-mode": "error",
680
- "sonar/enforce-trailing-comma": "off",
681
652
  "sonar/existing-groups": "error",
682
653
  "sonar/expression-complexity": "error",
683
654
  "sonar/file-header": "off",
@@ -753,7 +724,6 @@ export default tseslint.config(
753
724
  "sonar/no-exclusive-tests": "error",
754
725
  "sonar/no-extend-native": "error",
755
726
  "sonar/no-extra-arguments": "error",
756
- "sonar/no-extra-semi": "off",
757
727
  "sonar/no-find-dom-node": "error",
758
728
  "sonar/no-for-in-iterable": "error",
759
729
  "sonar/no-function-declaration-in-block": "error",
@@ -802,9 +772,8 @@ export default tseslint.config(
802
772
  "sonar/no-redundant-boolean": "error",
803
773
  "sonar/no-redundant-jump": "error",
804
774
  "sonar/no-redundant-optional": "error",
805
- "sonar/no-redundant-parentheses": "off",
806
775
  "sonar/no-redundant-type-constituents": "error",
807
- "sonar/no-reference-error": "error",
776
+ "sonar/no-reference-error": "off",
808
777
  "sonar/no-referrer-policy": "error",
809
778
  "sonar/no-require-or-define": "error",
810
779
  "sonar/no-return-type-any": "error",
@@ -812,7 +781,6 @@ export default tseslint.config(
812
781
  "sonar/no-same-line-conditional": "error",
813
782
  "sonar/no-self-compare": "error",
814
783
  "sonar/no-small-switch": "error",
815
- "sonar/no-tab": "off",
816
784
  "sonar/no-table-as-layout": "error",
817
785
  "sonar/no-this-alias": "error",
818
786
  "sonar/no-throw-literal": "error",
@@ -869,7 +837,6 @@ export default tseslint.config(
869
837
  "sonar/prefer-template": "error",
870
838
  "sonar/prefer-type-guard": "error",
871
839
  "sonar/prefer-while": "error",
872
- "sonar/process-argv": "off",
873
840
  "sonar/production-debug": "error",
874
841
  "sonar/pseudo-random": "error",
875
842
  "sonar/public-static-readonly": "error",
@@ -877,14 +844,11 @@ export default tseslint.config(
877
844
  "sonar/reduce-initial-value": "error",
878
845
  "sonar/redundant-type-aliases": "error",
879
846
  "sonar/regex-complexity": "error",
880
- "sonar/regular-expr": "off",
881
- "sonar/semi": "off",
882
847
  "sonar/session-regeneration": "error",
883
848
  "sonar/shorthand-property-grouping": "off",
884
849
  "sonar/single-char-in-character-classes": "error",
885
850
  "sonar/single-character-alternation": "error",
886
851
  "sonar/slow-regex": "error",
887
- "sonar/sockets": "off",
888
852
  "sonar/sonar-block-scoped-var": "error",
889
853
  "sonar/sonar-jsx-no-leaked-render": "error",
890
854
  "sonar/sonar-max-lines": "error",
@@ -893,7 +857,7 @@ export default tseslint.config(
893
857
  "sonar/sonar-no-control-regex": "error",
894
858
  "sonar/sonar-no-dupe-keys": "error",
895
859
  "sonar/sonar-no-empty-character-class": "error",
896
- "sonar/sonar-no-fallthrough": "error",
860
+ "sonar/sonar-no-fallthrough": "off",
897
861
  "sonar/sonar-no-invalid-regexp": "error",
898
862
  "sonar/sonar-no-magic-numbers": "off",
899
863
  "sonar/sonar-no-misleading-character-class": "error",
@@ -905,7 +869,6 @@ export default tseslint.config(
905
869
  "sonar/sonar-prefer-regexp-exec": "error",
906
870
  "sonar/sql-queries": "error",
907
871
  "sonar/stable-tests": "error",
908
- "sonar/standard-input": "off",
909
872
  "sonar/stateful-regex": "error",
910
873
  "sonar/strict-transport-security": "error",
911
874
  "sonar/strings-comparison": "error",
@@ -926,15 +889,12 @@ export default tseslint.config(
926
889
  "sonar/updated-loop-counter": "error",
927
890
  "sonar/use-isnan": "error",
928
891
  "sonar/use-type-alias": "error",
929
- "sonar/useless-string-operation": "off",
930
892
  "sonar/values-not-convertible-to-numbers": "error",
931
893
  "sonar/variable-name": "error",
932
894
  "sonar/void-use": "error",
933
895
  "sonar/weak-ssl": "error",
934
- "sonar/web-sql-database": "off",
935
896
  "sonar/x-powered-by": "error",
936
897
  "sonar/xml-parser-xxe": "error",
937
- "sonar/xpath": "off",
938
898
  "ethang/handle-native-error": "error",
939
899
  "@tanstack/query/exhaustive-deps": "error",
940
900
  "@tanstack/query/no-rest-destructuring": "error",
@@ -978,7 +938,6 @@ export default tseslint.config(
978
938
  "stylistic/jsx-equals-spacing": "error",
979
939
  "stylistic/jsx-first-prop-new-line": "error",
980
940
  "stylistic/jsx-function-call-newline": "error",
981
- "stylistic/jsx-indent": "off",
982
941
  "stylistic/jsx-indent-props": ["error", 2],
983
942
  "stylistic/jsx-max-props-per-line": "error",
984
943
  "stylistic/jsx-newline": ["error", { prevent: true }],
@@ -1119,7 +1078,6 @@ export default tseslint.config(
1119
1078
  "error",
1120
1079
  { groups: ["shorthand", "multiline"] },
1121
1080
  ],
1122
- "a11y/accessible-emoji": "off",
1123
1081
  "a11y/alt-text": "error",
1124
1082
  "a11y/anchor-ambiguous-text": "error",
1125
1083
  "a11y/anchor-has-content": "error",
@@ -1138,7 +1096,6 @@ export default tseslint.config(
1138
1096
  "a11y/img-redundant-alt": "error",
1139
1097
  "a11y/interactive-supports-focus": "error",
1140
1098
  "a11y/label-has-associated-control": "error",
1141
- "a11y/label-has-for": "off",
1142
1099
  "a11y/lang": "error",
1143
1100
  "a11y/media-has-caption": "off",
1144
1101
  "a11y/mouse-events-have-key-events": "error",
@@ -1150,7 +1107,6 @@ export default tseslint.config(
1150
1107
  "a11y/no-noninteractive-element-interactions": "error",
1151
1108
  "a11y/no-noninteractive-element-to-interactive-role": "error",
1152
1109
  "a11y/no-noninteractive-tabindex": "error",
1153
- "a11y/no-onchange": "off",
1154
1110
  "a11y/no-redundant-roles": "error",
1155
1111
  "a11y/no-static-element-interactions": "error",
1156
1112
  "a11y/prefer-tag-over-role": "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethang/eslint-config",
3
- "version": "19.4.5",
3
+ "version": "19.5.0",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/eglove/eslint-config-ethang.git"
6
6
  },
@@ -13,12 +13,13 @@
13
13
  "lint": "prettier . -w"
14
14
  },
15
15
  "dependencies": {
16
+ "@cspell/eslint-plugin": "^8.14.2",
16
17
  "@eslint-react/eslint-plugin": "^1.14.0",
17
18
  "@eslint/compat": "^1.1.1",
18
19
  "@eslint/js": "^9.10.0",
19
20
  "@eslint/json": "^0.4.0",
20
21
  "@eslint/markdown": "^6.1.0",
21
- "@ethang/eslint-plugin": "^0.0.8",
22
+ "@ethang/eslint-plugin": "^0.0.9",
22
23
  "@stylistic/eslint-plugin": "^2.8.0",
23
24
  "@tanstack/eslint-plugin-query": "^5.53.0",
24
25
  "@typescript-eslint/parser": "^8.5.0",
@@ -44,15 +45,20 @@
44
45
  "@ethang/project-builder": "^2.5.10",
45
46
  "@tsconfig/node-lts": "^20.1.3",
46
47
  "@tsconfig/strictest": "^2.0.5",
48
+ "@types/eslint-plugin-jsx-a11y": "^6.9.0",
49
+ "@types/eslint-plugin-tailwindcss": "^3.17.0",
50
+ "@types/eslint__js": "^8.42.3",
51
+ "@types/node": "^22.5.4",
47
52
  "prettier": "^3.3.3"
48
53
  },
49
54
  "peerDependencies": {
55
+ "@cspell/eslint-plugin": "^8.14.2",
50
56
  "@eslint-react/eslint-plugin": "^1.14.0",
51
57
  "@eslint/compat": "^1.1.1",
52
58
  "@eslint/js": "^9.10.0",
53
59
  "@eslint/json": "^0.4.0",
54
60
  "@eslint/markdown": "^6.1.0",
55
- "@ethang/eslint-plugin": "^0.0.8",
61
+ "@ethang/eslint-plugin": "^0.0.9",
56
62
  "@stylistic/eslint-plugin": "^2.8.0",
57
63
  "@tanstack/eslint-plugin-query": "^5.53.0",
58
64
  "@typescript-eslint/parser": "^8.5.0",
package/setup/a11y.ts ADDED
@@ -0,0 +1,13 @@
1
+ import a11y from "eslint-plugin-jsx-a11y";
2
+
3
+ import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
4
+
5
+ const ruleNames = Object.keys(getNonDeprecatedRules(a11y.rules ?? {}));
6
+ const customRules = [
7
+ {
8
+ name: "media-has-caption",
9
+ rule: "off",
10
+ },
11
+ ];
12
+
13
+ export const a11yRules = genRules(ruleNames, customRules, "a11y");
package/setup/astro.ts ADDED
@@ -0,0 +1,13 @@
1
+ import astro from "eslint-plugin-astro";
2
+
3
+ import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
4
+
5
+ const ruleNames = Object.keys(getNonDeprecatedRules(astro.rules));
6
+ const customRules = [
7
+ {
8
+ name: "no-set-html-directive",
9
+ rule: 'off"',
10
+ },
11
+ ];
12
+
13
+ export const astroRules = genRules(ruleNames, customRules, "astro");
@@ -0,0 +1,13 @@
1
+ // @ts-expect-error no types
2
+ import barrel from "eslint-plugin-barrel-files";
3
+
4
+ import {
5
+ type CustomRules,
6
+ genRules,
7
+ getNonDeprecatedRules,
8
+ } from "./gen-rules.ts";
9
+
10
+ const ruleNames = Object.keys(getNonDeprecatedRules(barrel.rules));
11
+ const customRules: CustomRules = [];
12
+
13
+ export const barrelRules = genRules(ruleNames, customRules, "barrel");
@@ -0,0 +1,12 @@
1
+ import compat from "eslint-plugin-compat";
2
+
3
+ import {
4
+ type CustomRules,
5
+ genRules,
6
+ getNonDeprecatedRules,
7
+ } from "./gen-rules.ts";
8
+
9
+ const ruleNames = Object.keys(getNonDeprecatedRules(compat.rules));
10
+ const changedRules: CustomRules = [];
11
+
12
+ export const compatRules = genRules(ruleNames, changedRules, "compat");
@@ -0,0 +1,8 @@
1
+ import cspell from "@cspell/eslint-plugin";
2
+ import { CustomRules, genRules, getNonDeprecatedRules } from "./gen-rules.js";
3
+
4
+ const ruleNames = Object.keys(getNonDeprecatedRules(cspell.rules));
5
+
6
+ const customRules: CustomRules = [];
7
+
8
+ export const cspellRules = genRules(ruleNames, customRules, "cspell");
@@ -0,0 +1,13 @@
1
+ import depend from "eslint-plugin-depend";
2
+
3
+ import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
4
+
5
+ const ruleNames = Object.keys(getNonDeprecatedRules(depend.rules));
6
+ const changedRules = [
7
+ {
8
+ name: "ban-dependencies",
9
+ rule: ["error", { allowed: ["lodash"] }],
10
+ },
11
+ ];
12
+
13
+ export const dependRules = genRules(ruleNames, changedRules, "depend");
@@ -1,4 +1,4 @@
1
- import { genRules } from "./gen-rules.js";
1
+ import { type CustomRules, genRules } from "./gen-rules.ts";
2
2
 
3
3
  const ruleNames = [
4
4
  "array-bracket-newline",
@@ -95,7 +95,7 @@ const ruleNames = [
95
95
  "wrap-regex",
96
96
  "yield-star-spacing",
97
97
  ];
98
- const customRules = [];
98
+ const customRules: CustomRules = [];
99
99
 
100
100
  export const deprecatedRules = genRules(
101
101
  ruleNames,