chore: add pre-commit and pre-push git hooks for format and lint - #27
Merged
Conversation
- .githooks/pre-commit: runs `biome check --write` on staged TS/JS/JSON/HTML files, re-stages them, and aborts if unfixable errors remain - .githooks/pre-push: runs `biome lint` + `tsc --noEmit` before any push, blocking pushes that introduce lint or type errors - package.json: adds `prepare` script so `npm install` auto-registers .githooks as the hooks path via `git config core.hooksPath` https://claude.ai/code/session_01D8L26tFHVcgikgcTpcqoJe
Replace npx biome/tsc calls with ./node_modules/.bin/ paths to avoid pulling down a stale global version during hook execution. https://claude.ai/code/session_01D8L26tFHVcgikgcTpcqoJe
If node_modules binaries are missing, hooks now print an actionable message and exit cleanly instead of a cryptic "not found" error. https://claude.ai/code/session_01D8L26tFHVcgikgcTpcqoJe
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.
biome check --writeon staged TS/JS/JSON/HTMLfiles, re-stages them, and aborts if unfixable errors remain
biome lint+tsc --noEmitbefore any push,blocking pushes that introduce lint or type errors
preparescript sonpm installauto-registers.githooks as the hooks path via
git config core.hooksPathhttps://claude.ai/code/session_01D8L26tFHVcgikgcTpcqoJe