fix: husky can not auto install issue after upgrade. (#2325)

This commit is contained in:
Koy Zhuang 2024-01-17 22:49:35 +08:00 committed by GitHub
parent a416f97237
commit cec43d7177
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 6 deletions

2
.gitignore vendored
View File

@ -5,7 +5,9 @@
/_playwright-results
/lib
/node_modules
/.husky/_
# exceptions
!.gitkeep
.vercel

5
.husky/pre-commit Executable file
View File

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

View File

@ -43,7 +43,7 @@
"jest": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
"lint:fix": "eslint . --fix",
"lint": "prettier . --check && eslint .",
"postinstall": "opencollective-postinstall",
"postinstall": "opencollective-postinstall && npx husky install",
"prepare": "npm run build",
"prettier": "prettier . --write",
"pub:next": "cross-env RELEASE_TAG=next sh build/release.sh",
@ -57,11 +57,6 @@
"watch:css": "npm run build:css -- -w",
"watch:js": "node build/build.js"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": "eslint --fix"
},