@ethang/eslint-config 19.0.10 → 19.1.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.
- package/README.md +6 -3
- package/build/update-readme.js +107 -31
- package/build/update-rules.js +88 -26
- package/config.astro.js +4 -52
- package/config.react.js +4 -72
- package/config.solid.js +4 -19
- package/constants.js +1 -0
- package/eslint.config.js +1695 -1572
- package/package.json +6 -1
- package/setup/astro.js +7 -0
- package/setup/deprecated.js +105 -0
- package/setup/gen-rules.js +4 -3
- package/setup/json.js +7 -0
- package/setup/markdown.js +7 -0
- package/setup/react.js +30 -0
- package/setup/solid.js +10 -0
package/README.md
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
[View Config](https://eslint-config-ethang.pages.dev/rules)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> [!CAUTION]
|
|
6
|
+
> Do not use this with Prettier! Styling rules are included.
|
|
6
7
|
|
|
7
|
-
-
|
|
8
|
+
- 882 errored rules.
|
|
8
9
|
- 289 rules from [eslint-plugin-sonarjs](https://github.com/SonarSource/SonarJS/blob/master/packages/jsts/src/rules/README.md)
|
|
9
10
|
- 144 rules from [@eslint/js](https://github.com/eslint/eslint/tree/main/packages/js)
|
|
10
11
|
- 113 rules from [sindresorhus/eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
|
|
@@ -15,8 +16,10 @@ Do **NOT** use this with Prettier! Styling rules are included.
|
|
|
15
16
|
- 20 rules from [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n)
|
|
16
17
|
- 19 rules from [eslint-plugin-perfectionist](https://github.com/azat-io/eslint-plugin-perfectionist)
|
|
17
18
|
- 7 rules from [eslint-plugin-tailwindcss](https://github.com/francoismassart/eslint-plugin-tailwindcss)
|
|
19
|
+
- 7 rules from [@eslint/markdown](https://github.com/eslint/markdown)
|
|
18
20
|
- 4 rules from [eslint-plugin-barrel-files](https://github.com/thepassle/eslint-plugin-barrel-files)
|
|
19
21
|
- 4 rules from [@tanstack/eslint-plugin-query](https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query)
|
|
22
|
+
- 2 rules from [@eslint/json](https://github.com/eslint/json)
|
|
20
23
|
- 1 rule from [eslint-plugin-depend](https://github.com/es-tooling/eslint-plugin-depend/tree/main)
|
|
21
24
|
- 1 rule from [eslint-plugin-compat](https://github.com/amilajack/eslint-plugin-compat)
|
|
22
25
|
|
|
@@ -61,7 +64,7 @@ export default tseslint.config(...config, ...astroConfig, ...reactConfig, {
|
|
|
61
64
|
});
|
|
62
65
|
```
|
|
63
66
|
|
|
64
|
-
**Scripts
|
|
67
|
+
**Scripts**
|
|
65
68
|
|
|
66
69
|
```json
|
|
67
70
|
"scripts": {
|
package/build/update-readme.js
CHANGED
|
@@ -14,8 +14,22 @@ import { perfectionistRules } from "../setup/perfectionist.js";
|
|
|
14
14
|
import { a11yRules } from "../setup/a11y.js";
|
|
15
15
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
16
16
|
import { join } from "node:path";
|
|
17
|
+
import { MarkdownGenerator } from "@ethang/markdown-generator/markdown-generator.js";
|
|
18
|
+
import { markdownRules } from "../setup/markdown.js";
|
|
19
|
+
import { jsonRules } from "../setup/json.js";
|
|
17
20
|
|
|
18
21
|
export const updateReadme = () => {
|
|
22
|
+
const md = new MarkdownGenerator();
|
|
23
|
+
md.header(1, "Opinionated, Strict, Brutal, Unforgiving");
|
|
24
|
+
md.newLine(2);
|
|
25
|
+
md.link("View Config", "https://eslint-config-ethang.pages.dev/rules");
|
|
26
|
+
md.newLine(2);
|
|
27
|
+
md.alert(
|
|
28
|
+
"CAUTION",
|
|
29
|
+
"Do not use this with Prettier! Styling rules are included.",
|
|
30
|
+
);
|
|
31
|
+
md.newLine(2);
|
|
32
|
+
|
|
19
33
|
const getRuleCount = (rules) => {
|
|
20
34
|
let count = 0;
|
|
21
35
|
Object.values(rules).forEach((value) => {
|
|
@@ -98,6 +112,16 @@ export const updateReadme = () => {
|
|
|
98
112
|
name: "jsx-a11y",
|
|
99
113
|
url: "https://github.com/jsx-eslint/eslint-plugin-jsx-a11y",
|
|
100
114
|
},
|
|
115
|
+
{
|
|
116
|
+
list: markdownRules,
|
|
117
|
+
name: "@eslint/markdown",
|
|
118
|
+
url: "https://github.com/eslint/markdown",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
list: jsonRules,
|
|
122
|
+
name: "@eslint/json",
|
|
123
|
+
url: "https://github.com/eslint/json",
|
|
124
|
+
},
|
|
101
125
|
];
|
|
102
126
|
|
|
103
127
|
let total = 0;
|
|
@@ -110,43 +134,95 @@ export const updateReadme = () => {
|
|
|
110
134
|
return b.count - a.count;
|
|
111
135
|
});
|
|
112
136
|
|
|
113
|
-
const ruleDocs = [
|
|
137
|
+
const ruleDocs = [`${total} errored rules.`];
|
|
114
138
|
for (const list of ruleList) {
|
|
115
139
|
ruleDocs.push(
|
|
116
|
-
|
|
140
|
+
`${list.count} ${list.count <= 1 ? "rule" : "rules"} from [${list.name}](${list.url})`,
|
|
117
141
|
);
|
|
118
142
|
}
|
|
119
143
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
144
|
+
md.unorderedList(ruleDocs);
|
|
145
|
+
md.newLine();
|
|
146
|
+
md.header(1, "Add Even More!");
|
|
147
|
+
md.newLine(2);
|
|
148
|
+
md.unorderedList(["51 rules for **Astro**"]);
|
|
149
|
+
md.unorderedList(
|
|
150
|
+
[
|
|
151
|
+
'`import astroConfig from "@ethang/eslint-config/config.astro.js";`',
|
|
152
|
+
"51 rules from [eslint-plugin-astro](https://github.com/ota-meshi/eslint-plugin-astro)",
|
|
153
|
+
],
|
|
154
|
+
2,
|
|
123
155
|
);
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
156
|
+
md.unorderedList(["68 rules for **React**"]);
|
|
157
|
+
md.unorderedList(
|
|
158
|
+
[
|
|
159
|
+
'`import reactConfig from "@ethang/eslint-config/config.react.js";`',
|
|
160
|
+
"68 rules from [@eslint-react/eslint-plugin](https://eslint-react.xyz/)",
|
|
161
|
+
],
|
|
162
|
+
2,
|
|
163
|
+
);
|
|
164
|
+
md.unorderedList(["18 rules for **Solid**"]);
|
|
165
|
+
md.unorderedList(
|
|
166
|
+
[
|
|
167
|
+
'`import solidConfig from "@ethang/eslint-config/config.solid.js";`',
|
|
168
|
+
"18 rules from [eslint-plugin-solid](https://github.com/solidjs-community/eslint-plugin-solid)",
|
|
169
|
+
],
|
|
170
|
+
2,
|
|
171
|
+
);
|
|
172
|
+
md.newLine();
|
|
173
|
+
md.header(1, "Install");
|
|
174
|
+
md.newLine(2);
|
|
175
|
+
md.inlineCode("pnpm i -D eslint typescript-eslint @ethang/eslint-config");
|
|
176
|
+
md.newLine(2);
|
|
177
|
+
md.bold("Requires TypesScript and tsconfig.json at root directory.");
|
|
178
|
+
md.newLine(2);
|
|
179
|
+
md.header(1, "Config");
|
|
180
|
+
md.newLine(2);
|
|
181
|
+
md.text("In **eslint.config.js**");
|
|
182
|
+
md.newLine(2);
|
|
183
|
+
md.codeBlock(
|
|
184
|
+
`import config from "@ethang/eslint-config/eslint.config.js";
|
|
185
|
+
import tseslint from "typescript-eslint";
|
|
186
|
+
import astroConfig from "@ethang/eslint-config/config.astro.js"; // OPTIONAL
|
|
187
|
+
import reactConfig from "@ethang/eslint-config/config.react.js"; // OPTIONAL
|
|
144
188
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
189
|
+
export default tseslint.config(...config, ...astroConfig, ...reactConfig, {
|
|
190
|
+
languageOptions: {
|
|
191
|
+
parserOptions: {
|
|
192
|
+
project: true,
|
|
193
|
+
tsconfigRootDir: import.meta.dirname,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
rules: {
|
|
197
|
+
// your custom rules here
|
|
198
|
+
},
|
|
199
|
+
});`,
|
|
200
|
+
"js",
|
|
201
|
+
);
|
|
202
|
+
md.newLine(2);
|
|
203
|
+
md.bold("Scripts");
|
|
204
|
+
md.newLine(2);
|
|
205
|
+
md.codeBlock(
|
|
206
|
+
`"scripts": {
|
|
207
|
+
"lint": "eslint",
|
|
208
|
+
"lint:fix": "eslint . --fix",
|
|
209
|
+
}`,
|
|
210
|
+
"json",
|
|
211
|
+
);
|
|
212
|
+
md.newLine(2);
|
|
213
|
+
md.bold("Browserslist");
|
|
214
|
+
md.newLine(2);
|
|
215
|
+
md.text(
|
|
216
|
+
"This config will also lint for browserslist features. Make sure to set this in package.json. [More info.](https://github.com/browserslist/browserslist)",
|
|
217
|
+
);
|
|
218
|
+
md.newLine(2);
|
|
219
|
+
md.codeBlock(
|
|
220
|
+
`"browserslist": [
|
|
221
|
+
"defaults and fully supports es6-module",
|
|
222
|
+
"maintained node versions"
|
|
223
|
+
]`,
|
|
224
|
+
"json",
|
|
225
|
+
);
|
|
150
226
|
|
|
151
|
-
writeFileSync(join(import.meta.dirname, "../README.md"),
|
|
227
|
+
writeFileSync(join(import.meta.dirname, "../README.md"), md.render(), "utf8");
|
|
152
228
|
};
|
package/build/update-rules.js
CHANGED
|
@@ -14,9 +14,14 @@ import { perfectionistRules } from "../setup/perfectionist.js";
|
|
|
14
14
|
import { a11yRules } from "../setup/a11y.js";
|
|
15
15
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
16
16
|
import { join } from "node:path";
|
|
17
|
+
import { deprecatedRules } from "../setup/deprecated.js";
|
|
18
|
+
import { markdownRules } from "../setup/markdown.js";
|
|
19
|
+
import { jsonRules } from "../setup/json.js";
|
|
17
20
|
|
|
18
21
|
export const updateRules = () => {
|
|
19
|
-
|
|
22
|
+
let configFile = "";
|
|
23
|
+
|
|
24
|
+
const jsRules = {
|
|
20
25
|
...dependRules,
|
|
21
26
|
...barrelRules,
|
|
22
27
|
...compatRules,
|
|
@@ -31,40 +36,97 @@ export const updateRules = () => {
|
|
|
31
36
|
...stylisticRules,
|
|
32
37
|
...perfectionistRules,
|
|
33
38
|
...a11yRules,
|
|
39
|
+
...deprecatedRules,
|
|
34
40
|
};
|
|
35
41
|
|
|
36
|
-
let
|
|
37
|
-
|
|
42
|
+
let jsRulesJon = JSON.stringify(jsRules);
|
|
43
|
+
jsRulesJon = jsRulesJon.slice(1, -1);
|
|
38
44
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"utf8",
|
|
42
|
-
);
|
|
43
|
-
const lines = config.split("\n");
|
|
45
|
+
let markdownRulesJson = JSON.stringify(markdownRules);
|
|
46
|
+
markdownRulesJson = markdownRulesJson.slice(1, -1);
|
|
44
47
|
|
|
45
|
-
let
|
|
46
|
-
|
|
47
|
-
for (let index = 1; index < lines.length; index++) {
|
|
48
|
-
if (lines[index].endsWith("rules: {")) {
|
|
49
|
-
rulesStart = index;
|
|
50
|
-
}
|
|
48
|
+
let jsonRulesJson = JSON.stringify(jsonRules);
|
|
49
|
+
jsonRulesJson = jsonRulesJson.slice(1, -1);
|
|
51
50
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
const importList = [
|
|
52
|
+
'import parser from "@typescript-eslint/parser";',
|
|
53
|
+
'import a11y from "eslint-plugin-jsx-a11y/lib/index.js";',
|
|
54
|
+
'import n from "eslint-plugin-n";',
|
|
55
|
+
'import unicorn from "eslint-plugin-unicorn";',
|
|
56
|
+
'import tseslint from "typescript-eslint";',
|
|
57
|
+
'import sonar from "eslint-plugin-sonarjs";',
|
|
58
|
+
'import tanstack from "@tanstack/eslint-plugin-query";',
|
|
59
|
+
'import perfectionist from "eslint-plugin-perfectionist";',
|
|
60
|
+
'import depend from "eslint-plugin-depend";',
|
|
61
|
+
'import barrel from "eslint-plugin-barrel-files";',
|
|
62
|
+
'import compat from "eslint-plugin-compat";',
|
|
63
|
+
'import lodashConfig from "eslint-plugin-lodash";',
|
|
64
|
+
'import tailwind from "eslint-plugin-tailwindcss";',
|
|
65
|
+
'import stylistic from "@stylistic/eslint-plugin";',
|
|
66
|
+
'import markdown from "@eslint/markdown";',
|
|
67
|
+
'import json from "@eslint/json";',
|
|
68
|
+
'import { ignores } from "./constants.js";',
|
|
69
|
+
].sort((a, b) => {
|
|
70
|
+
return a.localeCompare(b);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
importList.forEach((item) => {
|
|
74
|
+
configFile += `${item}\n`;
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
configFile += `\nexport const languageOptions = {
|
|
78
|
+
parser,
|
|
79
|
+
parserOptions: {
|
|
80
|
+
project: true,
|
|
81
|
+
tsconfigRootDir: import.meta.dirname,
|
|
82
|
+
},
|
|
83
|
+
};
|
|
56
84
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
85
|
+
export default tseslint.config(
|
|
86
|
+
{
|
|
87
|
+
files: ["**/*.{js,ts,jsx,tsx,cjs,cts,mjs,mts}"],
|
|
88
|
+
ignores,
|
|
89
|
+
languageOptions,
|
|
90
|
+
plugins: {
|
|
91
|
+
"@tanstack/query": tanstack,
|
|
92
|
+
"@typescript-eslint": tseslint.plugin,
|
|
93
|
+
a11y,
|
|
94
|
+
barrel,
|
|
95
|
+
compat,
|
|
96
|
+
depend,
|
|
97
|
+
lodash: lodashConfig,
|
|
98
|
+
n,
|
|
99
|
+
perfectionist,
|
|
100
|
+
sonar,
|
|
101
|
+
stylistic,
|
|
102
|
+
tailwind,
|
|
103
|
+
unicorn,
|
|
104
|
+
},
|
|
105
|
+
rules: {
|
|
106
|
+
${jsRulesJon}
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
files: ["**/*.md"],
|
|
111
|
+
plugins: {
|
|
112
|
+
markdown,
|
|
113
|
+
},
|
|
114
|
+
rules: {
|
|
115
|
+
${markdownRulesJson}
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
files: ["**/*.{json,jsonc,json5}"],
|
|
120
|
+
plugins: { json },
|
|
121
|
+
rules: {
|
|
122
|
+
${jsonRulesJson}
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
);\n`;
|
|
64
126
|
|
|
65
127
|
writeFileSync(
|
|
66
128
|
join(import.meta.dirname, "../eslint.config.js"),
|
|
67
|
-
|
|
129
|
+
configFile,
|
|
68
130
|
"utf8",
|
|
69
131
|
);
|
|
70
132
|
};
|
package/config.astro.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import astro from "eslint-plugin-astro";
|
|
2
2
|
import tseslint from "typescript-eslint";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { languageOptions } from "./eslint.config.js";
|
|
5
|
+
import { ignores } from "./constants.js";
|
|
6
|
+
import { astroRules } from "./setup/astro.js";
|
|
5
7
|
|
|
6
8
|
export default tseslint.config({
|
|
7
9
|
files: ["**/*.{astro}"],
|
|
@@ -9,56 +11,6 @@ export default tseslint.config({
|
|
|
9
11
|
languageOptions,
|
|
10
12
|
plugins: { astro },
|
|
11
13
|
rules: {
|
|
12
|
-
|
|
13
|
-
"astro/jsx-a11y/anchor-ambiguous-text": "error",
|
|
14
|
-
"astro/jsx-a11y/anchor-has-content": "error",
|
|
15
|
-
"astro/jsx-a11y/anchor-is-valid": "error",
|
|
16
|
-
"astro/jsx-a11y/aria-activedescendant-has-tabindex": "error",
|
|
17
|
-
"astro/jsx-a11y/aria-props": "error",
|
|
18
|
-
"astro/jsx-a11y/aria-proptypes": "error",
|
|
19
|
-
"astro/jsx-a11y/aria-role": "error",
|
|
20
|
-
"astro/jsx-a11y/aria-unsupported-elements": "error",
|
|
21
|
-
"astro/jsx-a11y/autocomplete-valid": "error",
|
|
22
|
-
"astro/jsx-a11y/click-events-have-key-events": "error",
|
|
23
|
-
"astro/jsx-a11y/control-has-associated-label": "error",
|
|
24
|
-
"astro/jsx-a11y/heading-has-content": "error",
|
|
25
|
-
"astro/jsx-a11y/html-has-lang": "error",
|
|
26
|
-
"astro/jsx-a11y/iframe-has-title": "error",
|
|
27
|
-
"astro/jsx-a11y/img-redundant-alt": "error",
|
|
28
|
-
"astro/jsx-a11y/interactive-supports-focus": "error",
|
|
29
|
-
"astro/jsx-a11y/label-has-associated-control": "error",
|
|
30
|
-
"astro/jsx-a11y/lang": "error",
|
|
31
|
-
"astro/jsx-a11y/media-has-caption": "error",
|
|
32
|
-
"astro/jsx-a11y/mouse-events-have-key-events": "error",
|
|
33
|
-
"astro/jsx-a11y/no-access-key": "error",
|
|
34
|
-
"astro/jsx-a11y/no-aria-hidden-on-focusable": "error",
|
|
35
|
-
"astro/jsx-a11y/no-autofocus": "error",
|
|
36
|
-
"astro/jsx-a11y/no-distracting-elements": "error",
|
|
37
|
-
"astro/jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
|
|
38
|
-
"astro/jsx-a11y/no-noninteractive-element-interactions": "error",
|
|
39
|
-
"astro/jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
|
|
40
|
-
"astro/jsx-a11y/no-noninteractive-tabindex": "error",
|
|
41
|
-
"astro/jsx-a11y/no-redundant-roles": "error",
|
|
42
|
-
"astro/jsx-a11y/no-static-element-interactions": "error",
|
|
43
|
-
"astro/jsx-a11y/prefer-tag-over-role": "error",
|
|
44
|
-
"astro/jsx-a11y/role-has-required-aria-props": "error",
|
|
45
|
-
"astro/jsx-a11y/role-supports-aria-props": "error",
|
|
46
|
-
"astro/jsx-a11y/scope": "error",
|
|
47
|
-
"astro/jsx-a11y/tabindex-no-positive": "error",
|
|
48
|
-
"astro/missing-client-only-directive-value": "error",
|
|
49
|
-
"astro/no-conflict-set-directives": "error",
|
|
50
|
-
"astro/no-deprecated-astro-canonicalurl": "error",
|
|
51
|
-
"astro/no-deprecated-astro-fetchcontent": "error",
|
|
52
|
-
"astro/no-deprecated-astro-resolve": "error",
|
|
53
|
-
"astro/no-deprecated-getentrybyslug": "error",
|
|
54
|
-
"astro/no-exports-from-components": "error",
|
|
55
|
-
"astro/no-set-text-directive": "error",
|
|
56
|
-
"astro/no-unused-css-selector": "error",
|
|
57
|
-
"astro/no-unused-define-vars-in-style": "error",
|
|
58
|
-
"astro/prefer-class-list-directive": "error",
|
|
59
|
-
"astro/prefer-object-class-list": "error",
|
|
60
|
-
"astro/prefer-split-class-list": "error",
|
|
61
|
-
"astro/semi": "error",
|
|
62
|
-
"astro/valid-compile": "error",
|
|
14
|
+
...astroRules,
|
|
63
15
|
},
|
|
64
16
|
});
|
package/config.react.js
CHANGED
|
@@ -2,7 +2,9 @@ import react from "@eslint-react/eslint-plugin";
|
|
|
2
2
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
3
3
|
import tseslint from "typescript-eslint";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { languageOptions } from "./eslint.config.js";
|
|
6
|
+
import { ignores } from "./constants.js";
|
|
7
|
+
import { reactRules } from "./setup/react.js";
|
|
6
8
|
|
|
7
9
|
export default tseslint.config({
|
|
8
10
|
files: ["**/*.{jsx,tsx}"],
|
|
@@ -10,79 +12,9 @@ export default tseslint.config({
|
|
|
10
12
|
languageOptions,
|
|
11
13
|
plugins: {
|
|
12
14
|
react,
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
14
15
|
"react-hooks": reactHooks,
|
|
15
16
|
},
|
|
16
17
|
rules: {
|
|
17
|
-
|
|
18
|
-
"react-hooks/rules-of-hooks": "off", // TODO fix w/ v9 compatibility
|
|
19
|
-
"react/dom/no-children-in-void-dom-elements": "error",
|
|
20
|
-
"react/dom/no-dangerously-set-innerhtml": "error",
|
|
21
|
-
"react/dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
22
|
-
"react/dom/no-find-dom-node": "error",
|
|
23
|
-
"react/dom/no-missing-button-type": "error",
|
|
24
|
-
"react/dom/no-missing-iframe-sandbox": "error",
|
|
25
|
-
"react/dom/no-namespace": "error",
|
|
26
|
-
"react/dom/no-render-return-value": "error",
|
|
27
|
-
"react/dom/no-script-url": "error",
|
|
28
|
-
"react/dom/no-unsafe-iframe-sandbox": "error",
|
|
29
|
-
"react/dom/no-unsafe-target-blank": "error",
|
|
30
|
-
"react/ensure-forward-ref-using-ref": "error",
|
|
31
|
-
"react/hooks-extra/ensure-custom-hooks-using-other-hooks": "error",
|
|
32
|
-
"react/hooks-extra/ensure-use-callback-has-non-empty-deps": "error",
|
|
33
|
-
"react/hooks-extra/ensure-use-memo-has-non-empty-deps": "error",
|
|
34
|
-
"react/hooks-extra/no-direct-set-state-in-use-effect": "error",
|
|
35
|
-
"react/hooks-extra/no-direct-set-state-in-use-layout-effect": "error",
|
|
36
|
-
"react/hooks-extra/prefer-use-state-lazy-initialization": "error",
|
|
37
|
-
"react/naming-convention/component-name": "error",
|
|
38
|
-
"react/naming-convention/filename": ["error", { rule: "kebab-case" }],
|
|
39
|
-
"react/naming-convention/filename-extension": "error",
|
|
40
|
-
"react/naming-convention/use-state": "error",
|
|
41
|
-
"react/no-access-state-in-setstate": "error",
|
|
42
|
-
"react/no-array-index-key": "error",
|
|
43
|
-
"react/no-children-count": "error",
|
|
44
|
-
"react/no-children-for-each": "error",
|
|
45
|
-
"react/no-children-map": "error",
|
|
46
|
-
"react/no-children-only": "error",
|
|
47
|
-
"react/no-children-prop": "error",
|
|
48
|
-
"react/no-children-to-array": "error",
|
|
49
|
-
"react/no-class-component": "error",
|
|
50
|
-
"react/no-clone-element": "error",
|
|
51
|
-
"react/no-comment-textnodes": "error",
|
|
52
|
-
"react/no-complex-conditional-rendering": "error",
|
|
53
|
-
"react/no-complicated-conditional-rendering": "error",
|
|
54
|
-
"react/no-component-will-mount": "error",
|
|
55
|
-
"react/no-component-will-receive-props": "error",
|
|
56
|
-
"react/no-component-will-update": "error",
|
|
57
|
-
"react/no-create-ref": "error",
|
|
58
|
-
"react/no-default-props": "error",
|
|
59
|
-
"react/no-direct-mutation-state": "error",
|
|
60
|
-
"react/no-duplicate-key": "error",
|
|
61
|
-
"react/no-implicit-key": "error",
|
|
62
|
-
"react/no-leaked-conditional-rendering": "error",
|
|
63
|
-
"react/no-missing-component-display-name": "error",
|
|
64
|
-
"react/no-missing-key": "error",
|
|
65
|
-
"react/no-nested-components": "error",
|
|
66
|
-
"react/no-prop-types": "error",
|
|
67
|
-
"react/no-redundant-should-component-update": "error",
|
|
68
|
-
"react/no-set-state-in-component-did-mount": "error",
|
|
69
|
-
"react/no-set-state-in-component-did-update": "error",
|
|
70
|
-
"react/no-set-state-in-component-will-update": "error",
|
|
71
|
-
"react/no-string-refs": "error",
|
|
72
|
-
"react/no-unsafe-component-will-mount": "error",
|
|
73
|
-
"react/no-unsafe-component-will-receive-props": "error",
|
|
74
|
-
"react/no-unsafe-component-will-update": "error",
|
|
75
|
-
"react/no-unstable-context-value": "error",
|
|
76
|
-
"react/no-unstable-default-props": "error",
|
|
77
|
-
"react/no-unused-class-component-members": "error",
|
|
78
|
-
"react/no-unused-state": "error",
|
|
79
|
-
"react/no-useless-fragment": "error",
|
|
80
|
-
"react/prefer-destructuring-assignment": "error",
|
|
81
|
-
"react/prefer-read-only-props": "error",
|
|
82
|
-
"react/prefer-shorthand-boolean": "error",
|
|
83
|
-
"react/prefer-shorthand-fragment": "error",
|
|
84
|
-
"react/web-api/no-leaked-event-listener": "error",
|
|
85
|
-
"react/web-api/no-leaked-interval": "error",
|
|
86
|
-
"react/web-api/no-leaked-timeout": "error",
|
|
18
|
+
...reactRules,
|
|
87
19
|
},
|
|
88
20
|
});
|
package/config.solid.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import solid from "eslint-plugin-solid";
|
|
2
2
|
import tseslint from "typescript-eslint";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { languageOptions } from "./eslint.config.js";
|
|
5
|
+
import { ignores } from "./constants.js";
|
|
6
|
+
import { solidRules } from "./setup/solid.js";
|
|
5
7
|
|
|
6
8
|
export default tseslint.config({
|
|
7
9
|
files: ["**/*.{jsx,tsx}"],
|
|
@@ -9,23 +11,6 @@ export default tseslint.config({
|
|
|
9
11
|
languageOptions,
|
|
10
12
|
plugins: { solid },
|
|
11
13
|
rules: {
|
|
12
|
-
|
|
13
|
-
"solid/event-handlers": "error",
|
|
14
|
-
"solid/imports": "error",
|
|
15
|
-
"solid/jsx-no-duplicate-props": "error",
|
|
16
|
-
"solid/jsx-no-script-url": "error",
|
|
17
|
-
"solid/jsx-no-undef": "error",
|
|
18
|
-
"solid/jsx-uses-vars": "error",
|
|
19
|
-
"solid/no-array-handlers": "error",
|
|
20
|
-
"solid/no-destructure": "error",
|
|
21
|
-
"solid/no-innerhtml": "error",
|
|
22
|
-
"solid/no-react-deps": "error",
|
|
23
|
-
"solid/no-react-specific-props": "error",
|
|
24
|
-
"solid/no-unknown-namespaces": "error",
|
|
25
|
-
"solid/prefer-for": "error",
|
|
26
|
-
"solid/prefer-show": "error",
|
|
27
|
-
"solid/reactivity": "error",
|
|
28
|
-
"solid/self-closing-comp": "error",
|
|
29
|
-
"solid/style-prop": "error",
|
|
14
|
+
...solidRules,
|
|
30
15
|
},
|
|
31
16
|
});
|
package/constants.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const ignores = ["eslint.config.js", "node_modules", "dist"];
|