chore(biome): upgrade @biomejs/biome v1 → v2.4.13 #408

Merged
charles merged 2 commits from chore/biome-v2 into main 2026-04-26 23:32:55 +00:00
Collaborator

Summary

Major bump that lands the v2 line. #407 already pinned bun x @biomejs/biome@^1; this PR bumps the caret to ^2, runs biome migrate --write on the config, applies every safe + unsafe auto-fix v2 emits across the workspace, and disables the new lint rules that v2's recommended: true lights up — so the upgrade ships without a parallel codebase rewrite.

Stack on top of #407 (this branch was cut from fix/precommit-biome-resolution).

Config changes (biome.json)

  • $schema2.4.13.
  • organizeImports.enabled: trueassist.actions.source.organizeImports: "on".
  • overrides[].includeoverrides[].includes.
  • files.ignore: [...]files.includes: ["**", "!**/path", …] (negation patterns).
  • css.parser.tailwindDirectives: true so the v2 CSS parser stops rejecting @theme { … } in apps/web/src/styles/index.css.
  • Add !**/.claude to the includes ignore list — the worktree scratch dirs were being scanned and noisy.

Disabled v2 rules (follow-up scope)

recommended: true enabled several new rules that fire on real patterns we don't want to refactor in the same PR. Each is a legitimate guideline; tracking re-enable + fix as separate issues per category:

Rule Hits Reason to defer
a11y/useAriaPropsSupportedByRole 11 Real ARIA audit per component
a11y/noStaticElementInteractions 3 Need button/role refactor
suspicious/noArrayIndexKey 3 Need stable-key strategy per list
suspicious/noTemplateCurlyInString 1 Single test-file edge case
correctness/noInnerDeclarations 1 apps/web/index.html inline script
performance/noDelete 2 delete process.env.X in test cleanup

Code changes

  • Bump devDependency: "@biomejs/biome": "^2.4.13".
  • bun x @biomejs/biome@^1^2 in package.json (root + apps/web) and justfile (lint, fmt, fmt-check, lint-fix).
  • Auto-fixed 182 files via biome check --write (import sort, optional chains, simplifications).
  • Auto-fixed 2 more files via biome check --write --unsafe (unused-var rename to _var).
  • Hand fixes:
    • Replace <></> no-op return with null in apps/web/src/routes/agents.tsx; widen function return type to ReactElement | null.
    • Drop 6 dead biome-ignore suppressions whose underlying rules are now disabled or no longer fire (cost-sparkline.tsx, LabelMultiSelect.tsx, monitor.index.tsx, TestFireModal.tsx, flows-retention.test.ts, sweeper.test.ts).

Test plan

  • just lintChecked 422 files in 205ms. No fixes applied.
  • just fmt-checkChecked 421 files in 73ms. No fixes applied.
  • just typecheck → 4/4 turbo tasks ok.
  • bun test apps/server/src/ → 1994 pass / 5 fail. The 5 failures are pre-existing on main (verified with git stash + re-run on the unmodified tree) — unrelated to the upgrade.
  • Operator merges #407 first, then rebases this onto main — diff after rebase should be the same minus the ^1/^2 swap (already covered here).
  • Follow-up issues opened per disabled rule before merge (or as part of merge commit body).

🤖 Generated with Claude Code

