@ethang/eslint-config 19.5.8 → 19.6.1

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.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  > [!CAUTION]
6
6
  > Do not use this with Prettier! Styling rules are included.
7
7
 
8
- - 887 errored rules.
8
+ - 888 errored rules.
9
9
  - 289 rules from [eslint-plugin-sonarjs](https://github.com/SonarSource/SonarJS/blob/master/packages/jsts/src/rules/README.md)
10
10
  - 145 rules from [@eslint/js](https://github.com/eslint/eslint/tree/main/packages/js)
11
11
  - 113 rules from [sindresorhus/eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
@@ -24,6 +24,7 @@
24
24
  - 1 rule from [@cspell/eslint-plugin](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell-eslint-plugin)
25
25
  - 1 rule from [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat)
26
26
  - 1 rule from [@ethang/eslint-plugin](https://github.com/eglove/eslint-plugin)
27
+ - 1 rule from [@tanstack/eslint-plugin-router](https://tanstack.com/router/latest/docs/eslint/eslint-plugin-router)
27
28
 
28
29
  # Add Even More!
29
30
 
@@ -54,17 +55,25 @@ import tseslint from "typescript-eslint";
54
55
  import astroConfig from "@ethang/eslint-config/config.astro.js"; // OPTIONAL
55
56
  import reactConfig from "@ethang/eslint-config/config.react.js"; // OPTIONAL
56
57
 
57
- export default tseslint.config(...config, ...astroConfig, ...reactConfig, {
58
- languageOptions: {
59
- parserOptions: {
60
- project: true,
61
- tsconfigRootDir: import.meta.dirname,
62
- },
58
+ export default tseslint.config(
59
+ {
60
+ ignores: [], // Ignored files apply to all following configs
63
61
  },
64
- rules: {
65
- // your custom rules here
62
+ ...config,
63
+ ...astroConfig,
64
+ ...reactConfig,
65
+ {
66
+ languageOptions: {
67
+ parserOptions: {
68
+ project: true,
69
+ tsconfigRootDir: import.meta.dirname,
70
+ },
71
+ },
72
+ rules: {
73
+ // Override rules from above configs
74
+ },
66
75
  },
67
- });
76
+ );
68
77
  ```
69
78
 
70
79
  **Scripts**
@@ -20,6 +20,7 @@ import { tanstackQueryRules } from "../setup/tanstack-query.ts";
20
20
  import { typescriptRules } from "../setup/typescript-eslint.ts";
21
21
  import { unicornRules } from "../setup/unicorn.ts";
22
22
  import { cspellRules } from "../setup/cspell.js";
23
+ import { tanstackRouterRules } from "../setup/tanstack-router.js";
23
24
 
24
25
  export const ruleList = [
25
26
  {
@@ -123,12 +124,12 @@ export const ruleList = [
123
124
  url: "https://github.com/eglove/eslint-plugin",
124
125
  },
125
126
  {
126
- importString: 'import tanstack from "@tanstack/eslint-plugin-query";',
127
+ importString: 'import tanstackQuery from "@tanstack/eslint-plugin-query";',
127
128
  list: tanstackQueryRules,
128
129
  name: "@tanstack/eslint-plugin-query",
129
130
  order: 10,
130
131
  pluginName: "@tanstack/query",
131
- pluginValue: "tanstack",
132
+ pluginValue: "tanstackQuery",
132
133
  type: "core",
133
134
  url: "https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query",
134
135
  },
@@ -162,11 +163,22 @@ export const ruleList = [
162
163
  type: "core",
163
164
  url: "https://github.com/azat-io/eslint-plugin-perfectionist",
164
165
  },
166
+ {
167
+ importString:
168
+ 'import tanstackRouter from "@tanstack/eslint-plugin-router";',
169
+ list: tanstackRouterRules,
170
+ name: "@tanstack/eslint-plugin-router",
171
+ order: 14,
172
+ pluginName: "@tanstack/router",
173
+ pluginValue: "tanstackRouter",
174
+ type: "core",
175
+ url: "https://tanstack.com/router/latest/docs/eslint/eslint-plugin-router",
176
+ },
165
177
  {
166
178
  importString: 'import a11y from "eslint-plugin-jsx-a11y/lib/index.js";',
167
179
  list: a11yRules,
168
180
  name: "jsx-a11y",
169
- order: 14,
181
+ order: 15,
170
182
  pluginName: "a11y",
171
183
  pluginValue: "a11y",
172
184
  type: "core",
@@ -176,7 +188,7 @@ export const ruleList = [
176
188
  importString: undefined,
177
189
  list: deprecatedRules,
178
190
  name: "@eslint/js",
179
- order: 15,
191
+ order: 16,
180
192
  pluginName: undefined,
181
193
  pluginValue: undefined,
182
194
  type: "core",
@@ -130,17 +130,25 @@ import tseslint from "typescript-eslint";
130
130
  import astroConfig from "@ethang/eslint-config/config.astro.js"; // OPTIONAL
131
131
  import reactConfig from "@ethang/eslint-config/config.react.js"; // OPTIONAL
132
132
 
133
- export default tseslint.config(...config, ...astroConfig, ...reactConfig, {
134
- languageOptions: {
135
- parserOptions: {
136
- project: true,
137
- tsconfigRootDir: import.meta.dirname,
138
- },
139
- },
140
- rules: {
141
- // your custom rules here
133
+ export default tseslint.config(
134
+ {
135
+ ignores: [], // Ignored files apply to all following configs
142
136
  },
143
- });`,
137
+ ...config,
138
+ ...astroConfig,
139
+ ...reactConfig,
140
+ {
141
+ languageOptions: {
142
+ parserOptions: {
143
+ project: true,
144
+ tsconfigRootDir: import.meta.dirname,
145
+ },
146
+ },
147
+ rules: {
148
+ // Override rules from above configs
149
+ },
150
+ }
151
+ );`,
144
152
  "js",
145
153
  2,
146
154
  );
package/eslint.config.js CHANGED
@@ -14,7 +14,8 @@ import perfectionist from "eslint-plugin-perfectionist";
14
14
  import sonar from "eslint-plugin-sonarjs";
15
15
  import stylistic from "@stylistic/eslint-plugin";
16
16
  import tailwind from "eslint-plugin-tailwindcss";
17
- import tanstack from "@tanstack/eslint-plugin-query";
17
+ import tanstackQuery from "@tanstack/eslint-plugin-query";
18
+ import tanstackRouter from "@tanstack/eslint-plugin-router";
18
19
  import tseslint from "typescript-eslint";
19
20
  import unicorn from "eslint-plugin-unicorn";
20
21
 
@@ -37,10 +38,11 @@ export default tseslint.config(
37
38
  lodash: lodashConfig,
38
39
  sonar: fixupPluginRules(sonar),
39
40
  ethang: ethang,
40
- "@tanstack/query": tanstack,
41
+ "@tanstack/query": tanstackQuery,
41
42
  tailwind: tailwind,
42
43
  stylistic: stylistic,
43
44
  perfectionist: perfectionist,
45
+ "@tanstack/router": tanstackRouter,
44
46
  a11y: a11y,
45
47
  },
46
48
  rules: {
@@ -76,6 +78,7 @@ export default tseslint.config(
76
78
  "Hawn",
77
79
  "nextui",
78
80
  "speculationrules",
81
+ "zustand",
79
82
  ],
80
83
  },
81
84
  },
@@ -1112,6 +1115,7 @@ export default tseslint.config(
1112
1115
  "error",
1113
1116
  { groups: ["shorthand", "multiline"] },
1114
1117
  ],
1118
+ "@tanstack/router/create-route-property-order": "error",
1115
1119
  "a11y/alt-text": "error",
1116
1120
  "a11y/anchor-ambiguous-text": "error",
1117
1121
  "a11y/anchor-has-content": "error",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethang/eslint-config",
3
- "version": "19.5.8",
3
+ "version": "19.6.1",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/eglove/eslint-config-ethang.git"
6
6
  },
@@ -13,15 +13,16 @@
13
13
  "lint": "prettier . -w"
14
14
  },
15
15
  "dependencies": {
16
- "@cspell/eslint-plugin": "^8.14.3",
16
+ "@cspell/eslint-plugin": "^8.14.4",
17
17
  "@eslint-react/eslint-plugin": "^1.14.1",
18
18
  "@eslint/compat": "^1.1.1",
19
19
  "@eslint/js": "^9.10.0",
20
20
  "@eslint/json": "^0.4.0",
21
21
  "@eslint/markdown": "^6.1.0",
22
- "@ethang/eslint-plugin": "^0.0.9",
22
+ "@ethang/eslint-plugin": "^0.0.10",
23
23
  "@stylistic/eslint-plugin": "^2.8.0",
24
24
  "@tanstack/eslint-plugin-query": "^5.56.1",
25
+ "@tanstack/eslint-plugin-router": "^1.58.0",
25
26
  "@typescript-eslint/parser": "^8.6.0",
26
27
  "eslint": "^9.10.0",
27
28
  "eslint-plugin-astro": "^1.2.4",
@@ -30,7 +31,7 @@
30
31
  "eslint-plugin-depend": "^0.11.0",
31
32
  "eslint-plugin-jsx-a11y": "^6.10.0",
32
33
  "eslint-plugin-lodash": "^8.0.0",
33
- "eslint-plugin-n": "^17.10.2",
34
+ "eslint-plugin-n": "^17.10.3",
34
35
  "eslint-plugin-perfectionist": "^3.6.0",
35
36
  "eslint-plugin-react-hooks": "^4.6.2",
36
37
  "eslint-plugin-solid": "^0.14.3",
@@ -42,7 +43,7 @@
42
43
  },
43
44
  "devDependencies": {
44
45
  "@ethang/markdown-generator": "^1.1.1",
45
- "@ethang/project-builder": "^2.5.11",
46
+ "@ethang/project-builder": "^2.6.0",
46
47
  "@tsconfig/node-lts": "^20.1.3",
47
48
  "@tsconfig/strictest": "^2.0.5",
48
49
  "@types/eslint-plugin-jsx-a11y": "^6.9.0",
@@ -52,15 +53,16 @@
52
53
  "prettier": "^3.3.3"
53
54
  },
54
55
  "peerDependencies": {
55
- "@cspell/eslint-plugin": "^8.14.3",
56
+ "@cspell/eslint-plugin": "^8.14.4",
56
57
  "@eslint-react/eslint-plugin": "^1.14.1",
57
58
  "@eslint/compat": "^1.1.1",
58
59
  "@eslint/js": "^9.10.0",
59
60
  "@eslint/json": "^0.4.0",
60
61
  "@eslint/markdown": "^6.1.0",
61
- "@ethang/eslint-plugin": "^0.0.9",
62
+ "@ethang/eslint-plugin": "^0.0.10",
62
63
  "@stylistic/eslint-plugin": "^2.8.0",
63
64
  "@tanstack/eslint-plugin-query": "^5.56.1",
65
+ "@tanstack/eslint-plugin-router": "^1.58.0",
64
66
  "@typescript-eslint/parser": "^8.6.0",
65
67
  "eslint": "^9.10.0",
66
68
  "eslint-plugin-astro": "^1.2.4",
@@ -69,7 +71,7 @@
69
71
  "eslint-plugin-depend": "^0.11.0",
70
72
  "eslint-plugin-jsx-a11y": "^6.10.0",
71
73
  "eslint-plugin-lodash": "^8.0.0",
72
- "eslint-plugin-n": "^17.10.2",
74
+ "eslint-plugin-n": "^17.10.3",
73
75
  "eslint-plugin-perfectionist": "^3.6.0",
74
76
  "eslint-plugin-react-hooks": "^4.6.2",
75
77
  "eslint-plugin-solid": "^0.14.3",
package/setup/cspell.ts CHANGED
@@ -37,6 +37,7 @@ const customRules: CustomRules = [
37
37
  "Hawn",
38
38
  "nextui",
39
39
  "speculationrules",
40
+ "zustand",
40
41
  ],
41
42
  },
42
43
  },
@@ -2,6 +2,7 @@ import tanstack from "@tanstack/eslint-plugin-query";
2
2
 
3
3
  import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
4
4
 
5
+ // @ts-expect-error it's fine
5
6
  const ruleNames = Object.keys(getNonDeprecatedRules(tanstack.rules));
6
7
 
7
8
  export const tanstackQueryRules = genRules(ruleNames, [], "@tanstack/query");
@@ -0,0 +1,7 @@
1
+ import tanstack from "@tanstack/eslint-plugin-router";
2
+ import { genRules, getNonDeprecatedRules } from "./gen-rules.js";
3
+
4
+ // @ts-expect-error it's fine
5
+ const ruleNames = Object.keys(getNonDeprecatedRules(tanstack.rules));
6
+
7
+ export const tanstackRouterRules = genRules(ruleNames, [], "@tanstack/router");