Skip to content

Commit

Permalink
chore: add commit hooks and prepare script
Browse files Browse the repository at this point in the history
- adds a pre-commit hook that runs `eslint --fix` on any JS file on the stage
- adds a commit message check that verifies the commit message is in conventional commits format
- adds `husky install` to workspace root `postinstall` script, to be run via `allow-scripts`
- adds a `prepare` lifecycle script which runs the `rebuild` script
- remove `preversion` script
  • Loading branch information
boneskull committed Jul 28, 2023
1 parent 9c47351 commit 95405c0
Show file tree
Hide file tree
Showing 5 changed files with 1,004 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .husky/commit-msg
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:commit -- --edit ${1}
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:staged
11 changes: 11 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [0],
'body-max-line-length': [0],
'footer-max-line-length': [0],
'header-max-length': [0],
'subject-case': [0],
'subject-full-stop': [0],
},
};
Loading

0 comments on commit 95405c0

Please sign in to comment.