chore: add husky

This commit is contained in:
Seviche CC 2023-03-29 17:17:48 +08:00
parent e34e051f41
commit 3ae0fc76a7
Signed by: SevicheCC
GPG key ID: C577000000000000
3 changed files with 16 additions and 1 deletions

4
.husky/pre-commit Executable file
View file

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

View file

@ -8,7 +8,8 @@
"build": "vue-tsc && vite build", "build": "vue-tsc && vite build",
"preview": "vite preview", "preview": "vite preview",
"lint": "eslint .", "lint": "eslint .",
"lint:fix": "eslint . --fix" "lint:fix": "eslint . --fix",
"prepare": "husky install"
}, },
"dependencies": { "dependencies": {
"@egoist/tailwindcss-icons": "^1.0.7", "@egoist/tailwindcss-icons": "^1.0.7",
@ -33,6 +34,7 @@
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
"daisyui": "^2.51.5", "daisyui": "^2.51.5",
"eslint": "^8.36.0", "eslint": "^8.36.0",
"husky": "^8.0.3",
"postcss": "^8.4.21", "postcss": "^8.4.21",
"tailwindcss": "^3.2.7", "tailwindcss": "^3.2.7",
"typescript": "^5.0.2", "typescript": "^5.0.2",

View file

@ -63,6 +63,9 @@ devDependencies:
eslint: eslint:
specifier: ^8.36.0 specifier: ^8.36.0
version: 8.36.0 version: 8.36.0
husky:
specifier: ^8.0.3
version: 8.0.3
postcss: postcss:
specifier: ^8.4.21 specifier: ^8.4.21
version: 8.4.21 version: 8.4.21
@ -2565,6 +2568,12 @@ packages:
engines: {node: '>=10.17.0'} engines: {node: '>=10.17.0'}
dev: false dev: false
/husky@8.0.3:
resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==}
engines: {node: '>=14'}
hasBin: true
dev: true
/ignore@5.2.4: /ignore@5.2.4:
resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==}
engines: {node: '>= 4'} engines: {node: '>= 4'}