Skip to content

Commit 6da787c

Browse files
committed
chore: 工程配置升级
1 parent 3f779c4 commit 6da787c

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

.husky/commit-msg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
npx commitlint --edit "$1"
1+
# commit-msg
2+
3+
# https://commitlint.js.org/guides/local-setup.html
4+
npx --no -- commitlint --edit $1
5+

.husky/pre-commit

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1+
# pre-commit
2+
13
echo "node version = $(node -v)"
24
echo "npm version = $(npm -v)"
5+
6+
# https://github.com/lint-staged/lint-staged?tab=readme-ov-file#command-line-flags
37
npx lint-staged --allow-empty
4-
npx tsc --noEmit
8+
9+
# https://typicode.github.io/husky/get-started.html#scripting
10+
git update-index --again
11+
12+
# run pre-commit script
13+
npm run lint

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"build": "NODE_ENV=production vite build",
4343
"lint:js": "eslint",
4444
"lint:js:fix": "eslint --fix",
45-
"lint:type": " tsc --project tsconfig.json",
45+
"lint:type": " tsc --noEmit",
4646
"lint": "npm run lint:js && npm run lint:type",
4747
"lint:fix": "npm run lint:js:fix && npm run lint:type",
4848
"test": "vitest run",

0 commit comments

Comments
 (0)