create-project-template-cli 1.0.0 → 1.0.1
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 +5 -5
- package/index.js +133 -133
- package/package.json +2 -2
- package/template/react-shadcn/.gitignore +24 -0
- package/template/react-shadcn/.husky/commit-msg +4 -4
- package/template/react-shadcn/.stylelintignore +19 -19
- package/template/react-shadcn/.stylelintrc.cjs +258 -258
- package/template/react-shadcn/.vscode/extensions.json +7 -7
- package/template/react-shadcn/README.md +75 -75
- package/template/react-shadcn/commitlint.config.cjs +90 -90
- package/template/react-shadcn/components.json +22 -22
- package/template/react-shadcn/eslint.config.js +58 -58
- package/template/react-shadcn/index.html +13 -13
- package/template/react-shadcn/lint-staged.config.cjs +4 -4
- package/template/react-shadcn/package.json +62 -62
- package/template/react-shadcn/pnpm-lock.yaml +4514 -4514
- package/template/react-shadcn/src/App.css +23 -23
- package/template/react-shadcn/src/App.tsx +20 -20
- package/template/react-shadcn/src/assets/css/tailwindcss.css +120 -120
- package/template/react-shadcn/src/components/ui/button.tsx +58 -58
- package/template/react-shadcn/src/components/ui/card.tsx +92 -92
- package/template/react-shadcn/src/components/ui/input.tsx +21 -21
- package/template/react-shadcn/src/components/ui/label.tsx +22 -22
- package/template/react-shadcn/src/components/ui/navigation-menu.tsx +168 -168
- package/template/react-shadcn/src/lib/utils.ts +6 -6
- package/template/react-shadcn/src/main.tsx +11 -11
- package/template/react-shadcn/src/router/index.tsx +71 -71
- package/template/react-shadcn/src/views/404/index.scss +133 -133
- package/template/react-shadcn/src/views/404/index.tsx +26 -26
- package/template/react-shadcn/src/views/Index/index.tsx +7 -7
- package/template/react-shadcn/src/views/index.tsx +58 -58
- package/template/react-shadcn/tsconfig.app.json +33 -33
- package/template/react-shadcn/tsconfig.json +13 -13
- package/template/react-shadcn/tsconfig.node.json +32 -32
- package/template/react-shadcn/vite.config.ts +36 -36
- package/template/vue-tailwindcss/.gitignore +30 -0
- package/utils.js +73 -73
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
# React + TypeScript + Vite
|
|
2
|
-
|
|
3
|
-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
-
|
|
5
|
-
Currently, two official plugins are available:
|
|
6
|
-
|
|
7
|
-
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
8
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
-
|
|
10
|
-
## React Compiler
|
|
11
|
-
|
|
12
|
-
The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information.
|
|
13
|
-
|
|
14
|
-
Note: This will impact Vite dev & build performances.
|
|
15
|
-
|
|
16
|
-
## Expanding the ESLint configuration
|
|
17
|
-
|
|
18
|
-
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
19
|
-
|
|
20
|
-
```js
|
|
21
|
-
export default defineConfig([
|
|
22
|
-
globalIgnores(['dist']),
|
|
23
|
-
{
|
|
24
|
-
files: ['**/*.{ts,tsx}'],
|
|
25
|
-
extends: [
|
|
26
|
-
// Other configs...
|
|
27
|
-
|
|
28
|
-
// Remove tseslint.configs.recommended and replace with this
|
|
29
|
-
tseslint.configs.recommendedTypeChecked,
|
|
30
|
-
// Alternatively, use this for stricter rules
|
|
31
|
-
tseslint.configs.strictTypeChecked,
|
|
32
|
-
// Optionally, add this for stylistic rules
|
|
33
|
-
tseslint.configs.stylisticTypeChecked,
|
|
34
|
-
|
|
35
|
-
// Other configs...
|
|
36
|
-
],
|
|
37
|
-
languageOptions: {
|
|
38
|
-
parserOptions: {
|
|
39
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
40
|
-
tsconfigRootDir: import.meta.dirname,
|
|
41
|
-
},
|
|
42
|
-
// other options...
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
])
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
49
|
-
|
|
50
|
-
```js
|
|
51
|
-
// eslint.config.js
|
|
52
|
-
import reactX from 'eslint-plugin-react-x'
|
|
53
|
-
import reactDom from 'eslint-plugin-react-dom'
|
|
54
|
-
|
|
55
|
-
export default defineConfig([
|
|
56
|
-
globalIgnores(['dist']),
|
|
57
|
-
{
|
|
58
|
-
files: ['**/*.{ts,tsx}'],
|
|
59
|
-
extends: [
|
|
60
|
-
// Other configs...
|
|
61
|
-
// Enable lint rules for React
|
|
62
|
-
reactX.configs['recommended-typescript'],
|
|
63
|
-
// Enable lint rules for React DOM
|
|
64
|
-
reactDom.configs.recommended,
|
|
65
|
-
],
|
|
66
|
-
languageOptions: {
|
|
67
|
-
parserOptions: {
|
|
68
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
69
|
-
tsconfigRootDir: import.meta.dirname,
|
|
70
|
-
},
|
|
71
|
-
// other options...
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
])
|
|
75
|
-
```
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## React Compiler
|
|
11
|
+
|
|
12
|
+
The React Compiler is enabled on this template. See [this documentation](https://react.dev/learn/react-compiler) for more information.
|
|
13
|
+
|
|
14
|
+
Note: This will impact Vite dev & build performances.
|
|
15
|
+
|
|
16
|
+
## Expanding the ESLint configuration
|
|
17
|
+
|
|
18
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
export default defineConfig([
|
|
22
|
+
globalIgnores(['dist']),
|
|
23
|
+
{
|
|
24
|
+
files: ['**/*.{ts,tsx}'],
|
|
25
|
+
extends: [
|
|
26
|
+
// Other configs...
|
|
27
|
+
|
|
28
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
29
|
+
tseslint.configs.recommendedTypeChecked,
|
|
30
|
+
// Alternatively, use this for stricter rules
|
|
31
|
+
tseslint.configs.strictTypeChecked,
|
|
32
|
+
// Optionally, add this for stylistic rules
|
|
33
|
+
tseslint.configs.stylisticTypeChecked,
|
|
34
|
+
|
|
35
|
+
// Other configs...
|
|
36
|
+
],
|
|
37
|
+
languageOptions: {
|
|
38
|
+
parserOptions: {
|
|
39
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
40
|
+
tsconfigRootDir: import.meta.dirname,
|
|
41
|
+
},
|
|
42
|
+
// other options...
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
])
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
49
|
+
|
|
50
|
+
```js
|
|
51
|
+
// eslint.config.js
|
|
52
|
+
import reactX from 'eslint-plugin-react-x'
|
|
53
|
+
import reactDom from 'eslint-plugin-react-dom'
|
|
54
|
+
|
|
55
|
+
export default defineConfig([
|
|
56
|
+
globalIgnores(['dist']),
|
|
57
|
+
{
|
|
58
|
+
files: ['**/*.{ts,tsx}'],
|
|
59
|
+
extends: [
|
|
60
|
+
// Other configs...
|
|
61
|
+
// Enable lint rules for React
|
|
62
|
+
reactX.configs['recommended-typescript'],
|
|
63
|
+
// Enable lint rules for React DOM
|
|
64
|
+
reactDom.configs.recommended,
|
|
65
|
+
],
|
|
66
|
+
languageOptions: {
|
|
67
|
+
parserOptions: {
|
|
68
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
69
|
+
tsconfigRootDir: import.meta.dirname,
|
|
70
|
+
},
|
|
71
|
+
// other options...
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
])
|
|
75
|
+
```
|
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
/** @type {import('cz-git').UserConfig} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
ignores: [(commit) => commit.includes("init")],
|
|
4
|
-
extends: ["@commitlint/config-conventional"],
|
|
5
|
-
rules: {
|
|
6
|
-
"body-leading-blank": [2, "always"],
|
|
7
|
-
"footer-leading-blank": [1, "always"],
|
|
8
|
-
"header-max-length": [2, "always", 108],
|
|
9
|
-
"subject-empty": [2, "never"],
|
|
10
|
-
"type-empty": [2, "never"],
|
|
11
|
-
"subject-case": [0],
|
|
12
|
-
"type-enum": [
|
|
13
|
-
2,
|
|
14
|
-
"always",
|
|
15
|
-
[
|
|
16
|
-
"feat",
|
|
17
|
-
"fix",
|
|
18
|
-
"docs",
|
|
19
|
-
"style",
|
|
20
|
-
"refactor",
|
|
21
|
-
"perf",
|
|
22
|
-
"test",
|
|
23
|
-
"build",
|
|
24
|
-
"ci",
|
|
25
|
-
"chore",
|
|
26
|
-
"revert",
|
|
27
|
-
"wip",
|
|
28
|
-
"workflow",
|
|
29
|
-
"types",
|
|
30
|
-
"release",
|
|
31
|
-
],
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
prompt: {
|
|
35
|
-
messages: {
|
|
36
|
-
type: "选择你要提交的类型 :",
|
|
37
|
-
scope: "选择一个提交范围[可选]:",
|
|
38
|
-
customScope: "请输入自定义的提交范围 :",
|
|
39
|
-
subject: "请简要描述提交 :\n",
|
|
40
|
-
body: '填写更加详细的变更描述[可选]。使用 "|" 换行 :\n',
|
|
41
|
-
breaking: '列举非兼容性重大的变更[可选]。使用 "|" 换行 :\n',
|
|
42
|
-
footerPrefixsSelect: "选择关联issue前缀[可选]:",
|
|
43
|
-
customFooterPrefixs: "输入自定义issue前缀 :",
|
|
44
|
-
footer: "列举关联issue [可选] 例如: #31, #I3244 :\n",
|
|
45
|
-
confirmCommit: "是否提交或修改commit ?",
|
|
46
|
-
},
|
|
47
|
-
types: [
|
|
48
|
-
{ value: "feat", name: "feat: ✨ 新增功能", emoji: "✨" },
|
|
49
|
-
{ value: "fix", name: "fix: 🐛 修复缺陷", emoji: "🐛" },
|
|
50
|
-
{ value: "docs", name: "docs: 📝 文档变更", emoji: "📝" },
|
|
51
|
-
{
|
|
52
|
-
value: "style",
|
|
53
|
-
name: "style: 💄 代码格式",
|
|
54
|
-
emoji: "💄",
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
value: "refactor",
|
|
58
|
-
name: "refactor: 🔨 代码重构",
|
|
59
|
-
emoji: "🔨",
|
|
60
|
-
},
|
|
61
|
-
{ value: "perf", name: "perf: ⚡️ 性能优化", emoji: "⚡️" },
|
|
62
|
-
{
|
|
63
|
-
value: "test",
|
|
64
|
-
name: "test: ✅ 测试",
|
|
65
|
-
emoji: "✅",
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
value: "build",
|
|
69
|
-
name: "build: 📦️ 打包构建",
|
|
70
|
-
emoji: "📦️",
|
|
71
|
-
},
|
|
72
|
-
{ value: "ci", name: "ci: 👷 CI 配置变更", emoji: "👷" },
|
|
73
|
-
{ value: "revert", name: "revert: ⏪️ 代码回退", emoji: "⏪️" },
|
|
74
|
-
{
|
|
75
|
-
value: "chore",
|
|
76
|
-
name: "chore: 🚀 构建/工程依赖/工具",
|
|
77
|
-
emoji: "🚀",
|
|
78
|
-
},
|
|
79
|
-
{ value: "wip", name: "wip: 🚧 正在开发中", emoji: "🚧" },
|
|
80
|
-
{ value: "workflow", name: "workflow: 🎯 工作流程改进", emoji: "🎯" },
|
|
81
|
-
],
|
|
82
|
-
useEmoji: true,
|
|
83
|
-
scopes: [],
|
|
84
|
-
customScopesAlign: "bottom",
|
|
85
|
-
emptyScopesAlias: "empty",
|
|
86
|
-
customScopesAlias: "custom",
|
|
87
|
-
allowBreakingChanges: ["feat", "fix"],
|
|
88
|
-
skipQuestions: ["scope", "body", "breaking", "footerPrefix", "footer"], // 自定义选择指定的问题不显示
|
|
89
|
-
},
|
|
90
|
-
};
|
|
1
|
+
/** @type {import('cz-git').UserConfig} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
ignores: [(commit) => commit.includes("init")],
|
|
4
|
+
extends: ["@commitlint/config-conventional"],
|
|
5
|
+
rules: {
|
|
6
|
+
"body-leading-blank": [2, "always"],
|
|
7
|
+
"footer-leading-blank": [1, "always"],
|
|
8
|
+
"header-max-length": [2, "always", 108],
|
|
9
|
+
"subject-empty": [2, "never"],
|
|
10
|
+
"type-empty": [2, "never"],
|
|
11
|
+
"subject-case": [0],
|
|
12
|
+
"type-enum": [
|
|
13
|
+
2,
|
|
14
|
+
"always",
|
|
15
|
+
[
|
|
16
|
+
"feat",
|
|
17
|
+
"fix",
|
|
18
|
+
"docs",
|
|
19
|
+
"style",
|
|
20
|
+
"refactor",
|
|
21
|
+
"perf",
|
|
22
|
+
"test",
|
|
23
|
+
"build",
|
|
24
|
+
"ci",
|
|
25
|
+
"chore",
|
|
26
|
+
"revert",
|
|
27
|
+
"wip",
|
|
28
|
+
"workflow",
|
|
29
|
+
"types",
|
|
30
|
+
"release",
|
|
31
|
+
],
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
prompt: {
|
|
35
|
+
messages: {
|
|
36
|
+
type: "选择你要提交的类型 :",
|
|
37
|
+
scope: "选择一个提交范围[可选]:",
|
|
38
|
+
customScope: "请输入自定义的提交范围 :",
|
|
39
|
+
subject: "请简要描述提交 :\n",
|
|
40
|
+
body: '填写更加详细的变更描述[可选]。使用 "|" 换行 :\n',
|
|
41
|
+
breaking: '列举非兼容性重大的变更[可选]。使用 "|" 换行 :\n',
|
|
42
|
+
footerPrefixsSelect: "选择关联issue前缀[可选]:",
|
|
43
|
+
customFooterPrefixs: "输入自定义issue前缀 :",
|
|
44
|
+
footer: "列举关联issue [可选] 例如: #31, #I3244 :\n",
|
|
45
|
+
confirmCommit: "是否提交或修改commit ?",
|
|
46
|
+
},
|
|
47
|
+
types: [
|
|
48
|
+
{ value: "feat", name: "feat: ✨ 新增功能", emoji: "✨" },
|
|
49
|
+
{ value: "fix", name: "fix: 🐛 修复缺陷", emoji: "🐛" },
|
|
50
|
+
{ value: "docs", name: "docs: 📝 文档变更", emoji: "📝" },
|
|
51
|
+
{
|
|
52
|
+
value: "style",
|
|
53
|
+
name: "style: 💄 代码格式",
|
|
54
|
+
emoji: "💄",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
value: "refactor",
|
|
58
|
+
name: "refactor: 🔨 代码重构",
|
|
59
|
+
emoji: "🔨",
|
|
60
|
+
},
|
|
61
|
+
{ value: "perf", name: "perf: ⚡️ 性能优化", emoji: "⚡️" },
|
|
62
|
+
{
|
|
63
|
+
value: "test",
|
|
64
|
+
name: "test: ✅ 测试",
|
|
65
|
+
emoji: "✅",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
value: "build",
|
|
69
|
+
name: "build: 📦️ 打包构建",
|
|
70
|
+
emoji: "📦️",
|
|
71
|
+
},
|
|
72
|
+
{ value: "ci", name: "ci: 👷 CI 配置变更", emoji: "👷" },
|
|
73
|
+
{ value: "revert", name: "revert: ⏪️ 代码回退", emoji: "⏪️" },
|
|
74
|
+
{
|
|
75
|
+
value: "chore",
|
|
76
|
+
name: "chore: 🚀 构建/工程依赖/工具",
|
|
77
|
+
emoji: "🚀",
|
|
78
|
+
},
|
|
79
|
+
{ value: "wip", name: "wip: 🚧 正在开发中", emoji: "🚧" },
|
|
80
|
+
{ value: "workflow", name: "workflow: 🎯 工作流程改进", emoji: "🎯" },
|
|
81
|
+
],
|
|
82
|
+
useEmoji: true,
|
|
83
|
+
scopes: [],
|
|
84
|
+
customScopesAlign: "bottom",
|
|
85
|
+
emptyScopesAlias: "empty",
|
|
86
|
+
customScopesAlias: "custom",
|
|
87
|
+
allowBreakingChanges: ["feat", "fix"],
|
|
88
|
+
skipQuestions: ["scope", "body", "breaking", "footerPrefix", "footer"], // 自定义选择指定的问题不显示
|
|
89
|
+
},
|
|
90
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
-
"style": "new-york",
|
|
4
|
-
"rsc": false,
|
|
5
|
-
"tsx": true,
|
|
6
|
-
"tailwind": {
|
|
7
|
-
"config": "",
|
|
8
|
-
"css": "src/assets/css/tailwindcss.css",
|
|
9
|
-
"baseColor": "slate",
|
|
10
|
-
"cssVariables": true,
|
|
11
|
-
"prefix": ""
|
|
12
|
-
},
|
|
13
|
-
"iconLibrary": "lucide",
|
|
14
|
-
"aliases": {
|
|
15
|
-
"components": "@/components",
|
|
16
|
-
"utils": "@/lib/utils",
|
|
17
|
-
"ui": "@/components/ui",
|
|
18
|
-
"lib": "@/lib",
|
|
19
|
-
"hooks": "@/hooks"
|
|
20
|
-
},
|
|
21
|
-
"registries": {}
|
|
22
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
+
"style": "new-york",
|
|
4
|
+
"rsc": false,
|
|
5
|
+
"tsx": true,
|
|
6
|
+
"tailwind": {
|
|
7
|
+
"config": "",
|
|
8
|
+
"css": "src/assets/css/tailwindcss.css",
|
|
9
|
+
"baseColor": "slate",
|
|
10
|
+
"cssVariables": true,
|
|
11
|
+
"prefix": ""
|
|
12
|
+
},
|
|
13
|
+
"iconLibrary": "lucide",
|
|
14
|
+
"aliases": {
|
|
15
|
+
"components": "@/components",
|
|
16
|
+
"utils": "@/lib/utils",
|
|
17
|
+
"ui": "@/components/ui",
|
|
18
|
+
"lib": "@/lib",
|
|
19
|
+
"hooks": "@/hooks"
|
|
20
|
+
},
|
|
21
|
+
"registries": {}
|
|
22
|
+
}
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import js from "@eslint/js";
|
|
2
|
-
import globals from "globals";
|
|
3
|
-
import reactHooks, { rules } 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";
|
|
7
|
-
|
|
8
|
-
export default defineConfig([
|
|
9
|
-
globalIgnores([
|
|
10
|
-
"dist",
|
|
11
|
-
"**/dist-ssr/**",
|
|
12
|
-
"**/coverage/**",
|
|
13
|
-
"**/node_modules/**",
|
|
14
|
-
"**/.history/**",
|
|
15
|
-
"**/src/assets/**",
|
|
16
|
-
]),
|
|
17
|
-
{
|
|
18
|
-
files: ["**/*.{ts,tsx}"],
|
|
19
|
-
extends: [
|
|
20
|
-
js.configs.recommended,
|
|
21
|
-
tseslint.configs.recommended,
|
|
22
|
-
reactHooks.configs["recommended-latest"],
|
|
23
|
-
reactRefresh.configs.vite,
|
|
24
|
-
],
|
|
25
|
-
languageOptions: {
|
|
26
|
-
ecmaVersion: 2020,
|
|
27
|
-
globals: globals.browser,
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
rules: {
|
|
31
|
-
...reactHooks.configs.recommended.rules,
|
|
32
|
-
"react-refresh/only-export-components": [
|
|
33
|
-
"warn",
|
|
34
|
-
{ allowConstantExport: true },
|
|
35
|
-
],
|
|
36
|
-
// 分号
|
|
37
|
-
semi: ["error", "always"],
|
|
38
|
-
// 不允许使用var
|
|
39
|
-
"no-var": "error",
|
|
40
|
-
// 未使用的变量
|
|
41
|
-
"no-unused-vars": [
|
|
42
|
-
"error",
|
|
43
|
-
{
|
|
44
|
-
argsIgnorePattern: "^_", // 忽略以下划线开头的未使用变量
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
// 常量必须const
|
|
48
|
-
"prefer-const": "error",
|
|
49
|
-
// 圈复杂度
|
|
50
|
-
complexity: ["error", 15],
|
|
51
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
52
|
-
// 不允许在条件判断中用复制运算符
|
|
53
|
-
"no-cond-assign": "error",
|
|
54
|
-
// 限制换行必须是LF
|
|
55
|
-
"linebreak-style": ["error", "unix"],
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
]);
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import reactHooks, { rules } 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";
|
|
7
|
+
|
|
8
|
+
export default defineConfig([
|
|
9
|
+
globalIgnores([
|
|
10
|
+
"dist",
|
|
11
|
+
"**/dist-ssr/**",
|
|
12
|
+
"**/coverage/**",
|
|
13
|
+
"**/node_modules/**",
|
|
14
|
+
"**/.history/**",
|
|
15
|
+
"**/src/assets/**",
|
|
16
|
+
]),
|
|
17
|
+
{
|
|
18
|
+
files: ["**/*.{ts,tsx}"],
|
|
19
|
+
extends: [
|
|
20
|
+
js.configs.recommended,
|
|
21
|
+
tseslint.configs.recommended,
|
|
22
|
+
reactHooks.configs["recommended-latest"],
|
|
23
|
+
reactRefresh.configs.vite,
|
|
24
|
+
],
|
|
25
|
+
languageOptions: {
|
|
26
|
+
ecmaVersion: 2020,
|
|
27
|
+
globals: globals.browser,
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
rules: {
|
|
31
|
+
...reactHooks.configs.recommended.rules,
|
|
32
|
+
"react-refresh/only-export-components": [
|
|
33
|
+
"warn",
|
|
34
|
+
{ allowConstantExport: true },
|
|
35
|
+
],
|
|
36
|
+
// 分号
|
|
37
|
+
semi: ["error", "always"],
|
|
38
|
+
// 不允许使用var
|
|
39
|
+
"no-var": "error",
|
|
40
|
+
// 未使用的变量
|
|
41
|
+
"no-unused-vars": [
|
|
42
|
+
"error",
|
|
43
|
+
{
|
|
44
|
+
argsIgnorePattern: "^_", // 忽略以下划线开头的未使用变量
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
// 常量必须const
|
|
48
|
+
"prefer-const": "error",
|
|
49
|
+
// 圈复杂度
|
|
50
|
+
complexity: ["error", 15],
|
|
51
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
52
|
+
// 不允许在条件判断中用复制运算符
|
|
53
|
+
"no-cond-assign": "error",
|
|
54
|
+
// 限制换行必须是LF
|
|
55
|
+
"linebreak-style": ["error", "unix"],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
]);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>management</title>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="root"></div>
|
|
11
|
-
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
-
</body>
|
|
13
|
-
</html>
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>management</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
"*.{js,jsx,ts,tsx}": ["pnpm run lint:fix"],
|
|
3
|
-
"*.{css,scss}": ["pnpm run stylelint:fix"],
|
|
4
|
-
};
|
|
1
|
+
module.exports = {
|
|
2
|
+
"*.{js,jsx,ts,tsx}": ["pnpm run lint:fix"],
|
|
3
|
+
"*.{css,scss}": ["pnpm run stylelint:fix"],
|
|
4
|
+
};
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-shadcn",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
|
-
"build": "tsc -b && vite build",
|
|
9
|
-
"lint": "eslint . --ignore-pattern dist/ --ignore-pattern .history --debug",
|
|
10
|
-
"lint:fix": "eslint . --ignore-pattern dist/ --ignore-pattern .history --fix",
|
|
11
|
-
"preview": "vite preview",
|
|
12
|
-
"stylelint": "stylelint ./**/*.{css,scss}",
|
|
13
|
-
"stylelint:fix": "stylelint ./**/*.{css,scss} --fix",
|
|
14
|
-
"prepare": "husky install",
|
|
15
|
-
"commit": "czg"
|
|
16
|
-
},
|
|
17
|
-
"commitizen": {
|
|
18
|
-
"path": "node_modules/cz-git"
|
|
19
|
-
},
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"@radix-ui/react-checkbox": "^1.3.3",
|
|
22
|
-
"@radix-ui/react-label": "^2.1.7",
|
|
23
|
-
"@radix-ui/react-navigation-menu": "^1.2.14",
|
|
24
|
-
"@radix-ui/react-slot": "^1.2.3",
|
|
25
|
-
"@tailwindcss/vite": "^4.1.13",
|
|
26
|
-
"class-variance-authority": "^0.7.1",
|
|
27
|
-
"clsx": "^2.1.1",
|
|
28
|
-
"lucide-react": "^0.544.0",
|
|
29
|
-
"react": "^19.1.1",
|
|
30
|
-
"react-dom": "^19.1.1",
|
|
31
|
-
"react-router": "^7.9.3",
|
|
32
|
-
"react-router-dom": "^7.9.3",
|
|
33
|
-
"tailwind-merge": "^3.3.1",
|
|
34
|
-
"tailwindcss": "^4.1.13"
|
|
35
|
-
},
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"@eslint/js": "^9.36.0",
|
|
38
|
-
"@types/node": "^24.5.2",
|
|
39
|
-
"@types/react": "^19.1.13",
|
|
40
|
-
"@types/react-dom": "^19.1.9",
|
|
41
|
-
"@vitejs/plugin-react": "^5.0.3",
|
|
42
|
-
"babel-plugin-react-compiler": "^19.1.0-rc.3",
|
|
43
|
-
"code-inspector-plugin": "^1.0.3",
|
|
44
|
-
"eslint": "^9.36.0",
|
|
45
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
46
|
-
"eslint-plugin-react-refresh": "^0.4.20",
|
|
47
|
-
"globals": "^16.4.0",
|
|
48
|
-
"husky": "^9.1.7",
|
|
49
|
-
"lint-staged": "^16.2.3",
|
|
50
|
-
"sass-embedded": "^1.93.2",
|
|
51
|
-
"stylelint": "^16.24.0",
|
|
52
|
-
"stylelint-config-recommended-scss": "^16.0.2",
|
|
53
|
-
"stylelint-config-standard": "^39.0.0",
|
|
54
|
-
"stylelint-config-standard-scss": "^16.0.0",
|
|
55
|
-
"stylelint-order": "^7.0.0",
|
|
56
|
-
"stylelint-scss": "^6.12.1",
|
|
57
|
-
"tw-animate-css": "^1.4.0",
|
|
58
|
-
"typescript": "~5.8.3",
|
|
59
|
-
"typescript-eslint": "^8.44.0",
|
|
60
|
-
"vite": "^7.1.7"
|
|
61
|
-
}
|
|
62
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "react-shadcn",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "tsc -b && vite build",
|
|
9
|
+
"lint": "eslint . --ignore-pattern dist/ --ignore-pattern .history --debug",
|
|
10
|
+
"lint:fix": "eslint . --ignore-pattern dist/ --ignore-pattern .history --fix",
|
|
11
|
+
"preview": "vite preview",
|
|
12
|
+
"stylelint": "stylelint ./**/*.{css,scss}",
|
|
13
|
+
"stylelint:fix": "stylelint ./**/*.{css,scss} --fix",
|
|
14
|
+
"prepare": "husky install",
|
|
15
|
+
"commit": "czg"
|
|
16
|
+
},
|
|
17
|
+
"commitizen": {
|
|
18
|
+
"path": "node_modules/cz-git"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
22
|
+
"@radix-ui/react-label": "^2.1.7",
|
|
23
|
+
"@radix-ui/react-navigation-menu": "^1.2.14",
|
|
24
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
25
|
+
"@tailwindcss/vite": "^4.1.13",
|
|
26
|
+
"class-variance-authority": "^0.7.1",
|
|
27
|
+
"clsx": "^2.1.1",
|
|
28
|
+
"lucide-react": "^0.544.0",
|
|
29
|
+
"react": "^19.1.1",
|
|
30
|
+
"react-dom": "^19.1.1",
|
|
31
|
+
"react-router": "^7.9.3",
|
|
32
|
+
"react-router-dom": "^7.9.3",
|
|
33
|
+
"tailwind-merge": "^3.3.1",
|
|
34
|
+
"tailwindcss": "^4.1.13"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@eslint/js": "^9.36.0",
|
|
38
|
+
"@types/node": "^24.5.2",
|
|
39
|
+
"@types/react": "^19.1.13",
|
|
40
|
+
"@types/react-dom": "^19.1.9",
|
|
41
|
+
"@vitejs/plugin-react": "^5.0.3",
|
|
42
|
+
"babel-plugin-react-compiler": "^19.1.0-rc.3",
|
|
43
|
+
"code-inspector-plugin": "^1.0.3",
|
|
44
|
+
"eslint": "^9.36.0",
|
|
45
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
46
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
47
|
+
"globals": "^16.4.0",
|
|
48
|
+
"husky": "^9.1.7",
|
|
49
|
+
"lint-staged": "^16.2.3",
|
|
50
|
+
"sass-embedded": "^1.93.2",
|
|
51
|
+
"stylelint": "^16.24.0",
|
|
52
|
+
"stylelint-config-recommended-scss": "^16.0.2",
|
|
53
|
+
"stylelint-config-standard": "^39.0.0",
|
|
54
|
+
"stylelint-config-standard-scss": "^16.0.0",
|
|
55
|
+
"stylelint-order": "^7.0.0",
|
|
56
|
+
"stylelint-scss": "^6.12.1",
|
|
57
|
+
"tw-animate-css": "^1.4.0",
|
|
58
|
+
"typescript": "~5.8.3",
|
|
59
|
+
"typescript-eslint": "^8.44.0",
|
|
60
|
+
"vite": "^7.1.7"
|
|
61
|
+
}
|
|
62
|
+
}
|