@ethang/eslint-config 21.4.0 → 21.4.2

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 (62) hide show
  1. package/eslint.config.js +2 -26
  2. package/{dist/eslint.config.js.map → eslint.config.js.map} +1 -1
  3. package/package.json +1 -1
  4. package/build.ts +0 -34
  5. package/dist/eslint.config.js +0 -2
  6. package/dist/package.json +0 -68
  7. package/src/README.md +0 -100
  8. package/src/build/create-config-file.ts +0 -57
  9. package/src/build/create-config.ts +0 -96
  10. package/src/build/get-react-version.ts +0 -19
  11. package/src/build/list-utilities.ts +0 -124
  12. package/src/build/rule-list.ts +0 -284
  13. package/src/build/update-readme.ts +0 -195
  14. package/src/build/update-rules.ts +0 -124
  15. package/src/config.angular.js +0 -107
  16. package/src/config.astro.js +0 -68
  17. package/src/config.react.js +0 -117
  18. package/src/config.solid.js +0 -34
  19. package/src/constants.js +0 -16
  20. package/src/eslint.config.js +0 -1051
  21. package/src/setup/a11y.ts +0 -19
  22. package/src/setup/angular.ts +0 -40
  23. package/src/setup/astro.ts +0 -14
  24. package/src/setup/barrel.ts +0 -17
  25. package/src/setup/compat.ts +0 -13
  26. package/src/setup/cspell.ts +0 -83
  27. package/src/setup/css.ts +0 -12
  28. package/src/setup/depend.ts +0 -14
  29. package/src/setup/eslint.ts +0 -246
  30. package/src/setup/gen-rules.ts +0 -75
  31. package/src/setup/json.ts +0 -17
  32. package/src/setup/lodash.ts +0 -58
  33. package/src/setup/markdown.ts +0 -16
  34. package/src/setup/n.ts +0 -86
  35. package/src/setup/perfectionist.ts +0 -68
  36. package/src/setup/react.ts +0 -82
  37. package/src/setup/solid.ts +0 -21
  38. package/src/setup/sonar.ts +0 -39
  39. package/src/setup/tailwind.ts +0 -10
  40. package/src/setup/tanstack-query.ts +0 -9
  41. package/src/setup/tanstack-router.ts +0 -9
  42. package/src/setup/typescript-eslint.ts +0 -118
  43. package/src/setup/unicorn.ts +0 -38
  44. package/tsconfig.json +0 -5
  45. /package/{dist/README.md → README.md} +0 -0
  46. /package/{dist/chunk-WK3YS7OG.js → chunk-WK3YS7OG.js} +0 -0
  47. /package/{dist/chunk-WK3YS7OG.js.map → chunk-WK3YS7OG.js.map} +0 -0
  48. /package/{dist/config.angular.d.ts → config.angular.d.ts} +0 -0
  49. /package/{dist/config.angular.js → config.angular.js} +0 -0
  50. /package/{dist/config.angular.js.map → config.angular.js.map} +0 -0
  51. /package/{dist/config.astro.d.ts → config.astro.d.ts} +0 -0
  52. /package/{dist/config.astro.js → config.astro.js} +0 -0
  53. /package/{dist/config.astro.js.map → config.astro.js.map} +0 -0
  54. /package/{dist/config.react.d.ts → config.react.d.ts} +0 -0
  55. /package/{dist/config.react.js → config.react.js} +0 -0
  56. /package/{dist/config.react.js.map → config.react.js.map} +0 -0
  57. /package/{dist/config.solid.d.ts → config.solid.d.ts} +0 -0
  58. /package/{dist/config.solid.js → config.solid.js} +0 -0
  59. /package/{dist/config.solid.js.map → config.solid.js.map} +0 -0
  60. /package/{dist/constants.js → constants.js} +0 -0
  61. /package/{dist/constants.js.map → constants.js.map} +0 -0
  62. /package/{dist/eslint.config.d.ts → eslint.config.d.ts} +0 -0
