Skip to content

Commit

Permalink
chore: add commit hooks
Browse files Browse the repository at this point in the history
This adds a pre-commit hook that runs `eslint --fix` on any JS file on the stage.

It also adds a commit message check that verifies the commit message is in conventional commits format.
  • Loading branch information
boneskull committed Jul 25, 2023
1 parent 42c355b commit 96be7ee
Show file tree
Hide file tree
Showing 5 changed files with 2,273 additions and 869 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],
},
};

0 comments on commit 96be7ee

Please sign in to comment.