## Summary Major bump that lands the v2 line. #407 already pinned `bun x @biomejs/biome@^1`; this PR bumps the caret to `^2`, runs `biome migrate --write` on the config, applies every safe + unsafe auto-fix v2 emits across the workspace, and disables the new lint rules that v2's `recommended: true` lights up — so the upgrade ships without a parallel codebase rewrite. **Stack on top of #407** (this branch was cut from `fix/precommit-biome-resolution`). ## Config changes (`biome.json`) - `$schema` → `2.4.13`. - `organizeImports.enabled: true` → `assist.actions.source.organizeImports: "on"`. - `overrides[].include` → `overrides[].includes`. - `files.ignore: [...]` → `files.includes: ["**", "!**/path", …]` (negation patterns). - `css.parser.tailwindDirectives: true` so the v2 CSS parser stops rejecting `@theme { … }` in `apps/web/src/styles/index.css`. - Add `!**/.claude` to the includes ignore list — the worktree scratch dirs were being scanned and noisy. ## Disabled v2 rules (follow-up scope) `recommended: true` enabled several new rules that fire on real patterns we don't want to refactor in the same PR. Each is a legitimate guideline; tracking re-enable + fix as separate issues per category: | Rule | Hits | Reason to defer | |---|---|---| | `a11y/useAriaPropsSupportedByRole` | 11 | Real ARIA audit per component | | `a11y/noStaticElementInteractions` | 3 | Need button/role refactor | | `suspicious/noArrayIndexKey` | 3 | Need stable-key strategy per list | | `suspicious/noTemplateCurlyInString` | 1 | Single test-file edge case | | `correctness/noInnerDeclarations` | 1 | `apps/web/index.html` inline script | | `performance/noDelete` | 2 | `delete process.env.X` in test cleanup | ## Code changes - Bump devDependency: `"@biomejs/biome": "^2.4.13"`. - `bun x @biomejs/biome@^1` → `^2` in `package.json` (root + apps/web) and `justfile` (`lint`, `fmt`, `fmt-check`, `lint-fix`). - Auto-fixed **182 files** via `biome check --write` (import sort, optional chains, simplifications). - Auto-fixed **2 more files** via `biome check --write --unsafe` (unused-var rename to `_var`). - Hand fixes: - Replace `<></>` no-op return with `null` in `apps/web/src/routes/agents.tsx`; widen function return type to `ReactElement | null`. - Drop 6 dead `biome-ignore` suppressions whose underlying rules are now disabled or no longer fire (`cost-sparkline.tsx`, `LabelMultiSelect.tsx`, `monitor.index.tsx`, `TestFireModal.tsx`, `flows-retention.test.ts`, `sweeper.test.ts`). ## Test plan - [x] `just lint` → `Checked 422 files in 205ms. No fixes applied.` - [x] `just fmt-check` → `Checked 421 files in 73ms. No fixes applied.` - [x] `just typecheck` → 4/4 turbo tasks ok. - [x] `bun test apps/server/src/` → 1994 pass / 5 fail. The 5 failures are **pre-existing on main** (verified with `git stash` + re-run on the unmodified tree) — unrelated to the upgrade. - [ ] Operator merges `#407` first, then rebases this onto `main` — diff after rebase should be the same minus the `^1`/`^2` swap (already covered here). - [ ] Follow-up issues opened per disabled rule before merge (or as part of merge commit body). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(precommit): pin @biomejs/biome@^1 in every bun x biome invocation
All checks were successful
qa / qa (pull_request) Successful in 7m2s
qa / dockerfile (pull_request) Successful in 13s
3fa969b00b
Container 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>
chore(biome): upgrade @biomejs/biome v1 → v2.4.13
Some checks are pending
qa / qa (pull_request) Waiting to run
qa / dockerfile (pull_request) Waiting to run
ecb6cb6221
Major bump that lands the v2 line. The hook fix in #407 already pinned
`bun x @biomejs/biome@^1`; this PR bumps the caret to `^2`, runs
`biome migrate --write` on the config, applies every safe + unsafe
auto-fix v2 emits across the workspace, and disables the new lint
rules that v2's `recommended: true` lights up so the upgrade ships
without a parallel codebase rewrite.

Config changes (`biome.json`):
- Schema URL → `2.4.13`.
- `organizeImports.enabled: true` → `assist.actions.source.organizeImports: "on"`.
- `overrides[].include` → `includes`.
- `files.ignore: [...]` → `files.includes: ["**", "!**/path", ...]` with negation patterns.
- `css.parser.tailwindDirectives: true` so the v2 CSS parser stops
  rejecting `@theme { … }` in `apps/web/src/styles/index.css`.
- Disable new-in-v2 rules that fire on existing patterns we don't
  want to refactor in this PR: `a11y/useAriaPropsSupportedByRole`,
  `a11y/noStaticElementInteractions`, `suspicious/noArrayIndexKey`,
  `suspicious/noTemplateCurlyInString`, `correctness/noInnerDeclarations`,
  `performance/noDelete`. Each is a real guideline — follow-up issues
  to re-enable + fix per rule, not blocking the version bump.
- Add `!**/.claude` to the ignore list — the `.claude/worktrees/`
  scratch dirs were getting scanned and noisy.

Code changes:
- `bun x @biomejs/biome@^1` → `^2` in `package.json` (root + apps/web)
  and `justfile` (`lint`, `fmt`, `fmt-check`, `lint-fix`).
- Bump devDependency to `@biomejs/biome ^2.4.13`.
- Auto-fixed 182 files via `biome check --write` (import sort,
  optional chains, useless `else` simplifications).
- Auto-fixed 2 more files via `biome check --write --unsafe`
  (unused-variable rename to `_var` prefix).
- Apps/web hand fixes: replace `<></>` no-op return with `null`
  (`agents.tsx`, with the function's return type widened to
  `ReactElement | null`), drop dead `biome-ignore` suppressions
  whose underlying rules are now disabled or no longer fire
  (`cost-sparkline.tsx`, `LabelMultiSelect.tsx`, `monitor.index.tsx`,
  `TestFireModal.tsx`, `flows-retention.test.ts`, `sweeper.test.ts`).

QA:
- `just lint` → `Checked 422 files in 205ms. No fixes applied.`
- `just fmt-check` → `Checked 421 files in 73ms. No fixes applied.`
- `just typecheck` → 4/4 turbo tasks ok.
- `bun test apps/server/src/` → 1994 pass / 5 fail. The 5 failures
  are pre-existing on main (verified by `git stash` then re-running
  on the unmodified tree) — unrelated to the upgrade.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
charles force-pushed chore/biome-v2 from ecb6cb6221
Some checks are pending
qa / qa (pull_request) Waiting to run
qa / dockerfile (pull_request) Waiting to run
to 4663ca3c99
Some checks failed
qa / qa (pull_request) Failing after 2m30s
qa / dockerfile (pull_request) Successful in 7s
2026-04-26 23:15:11 +00:00
Compare
chore(biome): refresh bun.lock for @biomejs/biome@^2
All checks were successful
qa / qa (pull_request) Successful in 9m45s
qa / dockerfile (pull_request) Successful in 10s
9cae498234
Resolves CI 'lockfile is frozen' error after rebase onto main.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
charles deleted branch chore/biome-v2 2026-04-26 23:32:56 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!408
No description provided.