@resolid/config 1.0.2 → 1.0.5
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/package.json +8 -7
- package/src/eslint.react.js +21 -0
- package/src/eslint.typescript.js +3 -0
- package/tsconfig.base.json +15 -21
package/README.md
CHANGED
|
@@ -79,6 +79,6 @@ export default [...eslintBowser, ...eslintNode];
|
|
|
79
79
|
npx eslint-flat-config-viewer
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
##
|
|
82
|
+
## 致谢
|
|
83
83
|
|
|
84
|
-
- [
|
|
84
|
+
- [ESLint Config Inspector](https://github.com/eslint/config-inspector) 用于检查和理解 ESLint 平面配置的可视化工具。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@resolid/config",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "Resolid 通用配置",
|
|
@@ -28,19 +28,20 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@eslint/js": "^8.57.0",
|
|
30
30
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
31
|
-
"eslint-plugin-n": "^
|
|
31
|
+
"eslint-plugin-n": "^17.2.1",
|
|
32
32
|
"eslint-plugin-react": "^7.34.1",
|
|
33
33
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
34
|
+
"eslint-plugin-react-refresh": "^0.4.6",
|
|
35
|
+
"globals": "^15.0.0",
|
|
36
|
+
"typescript-eslint": "^7.7.1"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"eslint": "^8.57.0",
|
|
39
|
-
"typescript": "^5.4.
|
|
40
|
+
"typescript": "^5.4.5"
|
|
40
41
|
},
|
|
41
42
|
"peerDependencies": {
|
|
42
43
|
"eslint": "^8.57.0",
|
|
43
|
-
"typescript": "^5.4.
|
|
44
|
+
"typescript": "^5.4.5"
|
|
44
45
|
},
|
|
45
46
|
"peerDependenciesMeta": {
|
|
46
47
|
"typescript": {
|
|
@@ -50,7 +51,7 @@
|
|
|
50
51
|
"homepage": "https://resolid.tech",
|
|
51
52
|
"repository": {
|
|
52
53
|
"type": "git",
|
|
53
|
-
"url": "
|
|
54
|
+
"url": "https://github.com/huijiewei/resolid-config.git"
|
|
54
55
|
},
|
|
55
56
|
"scripts": {
|
|
56
57
|
"lint": "eslint ."
|
package/src/eslint.react.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
2
2
|
import react from "eslint-plugin-react";
|
|
3
3
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
4
|
+
import reactRefresh from "eslint-plugin-react-refresh";
|
|
4
5
|
import eslintTypescript from "./eslint.typescript.js";
|
|
5
6
|
|
|
6
7
|
/** @type {import('eslint').Linter.FlatConfig[]} */
|
|
@@ -10,11 +11,31 @@ export default [
|
|
|
10
11
|
files: ["**/*.{jsx,tsx}"],
|
|
11
12
|
plugins: {
|
|
12
13
|
react: react,
|
|
14
|
+
"react-refresh": reactRefresh,
|
|
13
15
|
},
|
|
14
16
|
rules: {
|
|
15
17
|
...react.configs.recommended.rules,
|
|
16
18
|
...react.configs["jsx-runtime"].rules,
|
|
17
19
|
"react/prop-types": "off",
|
|
20
|
+
"react-refresh/only-export-components": [
|
|
21
|
+
"warn",
|
|
22
|
+
{
|
|
23
|
+
allowConstantExport: true,
|
|
24
|
+
allowExportNames: [
|
|
25
|
+
"clientAction",
|
|
26
|
+
"clientLoader",
|
|
27
|
+
"ErrorBoundary",
|
|
28
|
+
"handle",
|
|
29
|
+
"HydrateFallback",
|
|
30
|
+
"Layout",
|
|
31
|
+
"links",
|
|
32
|
+
"meta",
|
|
33
|
+
"loader",
|
|
34
|
+
"action",
|
|
35
|
+
"shouldRevalidate",
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
],
|
|
18
39
|
},
|
|
19
40
|
languageOptions: {
|
|
20
41
|
parserOptions: {
|
package/src/eslint.typescript.js
CHANGED
|
@@ -6,5 +6,8 @@ export default typescript.config(...eslintBase, ...typescript.configs.recommende
|
|
|
6
6
|
rules: {
|
|
7
7
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
|
8
8
|
"@typescript-eslint/method-signature-style": ["error", "property"],
|
|
9
|
+
"@typescript-eslint/prefer-function-type": "error",
|
|
10
|
+
"@typescript-eslint/prefer-for-of": "error",
|
|
11
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
9
12
|
},
|
|
10
13
|
});
|
package/tsconfig.base.json
CHANGED
|
@@ -1,32 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"module": "ES2022",
|
|
10
|
-
"moduleResolution": "Bundler",
|
|
4
|
+
/* Base Options: */
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"target": "es2022",
|
|
8
|
+
"allowJs": true,
|
|
11
9
|
"resolveJsonModule": true,
|
|
12
10
|
"moduleDetection": "force",
|
|
13
|
-
|
|
14
|
-
// Emit
|
|
15
|
-
"noEmit": true,
|
|
11
|
+
"isolatedModules": true,
|
|
16
12
|
"verbatimModuleSyntax": true,
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"esModuleInterop": true,
|
|
23
|
-
"forceConsistentCasingInFileNames": true,
|
|
14
|
+
/* Strictness */
|
|
15
|
+
"strict": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"noImplicitOverride": true,
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
"
|
|
19
|
+
/* If NOT transpiling with TypeScript: */
|
|
20
|
+
"module": "preserve",
|
|
21
|
+
"noEmit": true,
|
|
28
22
|
|
|
29
|
-
|
|
30
|
-
"
|
|
23
|
+
/* If your code runs in the DOM: */
|
|
24
|
+
"lib": ["es2022", "dom", "dom.iterable"]
|
|
31
25
|
}
|
|
32
26
|
}
|