Skip to content

Commit c660579

Browse files
committed
perf: 升级依赖,优化prettierrc格式化,规范等
1 parent 0200b5f commit c660579

File tree

25 files changed

+708
-656
lines changed

25 files changed

+708
-656
lines changed

.commitlintrc.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export default {
2222
'mod', // 不确定分类的修改
2323
'wip', // 开发中
2424
'types', // 类型修改
25-
'release' // 版本发布
26-
]
25+
'release', // 版本发布
26+
],
2727
],
2828
'subject-full-stop': [0, 'never'],
29-
'subject-case': [0, 'never']
30-
}
29+
'subject-case': [0, 'never'],
30+
},
3131
};

.prettierrc.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
singleQuote: true, // 字符串是否使用单引号,默认为false,使用双引号
88
quoteProps: 'as-needed', // 对象键值对中的字符串是否需要加引号
99
bracketSpacing: true, // 对象大括号之间是否有空格,默认为true,效果:{ foo: bar }
10-
trailingComma: 'none', // 是否使用尾逗号,有三个可选值:"none", "es5", "all"
10+
trailingComma: 'all', // 是否使用尾逗号,有三个可选值:"none", "es5", "all"
1111
jsxSingleQuote: false, // JSX 中的字符串是否使用单引号
1212
arrowParens: 'always', // 箭头函数参数是否总是使用括号
1313
insertPragma: false, // 是否在文件顶部插入@format注释
@@ -26,6 +26,6 @@ export default {
2626
'^@/components/(.*)$', // 全局组件
2727
'^@/(hooks|store)(.*)$', // 自定义 hooks 和 store 统一分组
2828
'^@/(.*)$', // 其他 @/ 开头的模块
29-
'^[./]' // 当前文件夹和父文件夹的相对导入
30-
]
29+
'^[./]', // 当前文件夹和父文件夹的相对导入
30+
],
3131
};

.vscode/settings.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@
1313
"editor.tabSize": 2,
1414
// stylelint校验的文件格式
1515
"stylelint.validate": ["css", "scss", "html"],
16-
// md文件不自动格式化
17-
"[markdown]": {
18-
"editor.wordWrap": "on",
19-
"editor.quickSuggestions": {
20-
"comments": "off",
21-
"strings": "off",
22-
"other": "off"
23-
}
24-
},
2516
"[typescriptreact]": {
2617
"editor.defaultFormatter": "esbenp.prettier-vscode"
2718
},
@@ -39,5 +30,14 @@
3930
},
4031
"[html]": {
4132
"editor.defaultFormatter": "esbenp.prettier-vscode"
33+
},
34+
"[css]": {
35+
"editor.defaultFormatter": "esbenp.prettier-vscode"
36+
},
37+
"[scss]": {
38+
"editor.defaultFormatter": "esbenp.prettier-vscode"
39+
},
40+
"[markdown]": {
41+
"editor.defaultFormatter": "esbenp.prettier-vscode"
4242
}
4343
}

eslint.config.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ export default tseslint.config(
1313
files: ['**/*.{ts,tsx}'],
1414
languageOptions: {
1515
ecmaVersion: 2020,
16-
globals: globals.browser
16+
globals: globals.browser,
1717
},
1818
plugins: {
1919
react,
2020
'react-hooks': reactHooks,
21-
'react-refresh': reactRefresh
21+
'react-refresh': reactRefresh,
2222
},
2323
rules: {
2424
...reactHooks.configs.recommended.rules,
@@ -28,14 +28,14 @@ export default tseslint.config(
2828
'@typescript-eslint/no-unused-vars': 'off', // 禁用 TypeScript 未使用变量的警告
2929
'react-refresh/only-export-components': 'off', // 禁用 react-refresh 插件中仅导出组件的规则
3030
'@typescript-eslint/no-explicit-any': 'off', // 允许使用any
31-
'@typescript-eslint/no-unused-expressions': 'off' // 关闭对未使用的表达式的检查
31+
'@typescript-eslint/no-unused-expressions': 'off', // 关闭对未使用的表达式的检查
3232
// 'react-hooks/exhaustive-deps': 'off' // 关闭依赖项检查规则
3333
},
3434
languageOptions: {
3535
parserOptions: {
3636
project: ['./tsconfig.json'],
37-
tsconfigRootDir: import.meta.dirname
38-
}
39-
}
40-
}
37+
tsconfigRootDir: import.meta.dirname,
38+
},
39+
},
40+
},
4141
);

