Skip to content

Pre-commit hooks (lint-staged + Husky)

Problem

No pre-commit hooks existed. Lint errors and formatting issues could be committed and only caught in CI, slowing the feedback loop and creating noisy PRs with follow-up "fix lint" commits.

Proposal

  1. Install husky + lint-staged at root
  2. Pre-commit: biome check --write on staged .ts/.tsx/.js/.jsx/.css/.json files
  3. Pre-commit: prettier --write on staged .md/.mdx/.mdc files

Acceptance criteria

  • husky initialized with .husky/pre-commit
  • lint-staged config in root package.json
  • "prepare": "husky" script present (auto-installs hooks on npm install)
  • Biome formats TS/JS/CSS/JSON; Prettier formats markdown
  • --no-errors-on-unmatched prevents failures on deletions

Out of scope

  • Pre-push typecheck hook (can be added later if CI latency is a problem)
  • Commitlint / conventional commits enforcement

Notes / decisions log

  • 2026-07-07: Proposed. Planned to include --no-errors-on-unmatched for biome so staged deletions do not fail the hook.
  • 2026-07-09: Deferred — moved to tickets/deferred/; no active implementation planned.