@ethang/eslint-config 19.13.4 → 19.14.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 -1
- package/build/rule-list.ts +14 -1
- package/config.react.js +3 -0
- package/package.json +4 -2
- package/setup/react.ts +9 -0
package/README.md
CHANGED
|
@@ -31,10 +31,11 @@
|
|
|
31
31
|
- 52 rules for **Astro**
|
|
32
32
|
- `import astroConfig from "@ethang/eslint-config/config.astro.js";`
|
|
33
33
|
- 52 rules from [eslint-plugin-astro](https://github.com/ota-meshi/eslint-plugin-astro)
|
|
34
|
-
-
|
|
34
|
+
- 74 rules for **React**
|
|
35
35
|
- `import reactConfig from "@ethang/eslint-config/config.react.js";`
|
|
36
36
|
- 71 rules from [@eslint-react/eslint-plugin](https://eslint-react.xyz/)
|
|
37
37
|
- 2 rules from [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks)
|
|
38
|
+
- 1 rules from [eslint-plugin-react-compiler](https://github.com/facebook/react/tree/main/compiler/packages/eslint-plugin-react-compiler)
|
|
38
39
|
- 18 rules for **Solid**
|
|
39
40
|
- `import solidConfig from "@ethang/eslint-config/config.solid.js";`
|
|
40
41
|
- 18 rules from [eslint-plugin-solid](https://github.com/solidjs-community/eslint-plugin-solid)
|
package/build/rule-list.ts
CHANGED
|
@@ -10,7 +10,11 @@ import { lodashRules } from "../setup/lodash.ts";
|
|
|
10
10
|
import { markdownRules } from "../setup/markdown.ts";
|
|
11
11
|
import { nRules } from "../setup/n.ts";
|
|
12
12
|
import { perfectionistRules } from "../setup/perfectionist.ts";
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
reactCompilerRules,
|
|
15
|
+
reactHookRules,
|
|
16
|
+
reactRules,
|
|
17
|
+
} from "../setup/react.ts";
|
|
14
18
|
import { solidRules } from "../setup/solid.ts";
|
|
15
19
|
import { sonarRules } from "../setup/sonar.ts";
|
|
16
20
|
import { stylisticRules } from "../setup/stylistic.ts";
|
|
@@ -259,6 +263,15 @@ export const ruleList = [
|
|
|
259
263
|
type: "react",
|
|
260
264
|
url: "https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks",
|
|
261
265
|
},
|
|
266
|
+
{
|
|
267
|
+
importString: 'import reactCompiler from "eslint-plugin-react-compiler";',
|
|
268
|
+
list: reactCompilerRules,
|
|
269
|
+
name: "eslint-plugin-react-compiler",
|
|
270
|
+
pluginName: "react-compiler",
|
|
271
|
+
pluginValue: "reactCompiler",
|
|
272
|
+
type: "react",
|
|
273
|
+
url: "https://github.com/facebook/react/tree/main/compiler/packages/eslint-plugin-react-compiler",
|
|
274
|
+
},
|
|
262
275
|
{
|
|
263
276
|
importString: 'import solid from "eslint-plugin-solid";',
|
|
264
277
|
list: solidRules,
|
package/config.react.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ignores, languageOptions } from "./constants.js";
|
|
2
2
|
import react from "@eslint-react/eslint-plugin";
|
|
3
|
+
import reactCompiler from "eslint-plugin-react-compiler";
|
|
3
4
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
4
5
|
import tseslint from "typescript-eslint";
|
|
5
6
|
|
|
@@ -13,6 +14,7 @@ export default tseslint.config({
|
|
|
13
14
|
plugins: {
|
|
14
15
|
react: react,
|
|
15
16
|
"react-hooks": reactHooks,
|
|
17
|
+
"react-compiler": reactCompiler,
|
|
16
18
|
},
|
|
17
19
|
rules: {
|
|
18
20
|
"react/avoid-shorthand-boolean": "off",
|
|
@@ -96,5 +98,6 @@ export default tseslint.config({
|
|
|
96
98
|
"react/web-api/no-leaked-timeout": "error",
|
|
97
99
|
"react-hooks/exhaustive-deps": "error",
|
|
98
100
|
"react-hooks/rules-of-hooks": "error",
|
|
101
|
+
"react-compiler/react-compiler": "error",
|
|
99
102
|
},
|
|
100
103
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethang/eslint-config",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.14.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"url": "git+https://github.com/eglove/eslint-config-ethang.git"
|
|
6
6
|
},
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"eslint-plugin-lodash": "^8.0.0",
|
|
34
34
|
"eslint-plugin-n": "^17.11.1",
|
|
35
35
|
"eslint-plugin-perfectionist": "^3.9.1",
|
|
36
|
+
"eslint-plugin-react-compiler": "19.0.0-beta-8a03594-20241020",
|
|
36
37
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
37
38
|
"eslint-plugin-solid": "^0.14.3",
|
|
38
39
|
"eslint-plugin-sonarjs": "2.0.4",
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"@types/eslint-plugin-jsx-a11y": "^6.9.0",
|
|
50
51
|
"@types/eslint-plugin-tailwindcss": "^3.17.0",
|
|
51
52
|
"@types/eslint__js": "^8.42.3",
|
|
52
|
-
"@types/node": "^22.7.
|
|
53
|
+
"@types/node": "^22.7.8",
|
|
53
54
|
"prettier": "^3.3.3"
|
|
54
55
|
},
|
|
55
56
|
"peerDependencies": {
|
|
@@ -73,6 +74,7 @@
|
|
|
73
74
|
"eslint-plugin-lodash": "^8.0.0",
|
|
74
75
|
"eslint-plugin-n": "^17.11.1",
|
|
75
76
|
"eslint-plugin-perfectionist": "^3.9.1",
|
|
77
|
+
"eslint-plugin-react-compiler": "19.0.0-beta-8a03594-20241020",
|
|
76
78
|
"eslint-plugin-react-hooks": "^5.0.0",
|
|
77
79
|
"eslint-plugin-solid": "^0.14.3",
|
|
78
80
|
"eslint-plugin-sonarjs": "2.0.4",
|
package/setup/react.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import react from "@eslint-react/eslint-plugin";
|
|
2
2
|
// @ts-expect-error no types
|
|
3
3
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
4
|
+
// @ts-expect-error no types
|
|
5
|
+
import compiler from "eslint-plugin-react-compiler";
|
|
4
6
|
|
|
5
7
|
import { genRules, getNonDeprecatedRules } from "./gen-rules.ts";
|
|
6
8
|
|
|
@@ -59,6 +61,9 @@ const customHookRules = [
|
|
|
59
61
|
];
|
|
60
62
|
const hookGen = genRules(reactHookRuleNames, customHookRules, "react-hooks");
|
|
61
63
|
|
|
64
|
+
const reactCompilerRuleNames = Object.keys(compiler.rules);
|
|
65
|
+
const compilerGen = genRules(reactCompilerRuleNames, [], "react-compiler");
|
|
66
|
+
|
|
62
67
|
export const reactRules = {
|
|
63
68
|
...reactGen,
|
|
64
69
|
};
|
|
@@ -66,3 +71,7 @@ export const reactRules = {
|
|
|
66
71
|
export const reactHookRules = {
|
|
67
72
|
...hookGen,
|
|
68
73
|
};
|
|
74
|
+
|
|
75
|
+
export const reactCompilerRules = {
|
|
76
|
+
...compilerGen,
|
|
77
|
+
};
|