@chatbi-v/config 3.0.0 → 3.1.4
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 +10 -7
- package/eslint.mjs +25 -16
- package/package.json +4 -2
- package/tailwind.js +1 -1
package/README.md
CHANGED
|
@@ -23,8 +23,8 @@ export default [
|
|
|
23
23
|
// 你的自定义配置
|
|
24
24
|
rules: {
|
|
25
25
|
// ...
|
|
26
|
-
}
|
|
27
|
-
}
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
28
|
];
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -57,17 +57,17 @@ import baseConfig from '@chatbi-v/config/tailwind';
|
|
|
57
57
|
export default {
|
|
58
58
|
...baseConfig,
|
|
59
59
|
content: [
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
'./index.html',
|
|
61
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
62
62
|
// 如果是 Monorepo,可能需要包含其他包
|
|
63
|
-
|
|
63
|
+
'../../packages/ui/src/**/*.{js,ts,jsx,tsx}',
|
|
64
64
|
],
|
|
65
65
|
theme: {
|
|
66
66
|
extend: {
|
|
67
67
|
...baseConfig.theme.extend,
|
|
68
68
|
// 你的自定义主题
|
|
69
|
-
}
|
|
70
|
-
}
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
71
|
};
|
|
72
72
|
```
|
|
73
73
|
|
|
@@ -89,17 +89,20 @@ export default {
|
|
|
89
89
|
## 配置详情
|
|
90
90
|
|
|
91
91
|
### ESLint
|
|
92
|
+
|
|
92
93
|
- 基于 `eslint-config-standard`
|
|
93
94
|
- 集成 `@typescript-eslint`
|
|
94
95
|
- 集成 `eslint-plugin-react` 和 `eslint-plugin-react-hooks`
|
|
95
96
|
- 强制 import 排序 (`simple-import-sort`)
|
|
96
97
|
|
|
97
98
|
### Tailwind
|
|
99
|
+
|
|
98
100
|
- 预定义颜色系统(Primary, Secondary, Accent 等)
|
|
99
101
|
- 预定义阴影效果(Neon, Glass)
|
|
100
102
|
- 自动关闭 Preflight(避免与 Ant Design 冲突)
|
|
101
103
|
|
|
102
104
|
### TypeScript
|
|
105
|
+
|
|
103
106
|
- 严格模式 (`strict: true`)
|
|
104
107
|
- 目标版本 `ESNext`
|
|
105
108
|
- 模块解析 `bundler`
|
package/eslint.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import themePlugin from '@chatbi-v/eslint-plugin-theme';
|
|
|
16
16
|
|
|
17
17
|
export default [
|
|
18
18
|
{
|
|
19
|
-
ignores: ['**/dist/**', '**/build/**', '**/node_modules/**', '**/.trae/**'],
|
|
19
|
+
ignores: ['**/dist/**', '**/build/**', '**/node_modules/**', '**/.trae/**', 'packages/cli/templates/**'],
|
|
20
20
|
},
|
|
21
21
|
js.configs.recommended,
|
|
22
22
|
{
|
|
@@ -44,11 +44,14 @@ export default [
|
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
46
|
rules: {
|
|
47
|
-
'no-unused-vars': [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
'no-unused-vars': [
|
|
48
|
+
'warn',
|
|
49
|
+
{
|
|
50
|
+
argsIgnorePattern: '^_',
|
|
51
|
+
varsIgnorePattern: '^_',
|
|
52
|
+
caughtErrorsIgnorePattern: '^_',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
52
55
|
},
|
|
53
56
|
},
|
|
54
57
|
{
|
|
@@ -82,7 +85,7 @@ export default [
|
|
|
82
85
|
},
|
|
83
86
|
plugins: {
|
|
84
87
|
'@typescript-eslint': tsPlugin,
|
|
85
|
-
|
|
88
|
+
react: reactPlugin,
|
|
86
89
|
'react-hooks': reactHooksPlugin,
|
|
87
90
|
'simple-import-sort': simpleImportSortPlugin,
|
|
88
91
|
'@chatbi-v/theme': themePlugin,
|
|
@@ -98,12 +101,18 @@ export default [
|
|
|
98
101
|
'react/display-name': 'off', // TS inference is usually enough
|
|
99
102
|
'no-undef': 'off', // TS covers this
|
|
100
103
|
'@typescript-eslint/no-explicit-any': 'off', // Temporarily disabled for legacy code
|
|
101
|
-
'@typescript-eslint/no-unused-vars': [
|
|
102
|
-
|
|
104
|
+
'@typescript-eslint/no-unused-vars': [
|
|
105
|
+
'warn',
|
|
106
|
+
{ argsIgnorePattern: '^_' },
|
|
107
|
+
],
|
|
108
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
109
|
+
'error',
|
|
110
|
+
{ 'ts-expect-error': 'allow-with-description' },
|
|
111
|
+
],
|
|
103
112
|
'no-console': ['warn', { allow: ['warn', 'error', 'info'] }],
|
|
104
113
|
// Fix for no-unsafe-function-type in newer TS ESLint
|
|
105
|
-
'@typescript-eslint/no-unsafe-function-type': 'off',
|
|
106
|
-
|
|
114
|
+
'@typescript-eslint/no-unsafe-function-type': 'off',
|
|
115
|
+
|
|
107
116
|
// Theme Rules (error 级别阻止提交)
|
|
108
117
|
// '@chatbi-v/theme/no-hardcoded-colors': 'error',
|
|
109
118
|
// '@chatbi-v/theme/no-hardcoded-tailwind': 'error',
|
|
@@ -131,14 +140,14 @@ export default [
|
|
|
131
140
|
'**/utils/token-matcher.ts',
|
|
132
141
|
'**/*.test.ts',
|
|
133
142
|
'**/*.test.tsx',
|
|
134
|
-
'**/tests/**'
|
|
143
|
+
'**/tests/**',
|
|
135
144
|
],
|
|
136
145
|
rules: {
|
|
137
146
|
// '@chatbi-v/theme/no-hardcoded-colors': 'off',
|
|
138
147
|
// '@chatbi-v/theme/no-arbitrary-tailwind': 'off',
|
|
139
148
|
// '@chatbi-v/theme/no-hardcoded-tailwind': 'off',
|
|
140
149
|
// '@chatbi-v/theme/no-inline-styles': 'off'
|
|
141
|
-
}
|
|
150
|
+
},
|
|
142
151
|
},
|
|
143
152
|
// Allow @ts-nocheck in legacy UI components (pre-existing technical debt)
|
|
144
153
|
{
|
|
@@ -149,7 +158,7 @@ export default [
|
|
|
149
158
|
],
|
|
150
159
|
rules: {
|
|
151
160
|
'@typescript-eslint/ban-ts-comment': 'off',
|
|
152
|
-
}
|
|
161
|
+
},
|
|
153
162
|
},
|
|
154
163
|
// Disable strict react-hooks rules for pre-existing technical debt in plugins
|
|
155
164
|
{
|
|
@@ -166,7 +175,7 @@ export default [
|
|
|
166
175
|
'react/jsx-key': 'off',
|
|
167
176
|
'react-hooks/static-components': 'off',
|
|
168
177
|
'react/no-unescaped-entities': 'off',
|
|
169
|
-
}
|
|
178
|
+
},
|
|
170
179
|
},
|
|
171
180
|
prettierConfig,
|
|
172
|
-
];
|
|
181
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatbi-v/config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.4",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
"typescript": "^5.0.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"
|
|
39
|
+
"eslint-config-prettier": "^10.1.8",
|
|
40
|
+
"vitest": "^1.3.1",
|
|
41
|
+
"@chatbi-v/eslint-plugin-theme": "3.1.4"
|
|
40
42
|
}
|
|
41
43
|
}
|
package/tailwind.js
CHANGED