fix(precommit): pin @biomejs/biome@^1 in every bun x biome invocation #407
No reviewers
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks!407
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/precommit-biome-resolution"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Container worktrees have no
node_modules/, sobun x biome …resolved the barebiomenpm package — an unrelated tool that exits 0 silently without touching files. The husky pre-commit hook (bun x lint-staged→bun x biome check --write) therefore lied: every agent commit looked formatted but landed unformatted, and CI then caught the issue on the Forgejo Actions runner.This is the chain operators were seeing — "agent commits succeed but CI fails".
Reproduction
Reproduced live inside
claude-hooks-dev-default:After the pin:
Changes
Replace every
bun x biomewithbun x @biomejs/biome@^1in:package.json—qa,lint,lint:fix,fmt,fmt:checkscripts +lint-stagedconfig.apps/web/package.json—lintscript.justfile—lint,fmt,fmt-check,lint-fixrecipes.The
^1caret matches the existing devDependency pin (@biomejs/biome ^1.9.0).Why pin v1 (not latest v2)
@biomejs/biomev2 is out (2.4.13) but it's a major bump with config schema changes (organizeImports.enabled→assist.actions.source.organizeImports,overrides[].include→includes,files.ignore→files.includeswith!negation patterns) and new default lint rules.biome migrate --writerewrites the config automatically, but the new rule defaults will surface pre-existing lint failures across the repo. That's a separate PR with its own cleanup pass — keeping it out of this one so the hook fix can ship now.Test plan
claude-hooks-dev-default(see Reproduction above).just lint→Checked 8169 files in 3s. No fixes applied.just fmt-check→Checked 8169 files in 1353ms. No fixes applied.🤖 Generated with Claude Code
bun x biomeinvocationContainer worktrees have no `node_modules/`, so `bun x biome ...` resolved the bare `biome` npm package — an unrelated tool that exits 0 silently without touching files. The husky pre-commit hook (`bun x lint-staged` → `bun x biome check --write`) therefore lied: every commit looked formatted but landed unformatted, and CI then caught the issue on the Forgejo Actions runner. Reproduced inside `claude-hooks-dev-default`: $ echo "const x =1" > test.ts $ bun x biome check --write test.ts exit=0 $ cat test.ts const x =1 # untouched After pin: $ bun x @biomejs/biome@^1 check --write test.ts Checked 1 file in 1282µs. Fixed 1 file. exit=0 $ cat test.ts const x = 1; Replaces `bun x biome` with `bun x @biomejs/biome@^1` in: - root `package.json` scripts (qa, lint, lint:fix, fmt, fmt:check) and `lint-staged` config - `apps/web/package.json` lint script - `justfile` recipes (lint, fmt, fmt-check, lint-fix) The `^1` semver caret matches the existing devDependency pin (`@biomejs/biome ^1.9.0`); a v2 upgrade is a separate PR with its own config migration + rule cleanup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>