chore: add commit hooks and conventional commit enforcement - #7
Merged
Conversation
husky wires two hooks. pre-commit runs lint-staged, which applies eslint --fix and prettier --write to staged files only, so formatting is fixed at the point of commit rather than caught later by CI. commit-msg runs commitlint against @commitlint/config-conventional. The type list is closed rather than left to the default, because release-please keys off these types and an unrecognised one would silently produce no release entry. Body and footer line-length rules are off: commit bodies here carry reasoning and pasted command output, and wrapping is a review concern rather than something to fail a commit over. A CI job lints the pull request title. That is the check that matters, because PRs are squash-merged, so the title becomes the commit subject on master and is what release-please reads. The commit-msg hook covers individual commits locally, but squashing discards them, so enforcing only locally would leave the one message that actually lands unchecked. Formatting and lint are already verified over the whole tree by npm test, which CI runs, so the hooks are a faster local echo of an existing check rather than new coverage.
This was referenced Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of three stacked PRs. Merge order is this, then #8, then #9; each
retargets to master as its parent lands.
husky wires two hooks:
pre-commitruns lint-staged —eslint --fixandprettier --writeoverstaged files only, so formatting is fixed at commit time rather than caught
later by CI.
commit-msgruns commitlint against@commitlint/config-conventional.The type list is closed rather than left to the default, because release-please
(#8) keys off these types and an unrecognised one would silently produce no
release entry. Body and footer line-length rules are off — commit bodies in this
repo carry reasoning and pasted command output, and wrapping is a review concern
rather than grounds to reject a commit.
The CI job lints the PR title, not the commits
We squash-merge, so the PR title becomes the commit subject on master, and that
is the message release-please will read. The
commit-msghook covers individualcommits locally, but squashing discards them — enforcing only locally would
leave the one message that actually lands unchecked.
Verified rather than assumed
with the allowed list.
WIP:commit while I was building this branch,which is the behaviour working as intended.
Formatting and lint are already checked across the whole tree by
npm test,which CI runs, so the hooks are a faster local echo of an existing check rather
than new coverage.