@lark-apaas/coding-templates 0.1.17 → 0.1.18
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/package.json
CHANGED
|
@@ -1,54 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import globals from 'globals'
|
|
3
|
-
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
-
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
5
|
-
import tseslint from 'typescript-eslint'
|
|
6
|
-
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
1
|
+
import { eslintPresets } from '@lark-apaas/coding-presets'
|
|
7
2
|
|
|
8
|
-
export default
|
|
9
|
-
|
|
10
|
-
{
|
|
3
|
+
export default [
|
|
4
|
+
// 客户端:React + TypeScript
|
|
5
|
+
...eslintPresets.client.map(config => config.ignores ? config : {
|
|
6
|
+
...config,
|
|
11
7
|
files: ['client/**/*.{ts,tsx}'],
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
reactRefresh.configs.vite,
|
|
17
|
-
],
|
|
18
|
-
languageOptions: {
|
|
19
|
-
ecmaVersion: 2020,
|
|
20
|
-
globals: globals.browser,
|
|
21
|
-
},
|
|
22
|
-
rules: {
|
|
23
|
-
// 关闭仅语法相关、不影响编译和运行时的规则
|
|
24
|
-
'react-refresh/only-export-components': 'off',
|
|
25
|
-
'@typescript-eslint/no-unused-vars': 'off',
|
|
26
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
27
|
-
'@typescript-eslint/no-empty-object-type': 'off',
|
|
28
|
-
'@typescript-eslint/no-require-imports': 'off',
|
|
29
|
-
'no-empty': 'off',
|
|
30
|
-
'prefer-const': 'off',
|
|
31
|
-
'no-unused-labels': 'off',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
{
|
|
8
|
+
}),
|
|
9
|
+
// 服务端:Node.js + TypeScript
|
|
10
|
+
...eslintPresets.server.map(config => config.ignores ? config : {
|
|
11
|
+
...config,
|
|
35
12
|
files: ['server/**/*.ts', 'shared/**/*.ts'],
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
tseslint.configs.recommended,
|
|
39
|
-
],
|
|
40
|
-
languageOptions: {
|
|
41
|
-
ecmaVersion: 2020,
|
|
42
|
-
globals: globals.node,
|
|
43
|
-
},
|
|
44
|
-
rules: {
|
|
45
|
-
'@typescript-eslint/no-unused-vars': 'off',
|
|
46
|
-
'@typescript-eslint/no-explicit-any': 'off',
|
|
47
|
-
'@typescript-eslint/no-empty-object-type': 'off',
|
|
48
|
-
'@typescript-eslint/no-require-imports': 'off',
|
|
49
|
-
'no-empty': 'off',
|
|
50
|
-
'prefer-const': 'off',
|
|
51
|
-
'no-unused-labels': 'off',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
])
|
|
13
|
+
}),
|
|
14
|
+
]
|
|
@@ -74,19 +74,15 @@
|
|
|
74
74
|
"zod": "^4.3.6"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@
|
|
77
|
+
"@lark-apaas/coding-presets": "^0.1.0",
|
|
78
78
|
"@lark-apaas/coding-vite-preset": "^0.1.0",
|
|
79
79
|
"@types/express": "^5",
|
|
80
80
|
"@types/node": "^24",
|
|
81
81
|
"@types/react": "^19",
|
|
82
82
|
"@types/react-dom": "^19",
|
|
83
83
|
"eslint": "^9",
|
|
84
|
-
"eslint-plugin-react-hooks": "^7",
|
|
85
|
-
"eslint-plugin-react-refresh": "^0.5",
|
|
86
|
-
"globals": "^17",
|
|
87
84
|
"tsx": "^4",
|
|
88
85
|
"typescript": "~5.9",
|
|
89
|
-
"typescript-eslint": "^8",
|
|
90
86
|
"vite": "^8"
|
|
91
87
|
}
|
|
92
88
|
}
|
|
@@ -1,28 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "@lark-apaas/coding-presets/lib/tsconfig/tsconfig.app.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
4
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
-
"target": "ES2023",
|
|
5
|
-
"useDefineForClassFields": true,
|
|
6
|
-
"lib": ["ES2023", "DOM", "DOM.Iterable"],
|
|
7
|
-
"module": "ESNext",
|
|
8
5
|
"types": ["vite/client"],
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
|
|
11
|
-
/* Bundler mode */
|
|
12
|
-
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
|
-
"verbatimModuleSyntax": true,
|
|
15
|
-
"moduleDetection": "force",
|
|
16
|
-
"noEmit": true,
|
|
17
|
-
"jsx": "react-jsx",
|
|
18
|
-
|
|
19
|
-
/* Linting */
|
|
20
|
-
"strict": true,
|
|
21
|
-
"noUnusedLocals": true,
|
|
22
|
-
"noUnusedParameters": true,
|
|
23
|
-
"erasableSyntaxOnly": true,
|
|
24
|
-
"noFallthroughCasesInSwitch": true,
|
|
25
|
-
"noUncheckedSideEffectImports": true,
|
|
26
6
|
"baseUrl": ".",
|
|
27
7
|
"paths": {
|
|
28
8
|
"@/*": ["./client/src/*"],
|
|
@@ -1,27 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "@lark-apaas/coding-presets/lib/tsconfig/tsconfig.node.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
4
|
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
-
"target": "ES2023",
|
|
5
|
-
"lib": ["ES2023"],
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"types": ["node"],
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
|
|
10
|
-
/* Bundler mode */
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"allowImportingTsExtensions": true,
|
|
13
|
-
"verbatimModuleSyntax": true,
|
|
14
|
-
"moduleDetection": "force",
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
/* Linting */
|
|
18
|
-
"strict": true,
|
|
19
|
-
"noUnusedLocals": true,
|
|
20
|
-
"noUnusedParameters": true,
|
|
21
|
-
"erasableSyntaxOnly": true,
|
|
22
|
-
"noFallthroughCasesInSwitch": true,
|
|
23
|
-
"noUncheckedSideEffectImports": true,
|
|
24
|
-
|
|
25
5
|
"baseUrl": ".",
|
|
26
6
|
"paths": {
|
|
27
7
|
"@shared/*": ["./shared/*"]
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "@lark-apaas/coding-presets/lib/tsconfig/tsconfig.node.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"target": "ES2023",
|
|
4
|
-
"lib": ["ES2023"],
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"types": ["node"],
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
"strict": true,
|
|
10
|
-
"erasableSyntaxOnly": true,
|
|
11
4
|
"outDir": "./dist/server",
|
|
12
5
|
"rootDir": ".",
|
|
6
|
+
"noEmit": false,
|
|
13
7
|
"baseUrl": ".",
|
|
14
8
|
"paths": {
|
|
15
9
|
"@shared/*": ["./shared/*"]
|