Skip to content

Commit

Permalink
chore: 工程配置升级
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudcome committed Dec 31, 2024
1 parent 3f779c4 commit 6da787c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
npx commitlint --edit "$1"
# commit-msg

# https://commitlint.js.org/guides/local-setup.html
npx --no -- commitlint --edit $1

11 changes: 10 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# pre-commit

echo "node version = $(node -v)"
echo "npm version = $(npm -v)"

# https://github.com/lint-staged/lint-staged?tab=readme-ov-file#command-line-flags
npx lint-staged --allow-empty
npx tsc --noEmit

# https://typicode.github.io/husky/get-started.html#scripting
git update-index --again

# run pre-commit script
npm run lint
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"build": "NODE_ENV=production vite build",
"lint:js": "eslint",
"lint:js:fix": "eslint --fix",
"lint:type": " tsc --project tsconfig.json",
"lint:type": " tsc --noEmit",
"lint": "npm run lint:js && npm run lint:type",
"lint:fix": "npm run lint:js:fix && npm run lint:type",
"test": "vitest run",
Expand Down

0 comments on commit 6da787c

Please sign in to comment.