Skip to content

ADR-0004: Lefthook owns Git hooks; quality tools stay pnpm / ESLint / Prettier

Status: Accepted

Context

The app is Next.js. Day-to-day quality is Prettier, ESLint, TypeScript, and Vitest, invoked through pnpm scripts. CI runs the same gate.

A Vite+ (vp) hook dispatcher was enabled locally while lefthook.yml described policy and called vp staged. That hybrid did not run: Vite+ had no project-owned hook scripts, Lefthook’s .git/hooks wrappers were ignored, and vp check is oxlint/oxfmt — not this repo’s ESLint + Prettier. Vite+ was never a package dependency.

Two reasonable owners existed: Vite+ (vp staged) or Lefthook calling the same CLIs as CI. Agent session hooks are a third, separate mechanism.

Decision

Lefthook is the only Git hook manager. Pre-commit runs Prettier then ESLint on staged files; pre-push runs typecheck and unit tests. Install is preparelefthook install.

Do not reintroduce Vite+ for lint, format, or Git hooks.

Consequences

  • Commit/push use the same tools as the CI quality gate.
  • New clones get hooks from pnpm install.
  • Agent session hooks stay independent of Lefthook.

See Lefthook.

Frontend Corner — agent ops, tooling, and decision records