Skip to content

Commit cec43d7

Browse files
authored
fix: husky can not auto install issue after upgrade. (#2325)
1 parent a416f97 commit cec43d7

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
/_playwright-results
66
/lib
77
/node_modules
8+
/.husky/_
89

910
# exceptions
1011
!.gitkeep
1112
.vercel
13+

.husky/pre-commit

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run prettier
5+
npx lint-staged

package.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"jest": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
4444
"lint:fix": "eslint . --fix",
4545
"lint": "prettier . --check && eslint .",
46-
"postinstall": "opencollective-postinstall",
46+
"postinstall": "opencollective-postinstall && npx husky install",
4747
"prepare": "npm run build",
4848
"prettier": "prettier . --write",
4949
"pub:next": "cross-env RELEASE_TAG=next sh build/release.sh",
@@ -57,11 +57,6 @@
5757
"watch:css": "npm run build:css -- -w",
5858
"watch:js": "node build/build.js"
5959
},
60-
"husky": {
61-
"hooks": {
62-
"pre-commit": "lint-staged"
63-
}
64-
},
6560
"lint-staged": {
6661
"*.js": "eslint --fix"
6762
},

0 commit comments

Comments
 (0)