Skip to content

Commit

Permalink
chore(git): update git hooks & husky
Browse files Browse the repository at this point in the history
  • Loading branch information
mattallty committed Aug 28, 2023
1 parent f08752e commit 95e407c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint:fix
6 changes: 6 additions & 0 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

if [ $2 == "template" ]; then
exec </dev/tty && npx cz --hook || true
fi
8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"scripts": {
"lint": "eslint --ext .js,.ts,.tsx .",
"lint:fix": "eslint --fix .",
"lint:fix": "eslint --ext .js,.ts,.tsx --fix .",
"build": "rimraf dist && pnpm build:js",
"build:ci": "npm run build:all",
"build:all": "run-p -n build:js docs:build",
Expand Down Expand Up @@ -112,11 +112,5 @@
},
"publishConfig": {
"access": "public"
},
"husky": {
"hooks": {
"prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
"pre-commit": "npm run lint:fix && npm test"
}
}
}
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 95e407c

Please sign in to comment.