Skip to content

chore: add pre-commit and pre-push git hooks for format and lint - #27

Merged
veillette merged 3 commits into
mainfrom
claude/add-format-lint-hooks-P9ASx
Feb 22, 2026
Merged

chore: add pre-commit and pre-push git hooks for format and lint#27
veillette merged 3 commits into
mainfrom
claude/add-format-lint-hooks-P9ASx

Conversation

@veillette

Copy link
Copy Markdown
Collaborator
  • .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

- .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
@veillette
veillette merged commit d1f76d0 into main Feb 22, 2026
1 check passed
@veillette
veillette deleted the claude/add-format-lint-hooks-P9ASx branch February 22, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants