Skip to content

Commit cf49e8b

Browse files
authoredNov 30, 2021
chore(husky): fix husky hooks (#599)
Husky doesn't autoinstall anymore so the hooks have to be installed manually: https://blog.typicode.com/husky-git-hooks-autoinstall
1 parent 761324a commit cf49e8b

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed
 

‎.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit $1

‎.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install lint-staged

‎package.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
"examples:browser:rollup:build": "cd examples/browser-rollup && npm install && npm run build",
8787
"examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test",
8888
"examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test",
89+
"prepare": "husky install",
8990
"lint": "npm run eslint:check && npm run prettier:check",
9091
"eslint:check": "eslint src/ test/ examples/ *.js",
9192
"eslint:fix": "eslint --fix src/ test/ examples/ *.js",
@@ -112,12 +113,6 @@
112113
"type": "git",
113114
"url": "https://github.com/uuidjs/uuid.git"
114115
},
115-
"husky": {
116-
"hooks": {
117-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
118-
"pre-commit": "lint-staged"
119-
}
120-
},
121116
"lint-staged": {
122117
"*.{js,jsx,json,md}": [
123118
"prettier --write"

0 commit comments

Comments
 (0)
Please sign in to comment.