lint-staged.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
export default {
33
'*.{ts,tsx,js,jsx,cjs,mjs}': 'eslint --fix',
44
'*.{css,scss}': 'stylelint --fix',
5-
'*.{ts,tsx,js,jsx,cjs,mjs,html}': 'prettier --write'
5+
'*.{ts,tsx,js,jsx,cjs,mjs,html,css,scss,json}': 'prettier --write',
66
};

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"preview:pro": "pnpm vite preview -m pro",
3232
"ts:check": "tsc --noEmit",
3333
"lint:eslint": "eslint --max-warnings 0 \"**/*.{ts,tsx,js,jsx,cjs,mjs}\" --fix",
34-
"lint:format": "prettier --write \"**/*.{ts,tsx,js,jsx,cjs,mjs,html}\"",
34+
"lint:format": "prettier --write \"**/*.{ts,tsx,js,jsx,cjs,mjs,html,scss,css,json}\"",
3535
"lint:style": "stylelint \"**/*.{css,scss}\" --fix",
3636
"lint:all": "pnpm run lint:eslint && pnpm run lint:style && pnpm run lint:format",
3737
"lint:lint-staged": "lint-staged",
@@ -47,42 +47,42 @@
4747
"axios": "^1.7.9",
4848
"classnames": "^2.5.1",
4949
"dayjs": "^1.11.13",
50-
"es-toolkit": "^1.29.0",
50+
"es-toolkit": "^1.30.1",
5151
"immer": "^10.1.1",
5252
"react": "^19.0.0",
5353
"react-dom": "^19.0.0",
5454
"react-router": "^7.0.2",
5555
"zustand": "^5.0.2"
5656
},
5757
"devDependencies": {
58-
"@commitlint/cli": "^19.6.0",
58+
"@commitlint/cli": "^19.6.1",
5959
"@commitlint/config-conventional": "^19.6.0",
60-
"@commitlint/prompt-cli": "^19.6.0",
61-
"@eslint/js": "^9.16.0",
60+
"@commitlint/prompt-cli": "^19.6.1",
61+
"@eslint/js": "^9.17.0",
6262
"@react-dev-inspector/vite-plugin": "^2.0.1",
6363
"@trivago/prettier-plugin-sort-imports": "^5.2.0",
6464
"@types/node": "^22.10.2",
65-
"@types/react": "^19.0.1",
65+
"@types/react": "^19.0.2",
6666
"@types/react-dom": "^19.0.2",
6767
"@vitejs/plugin-react-swc": "^3.7.2",
68-
"eslint": "^9.16.0",
68+
"eslint": "^9.17.0",
6969
"eslint-plugin-react": "^7.37.2",
7070
"eslint-plugin-react-hooks": "^5.1.0",
7171
"eslint-plugin-react-refresh": "^0.4.16",
72-
"globals": "^15.13.0",
72+
"globals": "^15.14.0",
7373
"husky": "^9.1.7",
7474
"lint-staged": "^15.2.11",
7575
"prettier": "^3.4.2",
7676
"react-dev-inspector": "^2.0.1",
7777
"sass": "^1.83.0",
78-
"stylelint": "^16.11.0",
78+
"stylelint": "^16.12.0",
7979
"stylelint-config-recess-order": "^5.1.1",
8080
"stylelint-config-standard": "^36.0.1",
8181
"stylelint-config-standard-scss": "^14.0.0",
8282
"stylelint-order": "^6.0.4",
8383
"typescript": "~5.7.2",
84-
"typescript-eslint": "^8.18.0",
85-
"vite": "^6.0.3",
84+
"typescript-eslint": "^8.18.1",
85+
"vite": "^6.0.4",
8686
"vite-plugin-checker": "^0.8.0"
8787
},
8888
"engines": {

0 commit comments

Comments
 (0)