Skip to content

chore: auto-fix biome on staged files via pre-commit hook#373

Merged
drewstone merged 1 commit into
mainfrom
chore/biome-precommit-hook
Jun 24, 2026
Merged

chore: auto-fix biome on staged files via pre-commit hook#373
drewstone merged 1 commit into
mainfrom
chore/biome-precommit-hook

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

What

Adds a dependency-free git pre-commit hook that auto-fixes biome (lint + format) on staged files and re-stages them, so commits land clean.

  • .githooks/pre-commit runs biome check --write on staged *.{ts,tsx,js,jsx,json,jsonc} and re-stages them. No-op if biome is absent or nothing relevant is staged.
  • Wired via prepare: git config core.hooksPath .githooks (git-guarded, so a consumer's git-dep install is a no-op), then the existing tsup build.
  • Uses the biome already in devDeps — no husky, no lint-staged, no lockfile change.

Why

Matches agent-eval's auto-fix-on-commit behavior without adding the husky/lint-staged toolchain (which would need a lockfile bump on this repo).

Verified

Smoke: staged a badly-formatted file → hook reformatted it (const a = 2const a = 2) and re-staged it; the hook's own commit ran clean.

Adds a dependency-free git pre-commit hook (.githooks/pre-commit) that runs
biome check --write on staged source files and re-stages them, so commits land
lint+format clean. Wired through prepare (git config core.hooksPath .githooks,
git-guarded so consumer installs are a no-op); uses the biome already in deps —
no husky/lint-staged, no lockfile change.

@tangletools tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved PR — 46e68115

Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-24T12:41:13Z

@drewstone drewstone merged commit 240e7ca into main Jun 24, 2026
1 check passed
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