Skip to content

Commit

Permalink
chore(package.json): add husky package
Browse files Browse the repository at this point in the history
1) Add `husky` package,
2) Add husky `prepare-commit-msg` hook in package.json to trigger
commitizen on `git commit`
3) Renaame commit script to git:commit to avoid conflict with husky
  • Loading branch information
emjimadhu committed Apr 14, 2020
1 parent 6aaddb3 commit e2d8b84
Show file tree
Hide file tree
Showing 2 changed files with 247 additions and 4 deletions.
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A Custom beautiful eslint formatter.",
"main": "dist/index.js",
"scripts": {
"commit": "git-cz",
"git:commit": "git-cz",
"preinstall": "$npm_execpath --silent run checkYarn",
"checkYarn": "echo \"$npm_execpath\" | grep -q \"yarn\\.js$\" || (echo '⚠️ Use YARN not NPM! ⚠️ ' && echo && exit 1)"
},
Expand Down Expand Up @@ -37,7 +37,13 @@
],
"devDependencies": {
"commitizen": "^4.0.4",
"cz-conventional-changelog": "3.1.0"
"cz-conventional-changelog": "3.1.0",
"husky": "^4.2.5"
},
"husky": {
"hooks": {
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true"
}
},
"config": {
"commitizen": {
Expand Down
Loading

0 comments on commit e2d8b84

Please sign in to comment.