Skip to content

Commit a449b74

Browse files
committed
feat: 添加 husky 预提交和预推送钩子,运行类型检查以确保代码质量
1 parent ad7b504 commit a449b74

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
echo "运行类型检查..."
2+
npm run typecheck

.husky/pre-push

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
echo "运行类型检查..."
2+
npm run typecheck

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"main": "./out/main/index.js",
77
"homepage": "https://github.com/algerkong/AlgerMusicPlayer",
88
"scripts": {
9+
"prepare": "husky",
910
"format": "prettier --write .",
1011
"lint": "eslint . --ext .js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts,.vue --fix",
1112
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
@@ -26,9 +27,10 @@
2627
"@unblockneteasemusic/server": "^0.27.8-patch.1",
2728
"cors": "^2.8.5",
2829
"electron-store": "^8.1.0",
29-
"express": "^4.18.2",
3030
"electron-updater": "^6.6.2",
31+
"express": "^4.18.2",
3132
"font-list": "^1.5.1",
33+
"husky": "^9.1.7",
3234
"netease-cloud-music-api-alger": "^4.26.1",
3335
"node-id3": "^0.2.9",
3436
"node-machine-id": "^1.1.12",
@@ -103,7 +105,9 @@
103105
{
104106
"from": "resources/html",
105107
"to": "html",
106-
"filter": ["**/*"]
108+
"filter": [
109+
"**/*"
110+
]
107111
}
108112
],
109113
"mac": {

0 commit comments

Comments
 (0)