Skip to content

Commit

Permalink
chore(husky): fix husky hooks (#599)
Browse files Browse the repository at this point in the history
Husky doesn't autoinstall anymore so the hooks have to be installed manually: https://blog.typicode.com/husky-git-hooks-autoinstall
  • Loading branch information
chimurai committed Nov 30, 2021
1 parent 761324a commit cf49e8b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .husky/commit-msg
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install lint-staged
7 changes: 1 addition & 6 deletions package.json
Expand Up @@ -86,6 +86,7 @@
"examples:browser:rollup:build": "cd examples/browser-rollup && npm install && npm run build",
"examples:node:commonjs:test": "cd examples/node-commonjs && npm install && npm test",
"examples:node:esmodules:test": "cd examples/node-esmodules && npm install && npm test",
"prepare": "husky install",
"lint": "npm run eslint:check && npm run prettier:check",
"eslint:check": "eslint src/ test/ examples/ *.js",
"eslint:fix": "eslint --fix src/ test/ examples/ *.js",
Expand All @@ -112,12 +113,6 @@
"type": "git",
"url": "https://github.com/uuidjs/uuid.git"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,jsx,json,md}": [
"prettier --write"
Expand Down

0 comments on commit cf49e8b

Please sign in to comment.