@houheaven/eslint-config-helper 3.0.0 → 3.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 +50 -0
- package/exports.js +3 -0
- package/lib/react.js +118 -0
- package/lib/supports/support-react-jsx.js +58 -0
- package/lib/supports/support-react-tsx.js +119 -0
- package/lib/supports/support-vue2-ts.js +65 -0
- package/lib/vue2.js +42 -0
- package/node_modules/@houheaven/eslint-config-helper-core/rules/react/_deprecated.js +29 -0
- package/node_modules/@houheaven/eslint-config-helper-core/rules/react/class-component.js +170 -0
- package/node_modules/@houheaven/eslint-config-helper-core/rules/react/dom.js +140 -0
- package/node_modules/@houheaven/eslint-config-helper-core/rules/react/fixable.js +239 -0
- package/node_modules/@houheaven/eslint-config-helper-core/rules/react/jsx.js +147 -0
- package/node_modules/@houheaven/eslint-config-helper-core/rules/react/prop-types.js +128 -0
- package/node_modules/@houheaven/eslint-config-helper-core/rules/react/suggestion.js +42 -0
- package/node_modules/@houheaven/eslint-config-helper-core/rules/react-hooks/_deprecated.js +19 -0
- package/node_modules/@houheaven/eslint-config-helper-core/rules/react-hooks/fixable.js +228 -0
- package/node_modules/@houheaven/eslint-config-helper-core/rules/react-hooks/other.js +19 -0
- package/node_modules/@houheaven/eslint-config-helper-core/summary.js +9 -1
- package/node_modules/@houheaven/eslint-config-helper-core/utils/utils.js +28 -0
- package/package.json +12 -14
|
@@ -53,6 +53,20 @@ const EslintRules = {
|
|
|
53
53
|
...require("../rules/vue/vue3-strongly-recommended.js").rules,
|
|
54
54
|
...require("../rules/vue/vue3-uncategorized.js").rules,
|
|
55
55
|
},
|
|
56
|
+
react: {
|
|
57
|
+
// ...require("../rules/react/_deprecated.js").rules,
|
|
58
|
+
...require("../rules/react/fixable.js").rules,
|
|
59
|
+
...require("../rules/react/suggestion.js").rules,
|
|
60
|
+
...require("../rules/react/jsx.js").rules,
|
|
61
|
+
...require("../rules/react/class-component.js").rules,
|
|
62
|
+
...require("../rules/react/prop-types.js").rules,
|
|
63
|
+
...require("../rules/react/dom.js").rules,
|
|
64
|
+
},
|
|
65
|
+
reactHooks: {
|
|
66
|
+
// ...require("../rules/react-hooks/_deprecated.js").rules,
|
|
67
|
+
...require("../rules/react-hooks/fixable.js").rules,
|
|
68
|
+
...require("../rules/react-hooks/other.js").rules,
|
|
69
|
+
},
|
|
56
70
|
};
|
|
57
71
|
|
|
58
72
|
|
|
@@ -73,6 +87,10 @@ function getRules(rules) {
|
|
|
73
87
|
...EslintRules.vue,
|
|
74
88
|
...EslintRules.vue2,
|
|
75
89
|
...EslintRules.vue3,
|
|
90
|
+
// react 规则
|
|
91
|
+
...EslintRules.react,
|
|
92
|
+
// react-hooks 规则
|
|
93
|
+
...EslintRules.reactHooks,
|
|
76
94
|
};
|
|
77
95
|
const ValidRules = {};
|
|
78
96
|
const InvalidRules = {};
|
|
@@ -138,6 +156,16 @@ function getWarnRules(type) {
|
|
|
138
156
|
...EslintRules.vue3,
|
|
139
157
|
};
|
|
140
158
|
break;
|
|
159
|
+
case "react":
|
|
160
|
+
rules = {
|
|
161
|
+
...EslintRules.react,
|
|
162
|
+
};
|
|
163
|
+
break;
|
|
164
|
+
case "react-hooks":
|
|
165
|
+
rules = {
|
|
166
|
+
...EslintRules.reactHooks,
|
|
167
|
+
};
|
|
168
|
+
break;
|
|
141
169
|
}
|
|
142
170
|
|
|
143
171
|
// 筛选规则
|
package/package.json
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@houheaven/eslint-config-helper",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Eslint 规则助手 (Flat Config)",
|
|
5
5
|
"author": "立树",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"private": false,
|
|
8
8
|
"type": "module",
|
|
9
|
-
"publishConfig": {
|
|
10
|
-
"access": "public",
|
|
11
|
-
"tag": "next"
|
|
12
|
-
},
|
|
13
9
|
"keywords": [
|
|
14
10
|
"houheaven",
|
|
15
11
|
"eslint",
|
|
@@ -21,13 +17,17 @@
|
|
|
21
17
|
},
|
|
22
18
|
"repository": {
|
|
23
19
|
"type": "git",
|
|
24
|
-
"url": "https://
|
|
20
|
+
"url": "https://github.com/houheaven/eslint-config-helper.git"
|
|
25
21
|
},
|
|
26
22
|
"bugs": {
|
|
27
|
-
"url": "https://
|
|
23
|
+
"url": "https://github.com/houheaven/eslint-config-helper/issues"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/houheaven/eslint-config-helper",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"lint": "eslint ."
|
|
28
28
|
},
|
|
29
|
-
"homepage": "https://gitee.com/houheaven/eslint-config-helper",
|
|
30
29
|
"dependencies": {
|
|
30
|
+
"@houheaven/eslint-config-helper-core": "workspace:*",
|
|
31
31
|
"@html-eslint/eslint-plugin": "0.58.1",
|
|
32
32
|
"@html-eslint/parser": "0.58.1",
|
|
33
33
|
"@stylistic/eslint-plugin": "5.10.0",
|
|
@@ -35,10 +35,11 @@
|
|
|
35
35
|
"@typescript-eslint/parser": "8.57.0",
|
|
36
36
|
"eslint-plugin-html": "8.1.4",
|
|
37
37
|
"eslint-plugin-import": "2.32.0",
|
|
38
|
+
"eslint-plugin-react": "7.37.5",
|
|
39
|
+
"eslint-plugin-react-hooks": "7.1.1",
|
|
38
40
|
"eslint-plugin-vue": "9.33.0",
|
|
39
41
|
"globals": "17.4.0",
|
|
40
|
-
"vue-eslint-parser": "^9.4.0"
|
|
41
|
-
"@houheaven/eslint-config-helper-core": "1.0.0"
|
|
42
|
+
"vue-eslint-parser": "^9.4.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"eslint": "9.39.4",
|
|
@@ -49,8 +50,5 @@
|
|
|
49
50
|
},
|
|
50
51
|
"bundledDependencies": [
|
|
51
52
|
"@houheaven/eslint-config-helper-core"
|
|
52
|
-
]
|
|
53
|
-
"scripts": {
|
|
54
|
-
"lint": "eslint ."
|
|
55
|
-
}
|
|
53
|
+
]
|
|
56
54
|
}
|