fix: modfiy githook to husky

This commit is contained in:
chen.home 2023-06-16 00:23:30 +08:00
parent f061fcd4ad
commit 2f8147f9b5
4 changed files with 12 additions and 8 deletions

4
.husky/commit-msg Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --edit $1

4
.husky/pre-commit Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged

View File

@ -1,7 +1,7 @@
{
"editor.tabSize": 2,
"editor.formatOnSave": false,
"eslint.format.enable": true,
"eslint.format.enable": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},

View File

@ -42,7 +42,7 @@
"build": "vue-tsc --noEmit && vite build",
"preview": "vite preview",
"lint": "eslint . --fix",
"prepare": "npx simple-git-hooks",
"prepare": "husky install",
"commit": "cz",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md"
},
@ -82,13 +82,13 @@
"cz-conventional-changelog": "^3.3.0",
"cz-customizable": "^7.0.0",
"eslint": "^8.36.0",
"husky": "^8.0.3",
"less": "^4.1.3",
"lint-staged": "^13.1.0",
"mockjs": "^1.1.0",
"naive-ui": "^2.34.4",
"rollup-plugin-visualizer": "^5.9.0",
"simple-git-hooks": "^2.8.1",
"typescript": "^5.1.3",
"typescript": "^5.0.0",
"unocss": "^0.53.1",
"unplugin-auto-import": "^0.16.4",
"unplugin-icons": "^0.16.3",
@ -101,10 +101,6 @@
"vite-plugin-vue-setup-extend": "^0.4.0",
"vue-tsc": "^1.6.5"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged",
"commit-msg": "pnpm commitlint -e"
},
"lint-staged": {
"*.{js,jsx,mjs,ts,tsx,json,md,yml}": [
"eslint --fix"