package/src/setup/n.ts DELETED
@@ -1,86 +0,0 @@
1
- import n from "eslint-plugin-n";
2
- import keys from "lodash/keys.js";
3
-
4
- import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
5
-
6
- const ruleNames = keys(getNonDeprecatedRules(n.rules ?? {}));
7
- const changedRules = [
8
- {
9
- name: "callback-return",
10
- rule: "off",
11
- },
12
- {
13
- name: "exports-style",
14
- rule: ["error", "exports"],
15
- },
16
- {
17
- name: "file-extension-in-import",
18
- rule: "off",
19
- },
20
- {
21
- name: "global-require",
22
- rule: "off",
23
- },
24
- {
25
- name: "no-callback-literal",
26
- rule: "off",
27
- },
28
- {
29
- name: "no-missing-import",
30
- rule: "off",
31
- },
32
- {
33
- name: "no-mixed-requires",
34
- rule: "off",
35
- },
36
- {
37
- name: "no-new-require",
38
- rule: "off",
39
- },
40
- {
41
- name: "no-process-env",
42
- rule: "off",
43
- },
44
- {
45
- name: "no-process-exit",
46
- rule: "off",
47
- },
48
- {
49
- name: "no-restricted-import",
50
- rule: "off",
51
- },
52
- {
53
- name: "no-restricted-require",
54
- rule: "off",
55
- },
56
- {
57
- name: "no-sync",
58
- rule: "off",
59
- },
60
- {
61
- name: "no-unpublished-import",
62
- rule: "off",
63
- },
64
- {
65
- name: "no-unpublished-require",
66
- rule: "off",
67
- },
68
- {
69
- name: "prefer-promises/dns",
70
- rule: "off",
71
- },
72
- {
73
- name: "prefer-promises/fs",
74
- rule: "off",
75
- },
76
- {
77
- name: "process-exit-as-throw",
78
- rule: "off",
79
- },
80
- {
81
- name: "hashbang",
82
- rule: "off",
83
- },
84
- ];
85
-
86
- export const nRules = genRules(ruleNames, changedRules, "n");
@@ -1,68 +0,0 @@
1
- import perfectionist from "eslint-plugin-perfectionist";
2
- import keys from "lodash/keys.js";
3
-
4
- import {
5
- type EsLintRules,
6
- genRules,
7
- getNonDeprecatedRules,
8
- } from "./gen-rules.ts";
9
-
10
- const ruleNames = keys(
11
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
12
- getNonDeprecatedRules(perfectionist.rules as unknown as EsLintRules),
13
- );
14
- const customRules = [
15
- {
16
- name: "sort-imports",
17
- rule: [
18
- "error",
19
- {
20
- groups: [
21
- "type",
22
- ["builtin", "external"],
23
- "internal-type",
24
- "internal",
25
- ["parent-type", "sibling-type", "index-type"],
26
- ["parent", "sibling", "index"],
27
- "object",
28
- "unknown",
29
- ],
30
- newlinesBetween: "always",
31
- },
32
- ],
33
- },
34
- {
35
- name: "sort-jsx-props",
36
- rule: ["error", { groups: ["shorthand", "multiline"] }],
37
- },
38
- {
39
- name: "sort-objects",
40
- rule: ["error", { partitionByComment: true }],
41
- },
42
- {
43
- name: "sort-switch-case",
44
- rule: [
45
- "error",
46
- {
47
- order: "asc",
48
- type: "alphabetical",
49
- },
50
- ],
51
- },
52
- {
53
- name: "sort-variable-declarations",
54
- rule: [
55
- "error",
56
- {
57
- order: "asc",
58
- type: "alphabetical",
59
- },
60
- ],
61
- },
62
- ];
63
-
64
- export const perfectionistRules = genRules(
65
- ruleNames,
66
- customRules,
67
- "perfectionist",
68
- );
@@ -1,82 +0,0 @@
1
- import react from "@eslint-react/eslint-plugin";
2
- // @ts-expect-error no types
3
- import compiler from "eslint-plugin-react-compiler";
4
- // @ts-expect-error no types
5
- import reactHooks from "eslint-plugin-react-hooks";
6
- import keys from "lodash/keys.js";
7
-
8
- import {
9
- type EsLintRules,
10
- genRules,
11
- getNonDeprecatedRules,
12
- } from "./gen-rules.ts";
13
-
14
- const reactRuleNames = keys(
15
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
16
- getNonDeprecatedRules(react.rules as unknown as EsLintRules),
17
- );
18
- const customReactRules = [
19
- {
20
- name: "avoid-shorthand-boolean",
21
- rule: "off",
22
- },
23
- {
24
- name: "avoid-shorthand-fragment",
25
- rule: "off",
26
- },
27
- {
28
- name: "debug/class-component",
29
- rule: "off",
30
- },
31
- {
32
- name: "debug/function-component",
33
- rule: "off",
34
- },
35
- {
36
- name: "debug/hook",
37
- rule: "off",
38
- },
39
- {
40
- name: "debug/is-from-react",
41
- rule: "off",
42
- },
43
- {
44
- name: "debug/react-hooks",
45
- rule: "off",
46
- },
47
- {
48
- name: "naming-convention/filename",
49
- rule: ["error", { rule: "kebab-case" }],
50
- },
51
- ];
52
- const reactGen = genRules(reactRuleNames, customReactRules, "react");
53
-
54
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion,@typescript-eslint/no-unsafe-member-access
55
- const reactHookRuleNames = keys(reactHooks.rules as unknown as EsLintRules);
56
- const customHookRules = [
57
- {
58
- name: "exhaustive-deps",
59
- rule: "error",
60
- },
61
- {
62
- name: "rules-of-hooks",
63
- rule: "error",
64
- },
65
- ];
66
- const hookGen = genRules(reactHookRuleNames, customHookRules, "react-hooks");
67
-
68
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
69
- const reactCompilerRuleNames = keys(compiler.rules);
70
- const compilerGen = genRules(reactCompilerRuleNames, [], "react-compiler");
71
-
72
- export const reactRules = {
73
- ...reactGen,
74
- };
75
-
76
- export const reactHookRules = {
77
- ...hookGen,
78
- };
79
-
80
- export const reactCompilerRules = {
81
- ...compilerGen,
82
- };
@@ -1,21 +0,0 @@
1
- import solid from "eslint-plugin-solid";
2
- import keys from "lodash/keys.js";
3
-
4
- import {
5
- type EsLintRules,
6
- genRules,
7
- getNonDeprecatedRules,
8
- } from "./gen-rules.ts";
9
-
10
- const ruleNames = keys(
11
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
12
- getNonDeprecatedRules(solid.rules as unknown as EsLintRules),
13
- );
14
- const customRules = [
15
- {
16
- name: "no-proxy-apis",
17
- rule: "off",
18
- },
19
- ];
20
-
21
- export const solidRules = genRules(ruleNames, customRules, "solid");
@@ -1,39 +0,0 @@
1
- import sonar from "eslint-plugin-sonarjs";
2
- import keys from "lodash/keys.js";
3
-
4
- import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
5
-
6
- const ruleNames = keys(getNonDeprecatedRules(sonar.rules));
7
- const customRules = [
8
- { name: "arrow-function-convention", rule: "off" },
9
- { name: "comment-regex", rule: "off" },
10
- { name: "cyclomatic-complexity", rule: "off" },
11
- { name: "file-header", rule: "off" },
12
- {
13
- name: "function-name",
14
- rule: [
15
- "error",
16
- {
17
- format: "^(?:[a-z][a-zA-Z0-9]*|[A-Z][A-Z0-9]*)$",
18
- },
19
- ],
20
- },
21
- { name: "function-return-type", rule: "off" },
22
- { name: "max-union-size", rule: "off" },
23
- { name: "no-implicit-dependencies", rule: "off" },
24
- { name: "no-inconsistent-returns", rule: "off" },
25
- { name: "no-undefined-assignment", rule: "off" },
26
- { name: "shorthand-property-grouping", rule: "off" }, // Conflicts with perfectionist sorting
27
- { name: "todo-tag", rule: "off" },
28
- ];
29
-
30
- const rules = genRules(ruleNames, customRules, "sonar");
31
-
32
- // Turn off duplicate S# rules
33
- for (const key of keys(rules)) {
34
- if (/^sonar\/S\d+/u.test(key)) {
35
- rules[key] = "off";
36
- }
37
- }
38
-
39
- export const sonarRules = rules;
@@ -1,10 +0,0 @@
1
- import tailwind from "eslint-plugin-tailwindcss";
2
- import keys from "lodash/keys.js";
3
-
4
- import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
5
-
6
- // @ts-expect-error ignore
7
- const ruleNames = keys(getNonDeprecatedRules(tailwind.rules ?? {}));
8
- const customRules = [{ name: "no-custom-classname", rule: "off" }];
9
-
10
- export const tailwindRules = genRules(ruleNames, customRules, "tailwind");
@@ -1,9 +0,0 @@
1
- import tanstack from "@tanstack/eslint-plugin-query";
2
- import keys from "lodash/keys.js";
3
-
4
- import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
5
-
6
- // @ts-expect-error it's fine
7
- const ruleNames = keys(getNonDeprecatedRules(tanstack.rules));
8
-
9
- export const tanstackQueryRules = genRules(ruleNames, [], "@tanstack/query");
@@ -1,9 +0,0 @@
1
- import tanstack from "@tanstack/eslint-plugin-router";
2
- import keys from "lodash/keys.js";
3
-
4
- import { genRules, getNonDeprecatedRules } from "./gen-rules.js";
5
-
6
- // @ts-expect-error it's fine
7
- const ruleNames = keys(getNonDeprecatedRules(tanstack.rules));
8
-
9
- export const tanstackRouterRules = genRules(ruleNames, [], "@tanstack/router");
@@ -1,118 +0,0 @@
1
- import keys from "lodash/keys.js";
2
- import tseslint from "typescript-eslint";
3
-
4
- import {
5
- type EsLintRules,
6
- genRules,
7
- getNonDeprecatedRules,
8
- } from "./gen-rules.ts";
9
-
10
- const ruleNames = keys(
11
- getNonDeprecatedRules(
12
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
13
- (tseslint.plugin.rules ?? {}) as unknown as EsLintRules,
14
- ),
15
- );
16
- const customRules = [
17
- {
18
- name: "adjacent-overload-signatures",
19
- rule: "off",
20
- },
21
- {
22
- name: "class-methods-use-this",
23
- rule: "off",
24
- },
25
- {
26
- name: "consistent-return",
27
- rule: "off",
28
- },
29
- {
30
- name: "consistent-type-definitions",
31
- rule: ["error", "type"],
32
- },
33
- {
34
- name: "consistent-type-imports",
35
- rule: ["error", { fixStyle: "inline-type-imports" }],
36
- },
37
- {
38
- name: "explicit-function-return-type",
39
- rule: "off",
40
- },
41
- {
42
- name: "explicit-module-boundary-types",
43
- rule: "off",
44
- },
45
- {
46
- name: "init-declarations",
47
- rule: "off",
48
- },
49
- {
50
- name: "member-ordering",
51
- rule: "off",
52
- },
53
- {
54
- name: "naming-convention",
55
- rule: "off",
56
- },
57
- {
58
- name: "no-dupe-class-members",
59
- rule: "off",
60
- },
61
- {
62
- name: "no-invalid-this",
63
- rule: "off",
64
- },
65
- {
66
- name: "no-magic-numbers",
67
- rule: "off",
68
- },
69
- {
70
- name: "no-redeclare",
71
- rule: "off",
72
- },
73
- {
74
- name: "no-unnecessary-type-parameters",
75
- rule: "off",
76
- },
77
- {
78
- name: "no-use-before-define",
79
- rule: "off",
80
- },
81
- {
82
- name: "parameter-properties",
83
- rule: "off",
84
- },
85
- {
86
- name: "prefer-readonly-parameter-types",
87
- rule: "off",
88
- },
89
- {
90
- name: "typedef",
91
- rule: "off",
92
- },
93
- {
94
- name: "max-params",
95
- rule: "off",
96
- },
97
- {
98
- name: "no-unused-vars",
99
- rule: [
100
- "error",
101
- {
102
- args: "all",
103
- argsIgnorePattern: "^_",
104
- caughtErrors: "all",
105
- caughtErrorsIgnorePattern: "^_",
106
- destructuredArrayIgnorePattern: "^_",
107
- ignoreRestSiblings: true,
108
- varsIgnorePattern: "^_",
109
- },
110
- ],
111
- },
112
- ];
113
-
114
- export const typescriptRules = genRules(
115
- ruleNames,
116
- customRules,
117
- "@typescript-eslint",
118
- );
@@ -1,38 +0,0 @@
1
- import unicorn from "eslint-plugin-unicorn";
2
- import keys from "lodash/keys.js";
3
-
4
- import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
5
-
6
- const ruleNames = keys(getNonDeprecatedRules(unicorn.rules ?? {}));
7
- const customRules = [
8
- {
9
- name: "empty-brace-spaces",
10
- rule: "off",
11
- },
12
- {
13
- name: "explicit-length-check",
14
- rule: "off",
15
- },
16
- {
17
- name: "no-keyword-prefix",
18
- rule: "off",
19
- },
20
- {
21
- name: "no-nested-ternary",
22
- rule: "off",
23
- },
24
- {
25
- name: "no-null",
26
- rule: "off",
27
- },
28
- {
29
- name: "number-literal-case",
30
- rule: "off",
31
- },
32
- {
33
- name: "template-indent",
34
- rule: "off",
35
- },
36
- ];
37
-
38
- export const unicornRules = genRules(ruleNames, customRules, "unicorn");
package/tsconfig.json DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "extends": [
3
- "../tsconfig/tsconfig.base.json"
4
- ]
5
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes