@ethang/eslint-config 19.1.0 → 19.2.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 +2 -2
- package/build/update-astro-rules.js +39 -0
- package/build/update-react-rules.js +43 -0
- package/build/update-readme.js +30 -40
- package/build/update-rules.js +3 -8
- package/build/update-solid-rules.js +39 -0
- package/build.mjs +11 -4
- package/config.astro.js +54 -5
- package/config.react.js +78 -5
- package/config.solid.js +22 -5
- package/eslint.config.js +1 -0
- package/package.json +23 -23
package/README.md
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
> [!CAUTION]
|
|
6
6
|
> Do not use this with Prettier! Styling rules are included.
|
|
7
7
|
|
|
8
|
-
-
|
|
8
|
+
- 883 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
|
- 144 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)
|
|
12
|
-
-
|
|
12
|
+
- 104 rules from [@typescript/eslint](https://github.com/typescript-eslint/typescript-eslint)
|
|
13
13
|
- 91 rules from [@stylistic/eslint-plugin](https://eslint.style/)
|
|
14
14
|
- 42 rules from [eslint-plugin-lodash](https://github.com/wix-incubator/eslint-plugin-lodash)
|
|
15
15
|
- 35 rules from [jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { astroRules } from "../setup/astro.js";
|
|
4
|
+
|
|
5
|
+
export function updateAstroRules() {
|
|
6
|
+
let configFile = "";
|
|
7
|
+
|
|
8
|
+
const rulesJson = JSON.stringify(astroRules).slice(1, -1);
|
|
9
|
+
|
|
10
|
+
const importList = [
|
|
11
|
+
'import astro from "eslint-plugin-astro";',
|
|
12
|
+
'import tseslint from "typescript-eslint";',
|
|
13
|
+
'import { languageOptions } from "./eslint.config.js";',
|
|
14
|
+
'import { ignores } from "./constants.js";',
|
|
15
|
+
].sort((a, b) => {
|
|
16
|
+
return a.localeCompare(b);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
importList.forEach((item) => {
|
|
20
|
+
configFile += `${item}\n`;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
configFile += `\nexport default tseslint.config({
|
|
24
|
+
files: ["**/*.{astro}"],
|
|
25
|
+
ignores,
|
|
26
|
+
languageOptions,
|
|
27
|
+
plugins: { astro },
|
|
28
|
+
rules: {
|
|
29
|
+
${rulesJson}
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
writeFileSync(
|
|
35
|
+
join(import.meta.dirname, "../config.astro.js"),
|
|
36
|
+
configFile,
|
|
37
|
+
"utf8",
|
|
38
|
+
);
|
|
39
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { reactRules } from "../setup/react.js";
|
|
2
|
+
import { writeFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
|
|
5
|
+
export function updateReactRules() {
|
|
6
|
+
let configFile = "";
|
|
7
|
+
|
|
8
|
+
const rulesJson = JSON.stringify(reactRules).slice(1, -1);
|
|
9
|
+
|
|
10
|
+
const importList = [
|
|
11
|
+
'import react from "@eslint-react/eslint-plugin";',
|
|
12
|
+
'import reactHooks from "eslint-plugin-react-hooks";',
|
|
13
|
+
'import tseslint from "typescript-eslint";',
|
|
14
|
+
'import { languageOptions } from "./eslint.config.js";',
|
|
15
|
+
'import { ignores } from "./constants.js";',
|
|
16
|
+
].sort((a, b) => {
|
|
17
|
+
return a.localeCompare(b);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
importList.forEach((item) => {
|
|
21
|
+
configFile += `${item}\n`;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
configFile += `\nexport default tseslint.config({
|
|
25
|
+
files: ["**/*.{jsx,tsx}"],
|
|
26
|
+
ignores,
|
|
27
|
+
languageOptions,
|
|
28
|
+
plugins: {
|
|
29
|
+
react,
|
|
30
|
+
"react-hooks": reactHooks,
|
|
31
|
+
},
|
|
32
|
+
rules: {
|
|
33
|
+
${rulesJson}
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
writeFileSync(
|
|
39
|
+
join(import.meta.dirname, "../config.react.js"),
|
|
40
|
+
configFile,
|
|
41
|
+
"utf8",
|
|
42
|
+
);
|
|
43
|
+
}
|
package/build/update-readme.js
CHANGED
|
@@ -12,23 +12,24 @@ import { tailwindRules } from "../setup/tailwind.js";
|
|
|
12
12
|
import { stylisticRules } from "../setup/stylistic.js";
|
|
13
13
|
import { perfectionistRules } from "../setup/perfectionist.js";
|
|
14
14
|
import { a11yRules } from "../setup/a11y.js";
|
|
15
|
-
import {
|
|
15
|
+
import { writeFileSync } from "node:fs";
|
|
16
16
|
import { join } from "node:path";
|
|
17
17
|
import { MarkdownGenerator } from "@ethang/markdown-generator/markdown-generator.js";
|
|
18
18
|
import { markdownRules } from "../setup/markdown.js";
|
|
19
19
|
import { jsonRules } from "../setup/json.js";
|
|
20
|
+
import { astroRules } from "../setup/astro.js";
|
|
21
|
+
import { reactRules } from "../setup/react.js";
|
|
22
|
+
import { solidRules } from "../setup/solid.js";
|
|
20
23
|
|
|
21
24
|
export const updateReadme = () => {
|
|
22
25
|
const md = new MarkdownGenerator();
|
|
23
|
-
md.header(1, "Opinionated, Strict, Brutal, Unforgiving");
|
|
24
|
-
md.
|
|
25
|
-
md.link("View Config", "https://eslint-config-ethang.pages.dev/rules");
|
|
26
|
-
md.newLine(2);
|
|
26
|
+
md.header(1, "Opinionated, Strict, Brutal, Unforgiving", 2);
|
|
27
|
+
md.link("View Config", "https://eslint-config-ethang.pages.dev/rules", 2);
|
|
27
28
|
md.alert(
|
|
28
29
|
"CAUTION",
|
|
29
30
|
"Do not use this with Prettier! Styling rules are included.",
|
|
31
|
+
2,
|
|
30
32
|
);
|
|
31
|
-
md.newLine(2);
|
|
32
33
|
|
|
33
34
|
const getRuleCount = (rules) => {
|
|
34
35
|
let count = 0;
|
|
@@ -141,45 +142,36 @@ export const updateReadme = () => {
|
|
|
141
142
|
);
|
|
142
143
|
}
|
|
143
144
|
|
|
145
|
+
const astroCount = getRuleCount(astroRules);
|
|
146
|
+
const reactCount = getRuleCount(reactRules);
|
|
147
|
+
const solidCount = getRuleCount(solidRules);
|
|
148
|
+
|
|
144
149
|
md.unorderedList(ruleDocs);
|
|
145
150
|
md.newLine();
|
|
146
|
-
md.header(1, "Add Even More!");
|
|
147
|
-
md.
|
|
148
|
-
|
|
149
|
-
md.unorderedList(
|
|
151
|
+
md.header(1, "Add Even More!", 2);
|
|
152
|
+
md.unorderedList([
|
|
153
|
+
`${astroCount} rules for **Astro**`,
|
|
150
154
|
[
|
|
151
155
|
'`import astroConfig from "@ethang/eslint-config/config.astro.js";`',
|
|
152
|
-
|
|
156
|
+
`${astroCount} rules from [eslint-plugin-astro](https://github.com/ota-meshi/eslint-plugin-astro)`,
|
|
153
157
|
],
|
|
154
|
-
|
|
155
|
-
);
|
|
156
|
-
md.unorderedList(["68 rules for **React**"]);
|
|
157
|
-
md.unorderedList(
|
|
158
|
+
`${reactCount} rules for **React**`,
|
|
158
159
|
[
|
|
159
160
|
'`import reactConfig from "@ethang/eslint-config/config.react.js";`',
|
|
160
|
-
|
|
161
|
+
`${reactCount} rules from [@eslint-react/eslint-plugin](https://eslint-react.xyz/)`,
|
|
161
162
|
],
|
|
162
|
-
|
|
163
|
-
);
|
|
164
|
-
md.unorderedList(["18 rules for **Solid**"]);
|
|
165
|
-
md.unorderedList(
|
|
163
|
+
`${solidCount} rules for **Solid**`,
|
|
166
164
|
[
|
|
167
165
|
'`import solidConfig from "@ethang/eslint-config/config.solid.js";`',
|
|
168
|
-
|
|
166
|
+
`${solidCount} rules from [eslint-plugin-solid](https://github.com/solidjs-community/eslint-plugin-solid)`,
|
|
169
167
|
],
|
|
170
|
-
|
|
171
|
-
);
|
|
168
|
+
]);
|
|
172
169
|
md.newLine();
|
|
173
|
-
md.header(1, "Install");
|
|
174
|
-
md.
|
|
175
|
-
md.
|
|
176
|
-
md.
|
|
177
|
-
md.
|
|
178
|
-
md.newLine(2);
|
|
179
|
-
md.header(1, "Config");
|
|
180
|
-
md.newLine(2);
|
|
181
|
-
md.text("In **eslint.config.js**");
|
|
182
|
-
md.newLine(2);
|
|
170
|
+
md.header(1, "Install", 2);
|
|
171
|
+
md.inlineCode("pnpm i -D eslint typescript-eslint @ethang/eslint-config", 2);
|
|
172
|
+
md.bold("Requires TypesScript and tsconfig.json at root directory.", 2);
|
|
173
|
+
md.header(1, "Config", 2);
|
|
174
|
+
md.text("In **eslint.config.js**", 2);
|
|
183
175
|
md.codeBlock(
|
|
184
176
|
`import config from "@ethang/eslint-config/eslint.config.js";
|
|
185
177
|
import tseslint from "typescript-eslint";
|
|
@@ -198,24 +190,22 @@ export default tseslint.config(...config, ...astroConfig, ...reactConfig, {
|
|
|
198
190
|
},
|
|
199
191
|
});`,
|
|
200
192
|
"js",
|
|
193
|
+
2,
|
|
201
194
|
);
|
|
202
|
-
md.
|
|
203
|
-
md.bold("Scripts");
|
|
204
|
-
md.newLine(2);
|
|
195
|
+
md.bold("Scripts", 2);
|
|
205
196
|
md.codeBlock(
|
|
206
197
|
`"scripts": {
|
|
207
198
|
"lint": "eslint",
|
|
208
199
|
"lint:fix": "eslint . --fix",
|
|
209
200
|
}`,
|
|
210
201
|
"json",
|
|
202
|
+
2,
|
|
211
203
|
);
|
|
212
|
-
md.
|
|
213
|
-
md.bold("Browserslist");
|
|
214
|
-
md.newLine(2);
|
|
204
|
+
md.bold("Browserslist", 2);
|
|
215
205
|
md.text(
|
|
216
206
|
"This config will also lint for browserslist features. Make sure to set this in package.json. [More info.](https://github.com/browserslist/browserslist)",
|
|
207
|
+
2,
|
|
217
208
|
);
|
|
218
|
-
md.newLine(2);
|
|
219
209
|
md.codeBlock(
|
|
220
210
|
`"browserslist": [
|
|
221
211
|
"defaults and fully supports es6-module",
|
package/build/update-rules.js
CHANGED
|
@@ -39,14 +39,9 @@ export const updateRules = () => {
|
|
|
39
39
|
...deprecatedRules,
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
let markdownRulesJson = JSON.stringify(markdownRules);
|
|
46
|
-
markdownRulesJson = markdownRulesJson.slice(1, -1);
|
|
47
|
-
|
|
48
|
-
let jsonRulesJson = JSON.stringify(jsonRules);
|
|
49
|
-
jsonRulesJson = jsonRulesJson.slice(1, -1);
|
|
42
|
+
const jsRulesJon = JSON.stringify(jsRules).slice(1, -1);
|
|
43
|
+
const markdownRulesJson = JSON.stringify(markdownRules).slice(1, -1);
|
|
44
|
+
const jsonRulesJson = JSON.stringify(jsonRules).slice(1, -1);
|
|
50
45
|
|
|
51
46
|
const importList = [
|
|
52
47
|
'import parser from "@typescript-eslint/parser";',
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { solidRules } from "../setup/solid.js";
|
|
2
|
+
import { writeFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
|
|
5
|
+
export function updateSolidRules() {
|
|
6
|
+
let configFile = "";
|
|
7
|
+
|
|
8
|
+
const rulesJson = JSON.stringify(solidRules).slice(1, -1);
|
|
9
|
+
|
|
10
|
+
const importList = [
|
|
11
|
+
'import solid from "eslint-plugin-solid";',
|
|
12
|
+
'import tseslint from "typescript-eslint";',
|
|
13
|
+
'import { languageOptions } from "./eslint.config.js";',
|
|
14
|
+
'import { ignores } from "./constants.js";',
|
|
15
|
+
].sort((a, b) => {
|
|
16
|
+
return a.localeCompare(b);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
importList.forEach((item) => {
|
|
20
|
+
configFile += `${item}\n`;
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
configFile += `\nexport default tseslint.config({
|
|
24
|
+
files: ["**/*.{jsx,tsx}"],
|
|
25
|
+
ignores,
|
|
26
|
+
languageOptions,
|
|
27
|
+
plugins: { solid },
|
|
28
|
+
rules: {
|
|
29
|
+
${rulesJson},
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
writeFileSync(
|
|
35
|
+
join(import.meta.dirname, "../config.solid.js"),
|
|
36
|
+
configFile,
|
|
37
|
+
"utf8",
|
|
38
|
+
);
|
|
39
|
+
}
|
package/build.mjs
CHANGED
|
@@ -3,14 +3,21 @@ import { projectBuilder } from "@ethang/project-builder/project-builder.js";
|
|
|
3
3
|
import { updateRules } from "./build/update-rules.js";
|
|
4
4
|
import { updateReadme } from "./build/update-readme.js";
|
|
5
5
|
import { execSync } from "node:child_process";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
execSync("pnpm lint");
|
|
6
|
+
import { updateReactRules } from "./build/update-react-rules.js";
|
|
7
|
+
import { updateSolidRules } from "./build/update-solid-rules.js";
|
|
8
|
+
import { updateAstroRules } from "./build/update-astro-rules.js";
|
|
10
9
|
|
|
11
10
|
await projectBuilder("eslint-config-ethang", "master", {
|
|
12
11
|
isLibrary: true,
|
|
13
12
|
scripts: ["UPDATE", "DEDUPE", "LINT"],
|
|
13
|
+
postInstall: () => {
|
|
14
|
+
updateRules();
|
|
15
|
+
updateReactRules();
|
|
16
|
+
updateSolidRules();
|
|
17
|
+
updateAstroRules();
|
|
18
|
+
updateReadme();
|
|
19
|
+
execSync("pnpm lint");
|
|
20
|
+
},
|
|
14
21
|
tsupOptions: {
|
|
15
22
|
bundle: true,
|
|
16
23
|
},
|
package/config.astro.js
CHANGED
|
@@ -1,16 +1,65 @@
|
|
|
1
|
+
import { ignores } from "./constants.js";
|
|
2
|
+
import { languageOptions } from "./eslint.config.js";
|
|
1
3
|
import astro from "eslint-plugin-astro";
|
|
2
4
|
import tseslint from "typescript-eslint";
|
|
3
5
|
|
|
4
|
-
import { languageOptions } from "./eslint.config.js";
|
|
5
|
-
import { ignores } from "./constants.js";
|
|
6
|
-
import { astroRules } from "./setup/astro.js";
|
|
7
|
-
|
|
8
6
|
export default tseslint.config({
|
|
9
7
|
files: ["**/*.{astro}"],
|
|
10
8
|
ignores,
|
|
11
9
|
languageOptions,
|
|
12
10
|
plugins: { astro },
|
|
13
11
|
rules: {
|
|
14
|
-
|
|
12
|
+
"astro/missing-client-only-directive-value": "error",
|
|
13
|
+
"astro/no-conflict-set-directives": "error",
|
|
14
|
+
"astro/no-deprecated-astro-canonicalurl": "error",
|
|
15
|
+
"astro/no-deprecated-astro-fetchcontent": "error",
|
|
16
|
+
"astro/no-deprecated-astro-resolve": "error",
|
|
17
|
+
"astro/no-deprecated-getentrybyslug": "error",
|
|
18
|
+
"astro/no-exports-from-components": "error",
|
|
19
|
+
"astro/no-set-html-directive": 'off"',
|
|
20
|
+
"astro/no-set-text-directive": "error",
|
|
21
|
+
"astro/no-unused-css-selector": "error",
|
|
22
|
+
"astro/no-unused-define-vars-in-style": "error",
|
|
23
|
+
"astro/prefer-class-list-directive": "error",
|
|
24
|
+
"astro/prefer-object-class-list": "error",
|
|
25
|
+
"astro/prefer-split-class-list": "error",
|
|
26
|
+
"astro/semi": "error",
|
|
27
|
+
"astro/valid-compile": "error",
|
|
28
|
+
"astro/jsx-a11y/alt-text": "error",
|
|
29
|
+
"astro/jsx-a11y/anchor-ambiguous-text": "error",
|
|
30
|
+
"astro/jsx-a11y/anchor-has-content": "error",
|
|
31
|
+
"astro/jsx-a11y/anchor-is-valid": "error",
|
|
32
|
+
"astro/jsx-a11y/aria-activedescendant-has-tabindex": "error",
|
|
33
|
+
"astro/jsx-a11y/aria-props": "error",
|
|
34
|
+
"astro/jsx-a11y/aria-proptypes": "error",
|
|
35
|
+
"astro/jsx-a11y/aria-role": "error",
|
|
36
|
+
"astro/jsx-a11y/aria-unsupported-elements": "error",
|
|
37
|
+
"astro/jsx-a11y/autocomplete-valid": "error",
|
|
38
|
+
"astro/jsx-a11y/click-events-have-key-events": "error",
|
|
39
|
+
"astro/jsx-a11y/control-has-associated-label": "error",
|
|
40
|
+
"astro/jsx-a11y/heading-has-content": "error",
|
|
41
|
+
"astro/jsx-a11y/html-has-lang": "error",
|
|
42
|
+
"astro/jsx-a11y/iframe-has-title": "error",
|
|
43
|
+
"astro/jsx-a11y/img-redundant-alt": "error",
|
|
44
|
+
"astro/jsx-a11y/interactive-supports-focus": "error",
|
|
45
|
+
"astro/jsx-a11y/label-has-associated-control": "error",
|
|
46
|
+
"astro/jsx-a11y/lang": "error",
|
|
47
|
+
"astro/jsx-a11y/media-has-caption": "error",
|
|
48
|
+
"astro/jsx-a11y/mouse-events-have-key-events": "error",
|
|
49
|
+
"astro/jsx-a11y/no-access-key": "error",
|
|
50
|
+
"astro/jsx-a11y/no-aria-hidden-on-focusable": "error",
|
|
51
|
+
"astro/jsx-a11y/no-autofocus": "error",
|
|
52
|
+
"astro/jsx-a11y/no-distracting-elements": "error",
|
|
53
|
+
"astro/jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
|
|
54
|
+
"astro/jsx-a11y/no-noninteractive-element-interactions": "error",
|
|
55
|
+
"astro/jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
|
|
56
|
+
"astro/jsx-a11y/no-noninteractive-tabindex": "error",
|
|
57
|
+
"astro/jsx-a11y/no-redundant-roles": "error",
|
|
58
|
+
"astro/jsx-a11y/no-static-element-interactions": "error",
|
|
59
|
+
"astro/jsx-a11y/prefer-tag-over-role": "error",
|
|
60
|
+
"astro/jsx-a11y/role-has-required-aria-props": "error",
|
|
61
|
+
"astro/jsx-a11y/role-supports-aria-props": "error",
|
|
62
|
+
"astro/jsx-a11y/scope": "error",
|
|
63
|
+
"astro/jsx-a11y/tabindex-no-positive": "error",
|
|
15
64
|
},
|
|
16
65
|
});
|
package/config.react.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { ignores } from "./constants.js";
|
|
2
|
+
import { languageOptions } from "./eslint.config.js";
|
|
1
3
|
import react from "@eslint-react/eslint-plugin";
|
|
2
4
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
3
5
|
import tseslint from "typescript-eslint";
|
|
4
6
|
|
|
5
|
-
import { languageOptions } from "./eslint.config.js";
|
|
6
|
-
import { ignores } from "./constants.js";
|
|
7
|
-
import { reactRules } from "./setup/react.js";
|
|
8
|
-
|
|
9
7
|
export default tseslint.config({
|
|
10
8
|
files: ["**/*.{jsx,tsx}"],
|
|
11
9
|
ignores,
|
|
@@ -15,6 +13,81 @@ export default tseslint.config({
|
|
|
15
13
|
"react-hooks": reactHooks,
|
|
16
14
|
},
|
|
17
15
|
rules: {
|
|
18
|
-
|
|
16
|
+
"react-hooks/rules-of-hooks": "off",
|
|
17
|
+
"react-hooks/exhaustive-deps": "off",
|
|
18
|
+
"react/avoid-shorthand-boolean": "off",
|
|
19
|
+
"react/avoid-shorthand-fragment": "off",
|
|
20
|
+
"react/ensure-forward-ref-using-ref": "error",
|
|
21
|
+
"react/no-access-state-in-setstate": "error",
|
|
22
|
+
"react/no-array-index-key": "error",
|
|
23
|
+
"react/no-children-count": "error",
|
|
24
|
+
"react/no-children-for-each": "error",
|
|
25
|
+
"react/no-children-map": "error",
|
|
26
|
+
"react/no-children-only": "error",
|
|
27
|
+
"react/no-children-prop": "error",
|
|
28
|
+
"react/no-children-to-array": "error",
|
|
29
|
+
"react/no-class-component": "error",
|
|
30
|
+
"react/no-clone-element": "error",
|
|
31
|
+
"react/no-comment-textnodes": "error",
|
|
32
|
+
"react/no-complex-conditional-rendering": "error",
|
|
33
|
+
"react/no-complicated-conditional-rendering": "error",
|
|
34
|
+
"react/no-component-will-mount": "error",
|
|
35
|
+
"react/no-component-will-receive-props": "error",
|
|
36
|
+
"react/no-component-will-update": "error",
|
|
37
|
+
"react/no-create-ref": "error",
|
|
38
|
+
"react/no-default-props": "error",
|
|
39
|
+
"react/no-direct-mutation-state": "error",
|
|
40
|
+
"react/no-duplicate-key": "error",
|
|
41
|
+
"react/no-implicit-key": "error",
|
|
42
|
+
"react/no-leaked-conditional-rendering": "error",
|
|
43
|
+
"react/no-missing-component-display-name": "error",
|
|
44
|
+
"react/no-missing-key": "error",
|
|
45
|
+
"react/no-nested-components": "error",
|
|
46
|
+
"react/no-prop-types": "error",
|
|
47
|
+
"react/no-redundant-should-component-update": "error",
|
|
48
|
+
"react/no-set-state-in-component-did-mount": "error",
|
|
49
|
+
"react/no-set-state-in-component-did-update": "error",
|
|
50
|
+
"react/no-set-state-in-component-will-update": "error",
|
|
51
|
+
"react/no-string-refs": "error",
|
|
52
|
+
"react/no-unsafe-component-will-mount": "error",
|
|
53
|
+
"react/no-unsafe-component-will-receive-props": "error",
|
|
54
|
+
"react/no-unsafe-component-will-update": "error",
|
|
55
|
+
"react/no-unstable-context-value": "error",
|
|
56
|
+
"react/no-unstable-default-props": "error",
|
|
57
|
+
"react/no-unused-class-component-members": "error",
|
|
58
|
+
"react/no-unused-state": "error",
|
|
59
|
+
"react/no-useless-fragment": "error",
|
|
60
|
+
"react/prefer-destructuring-assignment": "error",
|
|
61
|
+
"react/prefer-read-only-props": "error",
|
|
62
|
+
"react/prefer-shorthand-boolean": "error",
|
|
63
|
+
"react/prefer-shorthand-fragment": "error",
|
|
64
|
+
"react/dom/no-children-in-void-dom-elements": "error",
|
|
65
|
+
"react/dom/no-dangerously-set-innerhtml": "error",
|
|
66
|
+
"react/dom/no-dangerously-set-innerhtml-with-children": "error",
|
|
67
|
+
"react/dom/no-find-dom-node": "error",
|
|
68
|
+
"react/dom/no-missing-button-type": "error",
|
|
69
|
+
"react/dom/no-missing-iframe-sandbox": "error",
|
|
70
|
+
"react/dom/no-namespace": "error",
|
|
71
|
+
"react/dom/no-render-return-value": "error",
|
|
72
|
+
"react/dom/no-script-url": "error",
|
|
73
|
+
"react/dom/no-unsafe-iframe-sandbox": "error",
|
|
74
|
+
"react/dom/no-unsafe-target-blank": "error",
|
|
75
|
+
"react/web-api/no-leaked-event-listener": "error",
|
|
76
|
+
"react/web-api/no-leaked-interval": "error",
|
|
77
|
+
"react/web-api/no-leaked-timeout": "error",
|
|
78
|
+
"react/hooks-extra/ensure-custom-hooks-using-other-hooks": "error",
|
|
79
|
+
"react/hooks-extra/ensure-use-callback-has-non-empty-deps": "error",
|
|
80
|
+
"react/hooks-extra/ensure-use-memo-has-non-empty-deps": "error",
|
|
81
|
+
"react/hooks-extra/no-direct-set-state-in-use-effect": "error",
|
|
82
|
+
"react/hooks-extra/no-direct-set-state-in-use-layout-effect": "error",
|
|
83
|
+
"react/hooks-extra/prefer-use-state-lazy-initialization": "error",
|
|
84
|
+
"react/naming-convention/component-name": "error",
|
|
85
|
+
"react/naming-convention/filename": ["error", { rule: "kebab-case" }],
|
|
86
|
+
"react/naming-convention/filename-extension": "error",
|
|
87
|
+
"react/naming-convention/use-state": "error",
|
|
88
|
+
"react/debug/class-component": "off",
|
|
89
|
+
"react/debug/function-component": "off",
|
|
90
|
+
"react/debug/is-from-react": "off",
|
|
91
|
+
"react/debug/react-hooks": "off",
|
|
19
92
|
},
|
|
20
93
|
});
|
package/config.solid.js
CHANGED
|
@@ -1,16 +1,33 @@
|
|
|
1
|
+
import { ignores } from "./constants.js";
|
|
2
|
+
import { languageOptions } from "./eslint.config.js";
|
|
1
3
|
import solid from "eslint-plugin-solid";
|
|
2
4
|
import tseslint from "typescript-eslint";
|
|
3
5
|
|
|
4
|
-
import { languageOptions } from "./eslint.config.js";
|
|
5
|
-
import { ignores } from "./constants.js";
|
|
6
|
-
import { solidRules } from "./setup/solid.js";
|
|
7
|
-
|
|
8
6
|
export default tseslint.config({
|
|
9
7
|
files: ["**/*.{jsx,tsx}"],
|
|
10
8
|
ignores,
|
|
11
9
|
languageOptions,
|
|
12
10
|
plugins: { solid },
|
|
13
11
|
rules: {
|
|
14
|
-
|
|
12
|
+
"solid/components-return-once": "error",
|
|
13
|
+
"solid/event-handlers": "error",
|
|
14
|
+
"solid/imports": "error",
|
|
15
|
+
"solid/jsx-no-duplicate-props": "error",
|
|
16
|
+
"solid/jsx-no-undef": "error",
|
|
17
|
+
"solid/jsx-no-script-url": "error",
|
|
18
|
+
"solid/jsx-uses-vars": "error",
|
|
19
|
+
"solid/no-destructure": "error",
|
|
20
|
+
"solid/no-innerhtml": "error",
|
|
21
|
+
"solid/no-proxy-apis": "off",
|
|
22
|
+
"solid/no-react-deps": "error",
|
|
23
|
+
"solid/no-react-specific-props": "error",
|
|
24
|
+
"solid/no-unknown-namespaces": "error",
|
|
25
|
+
"solid/prefer-classlist": "off",
|
|
26
|
+
"solid/prefer-for": "error",
|
|
27
|
+
"solid/prefer-show": "error",
|
|
28
|
+
"solid/reactivity": "error",
|
|
29
|
+
"solid/self-closing-comp": "error",
|
|
30
|
+
"solid/style-prop": "error",
|
|
31
|
+
"solid/no-array-handlers": "error",
|
|
15
32
|
},
|
|
16
33
|
});
|
package/eslint.config.js
CHANGED
|
@@ -320,6 +320,7 @@ export default tseslint.config(
|
|
|
320
320
|
"@typescript-eslint/no-base-to-string": "error",
|
|
321
321
|
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
322
322
|
"@typescript-eslint/no-confusing-void-expression": "error",
|
|
323
|
+
"@typescript-eslint/no-deprecated": "error",
|
|
323
324
|
"@typescript-eslint/no-dupe-class-members": "off",
|
|
324
325
|
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
325
326
|
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
package/package.json
CHANGED
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethang/eslint-config",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.2.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "git+https://github.com/eglove/eslint-config-ethang.git"
|
|
6
6
|
},
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"author": "Ethan Glover",
|
|
9
|
+
"type": "module",
|
|
7
10
|
"main": "eslint.config.js",
|
|
8
11
|
"scripts": {
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
},
|
|
12
|
-
"engines": {
|
|
13
|
-
"node": ">=20"
|
|
12
|
+
"build": "pnpx @eslint/config-inspector build",
|
|
13
|
+
"lint": "prettier . -w"
|
|
14
14
|
},
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
"license": "ISC",
|
|
18
|
-
"peerDependencies": {
|
|
19
|
-
"@eslint-react/eslint-plugin": "^1.12.1",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@eslint-react/eslint-plugin": "^1.12.2",
|
|
20
17
|
"@eslint/js": "^9.9.1",
|
|
21
18
|
"@eslint/json": "^0.4.0",
|
|
22
19
|
"@eslint/markdown": "^6.0.0",
|
|
23
20
|
"@stylistic/eslint-plugin": "^2.6.4",
|
|
24
21
|
"@tanstack/eslint-plugin-query": "^5.52.0",
|
|
25
|
-
"@typescript-eslint/parser": "^8.
|
|
22
|
+
"@typescript-eslint/parser": "^8.3.0",
|
|
26
23
|
"eslint": "^9.9.1",
|
|
27
24
|
"eslint-plugin-astro": "^1.2.3",
|
|
28
25
|
"eslint-plugin-barrel-files": "^2.1.0",
|
|
@@ -38,16 +35,23 @@
|
|
|
38
35
|
"eslint-plugin-tailwindcss": "^3.17.4",
|
|
39
36
|
"eslint-plugin-unicorn": "^55.0.0",
|
|
40
37
|
"typescript": "^5.5.4",
|
|
41
|
-
"typescript-eslint": "^8.
|
|
38
|
+
"typescript-eslint": "^8.3.0"
|
|
42
39
|
},
|
|
43
|
-
"
|
|
44
|
-
"@
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@ethang/markdown-generator": "^1.1.1",
|
|
42
|
+
"@ethang/project-builder": "^2.5.0",
|
|
43
|
+
"@tsconfig/node-lts": "^20.1.3",
|
|
44
|
+
"@tsconfig/strictest": "^2.0.5",
|
|
45
|
+
"prettier": "^3.3.3"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@eslint-react/eslint-plugin": "^1.12.2",
|
|
45
49
|
"@eslint/js": "^9.9.1",
|
|
46
50
|
"@eslint/json": "^0.4.0",
|
|
47
51
|
"@eslint/markdown": "^6.0.0",
|
|
48
52
|
"@stylistic/eslint-plugin": "^2.6.4",
|
|
49
53
|
"@tanstack/eslint-plugin-query": "^5.52.0",
|
|
50
|
-
"@typescript-eslint/parser": "^8.
|
|
54
|
+
"@typescript-eslint/parser": "^8.3.0",
|
|
51
55
|
"eslint": "^9.9.1",
|
|
52
56
|
"eslint-plugin-astro": "^1.2.3",
|
|
53
57
|
"eslint-plugin-barrel-files": "^2.1.0",
|
|
@@ -63,13 +67,9 @@
|
|
|
63
67
|
"eslint-plugin-tailwindcss": "^3.17.4",
|
|
64
68
|
"eslint-plugin-unicorn": "^55.0.0",
|
|
65
69
|
"typescript": "^5.5.4",
|
|
66
|
-
"typescript-eslint": "^8.
|
|
70
|
+
"typescript-eslint": "^8.3.0"
|
|
67
71
|
},
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"@ethang/project-builder": "^2.3.10",
|
|
71
|
-
"@tsconfig/node-lts": "^20.1.3",
|
|
72
|
-
"@tsconfig/strictest": "^2.0.5",
|
|
73
|
-
"prettier": "^3.3.3"
|
|
72
|
+
"engines": {
|
|
73
|
+
"node": ">=20"
|
|
74
74
|
}
|
|
75
75
|
}
|