Skip to content

Commit

Permalink
feat: added git-conventional-commits to husky
Browse files Browse the repository at this point in the history
  • Loading branch information
zeddotes committed Oct 13, 2022
1 parent 3c588bf commit d910966
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
8 changes: 8 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# fix for windows systems
PATH="/c/Program Files/nodejs:$HOME/AppData/Roaming/npm/:$PATH"
pwd=$(pwd)
npx git-conventional-commits commit-msg-hook "$1"

6 changes: 3 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# #!/bin/sh
# . "$(dirname "$0")/_/husky.sh"
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# npm run pre-commit
npm run pre-commit
1 change: 0 additions & 1 deletion .husky/pre-commit.js

This file was deleted.

2 changes: 1 addition & 1 deletion git-conventional-commits.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"convention": {
"commitTypes": [
"featvcx",
"feat",
"fix",
"perf",
"refactor",
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"i-all": "npm i",
"test": "cross-env SKIP_PREFLIGHT_CHECK=true react-scripts test",
"test:unit": "jest --forceExit",
"pre-commit": "node ./.husky/pre-commit.js",
"pre-commit": "lint-staged",
"lint": "prettier --write \"*.{js,md}\" --write \".storybook/**/*.{js,jsx,ts,tsx,json,md,css}\" --write \"src/**/*.{js,jsx,ts,tsx,json,md}\"",
"eslint": "eslint src",
"prepare": "husky install",
Expand All @@ -41,9 +41,6 @@
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
},
"husky": {
"pre-commit": "npm run pre-commit"
},
"lint-staged": {
"src/**/*.{js,jsx,ts,tsx,json,md,css}": [
"prettier --write"
Expand Down

0 comments on commit d910966

Please sign in to comment.