feat: 优化代码提交流程 添加lint-staged

This commit is contained in:
alger
2025-09-14 00:21:07 +08:00
parent d8734f8302
commit 8f9c989815
3 changed files with 23 additions and 4 deletions

View File

@@ -1,2 +1,7 @@
echo "对已暂存文件运行 lint-staged..."
npx lint-staged
echo "运行类型检查..."
npm run typecheck
echo "所有检查通过,准备提交..."

View File

@@ -1,2 +1,7 @@
echo "对已暂存文件运行 lint-staged..."
npx lint-staged
echo "运行类型检查..."
npm run typecheck
echo "所有检查通过,准备提交..."

View File

@@ -7,8 +7,8 @@
"homepage": "https://github.com/algerkong/AlgerMusicPlayer",
"scripts": {
"prepare": "husky",
"format": "prettier --write .",
"lint": "eslint . --fix",
"format": "prettier --write ./src",
"lint": "eslint ./src --fix",
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
"typecheck:web": "vue-tsc --noEmit -p tsconfig.web.json --composite false",
"typecheck": "npm run typecheck:node && npm run typecheck:web",
@@ -22,6 +22,14 @@
"build:mac": "npm run build && electron-builder --mac",
"build:linux": "npm run build && electron-builder --linux"
},
"lint-staged": {
"*.{ts,tsx,vue,js}": [
"eslint --fix"
],
"*.{ts,tsx,vue,js,css,scss,md,json}": [
"prettier --write"
]
},
"dependencies": {
"@electron-toolkit/preload": "^3.0.1",
"@electron-toolkit/utils": "^4.0.0",
@@ -76,6 +84,7 @@
"eslint-plugin-vue": "^10.3.0",
"eslint-plugin-vue-scoped-css": "^2.11.0",
"globals": "^16.3.0",
"lint-staged": "^15.2.10",
"howler": "^2.2.4",
"lodash": "^4.17.21",
"marked": "^15.0.4",