Skip to content

build: replace biome/ultracite with oxfmt, completing the oxc move - #34

Merged
mdugue merged 1 commit into
mainfrom
claude/stoic-mccarthy-2nyk67
Sep 21, 2026
Merged

mdugue merged 1 commit into
mainfrom
claude/stoic-mccarthy-2nyk67

Conversation

@mdugue

@mdugue mdugue commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Follow-up to #30, which brought oxlint in. This hands oxfmt the formatting too and drops biome and ultracite entirely. The toolchain is now oxlint + oxfmt.

The reformat is a non-event — that is the point

oxfmt and biome are both Prettier-compatible. With the formatter settings ultracite actually applied here (2 spaces, es5 trailing commas, 80 cols, double quotes), oxfmt reformats zero of the 120 source files. Only package.json key order moves.

⚠️ oxfmt --migrate=biome is not what produced .oxfmtrc.json. It reads biome's defaults — useTabs: true, trailingComma: "all" — not the ultracite preset that governs this repo. Taking it would have retabbed every file. The config mirrors the settings actually in force instead.

Markdown is excluded. oxfmt rewrites *em* → _em_ and, worse, strips the indent from continuation lines inside list items, detaching them from their bullet — it mangled AGENTS.md in exactly that way. biome was not reformatting these files either, so excluding them is parity, not a concession.

Lint coverage: ported rule by rule, not assumed

Dropping biome would silently drop everything it enforced, so .oxlintrc.json now names those rules explicitly: no-var, prefer-const, prefer-rest-params, no-unused-vars, eqeqeq, no-eval, no-implied-eval, no-self-compare, plus the typescript set (no-explicit-any, ban-ts-comment, no-namespace, no-empty-object-type, no-unsafe-function-type, …) and complexity at 20 in place of biome's cognitive-complexity cap. Each was re-probed against a deliberate violation to confirm it fires.

Two details are carried over from biome's own config rather than invented:

  • eqeqeq gets {"null": "ignore"} — surfaceId == null in lib/city/minimap.ts is a deliberate nullish check that biome permits by default. A config fix, not a code change.
  • test/spec files are exempt from complexity and no-explicit-any, which is what ultracite's preset did.

Why rules are listed individually instead of enabling categories

oxlint's default is correctness alone, which reports nothing here. Going broader is not free:

Category Findings on this repo
correctness 0
suspicious 213
pedantic 198
perf 5
restriction 677
style 6551

And the bulk is rules that do not fit this codebase — react-in-jsx-scope (154, obsolete under the modern JSX transform), no-inline-comments (108, fights the commenting style), no-underscore-dangle (45, __poc), max-lines-per-function (36, fights the scene-setup functions). Turning off those six leaves 34 findings, mostly a long tail of stylistic unicorn rules.

ultracite's own oxlint preset has the same problem — no-plusplus, prefer-destructuring, no-inline-comments — so adopting it is the same style refactor its biome preset was (the 451 violations recorded in #30). It also cannot be consumed: a JSON .oxlintrc.json can only extends JSON, and the presets are .mjs; the TS-config path is flagged experimental and needs Node, which CI does not use. With biome gone, ultracite had no remaining role.

Known cost, accepted

CSS is no longer linted. biome checked app/globals.css for unknown at-rules, unknown units and descending specificity; oxlint does not lint CSS at all, though oxfmt still formats it. Worth revisiting if oxc ships CSS rules.

Also prefer-rest-params is enabled but does not flag arguments in a plain function declaration, where biome's noArguments did.

Also in here

  • .vscode/settings.json and a new extensions.json point at oxc.oxc-vscode; the biome-specific source.organizeImports.biome action is gone.
  • Dependabot's lint-and-format group tracks oxlint + oxfmt.
  • Two stale biome-ignore comments in the e2e spec and a "(biome bans them)" aside in building-tint.ts are now plain prose.
  • devDependencies 16 → 14.

Verification

  • bun run verify — green (oxlint --max-warnings=0 → oxfmt --check → tsc → 149 unit tests)
  • bun run build — green
  • oxfmt --check — "All matched files use the correct format" across 121 files
  • Rule probes: no-var, prefer-const, ban-ts-comment, no-empty-object-type, no-explicit-any, no-namespace, no-unused-vars all confirmed firing from the config alone
  • e2e running locally; CI runs it too

🤖 Generated with Claude Code

https://claude.ai/code/session_01K4oDM5mtBbAtyPEZg9vKy8


Generated by Claude Code

oxlint already did the linting; this hands it the formatting too and
drops biome and ultracite entirely. The toolchain is now oxlint + oxfmt.

The reformat is a non-event, which is the point: oxfmt and biome are
both Prettier-compatible, so with the formatter settings ultracite
actually applied here (2 spaces, es5 trailing commas, 80 cols, double
quotes) oxfmt reformats ZERO of the 120 source files. Only package.json
key order moves. `oxfmt --migrate=biome` is NOT what produced
`.oxfmtrc.json` -- it reads biome's *defaults* (`useTabs: true`,
`trailingComma: "all"`), which would have retabbed the whole repo.

Markdown is excluded. oxfmt rewrites `*em*` to `_em_` and strips the
indent from continuation lines inside list items, which detaches them
from their bullet -- it mangled AGENTS.md in exactly that way. biome was
not reformatting these files either, so excluding them is parity, not a
concession.

`.oxlintrc.json` grows the rules biome was carrying, named one by one:
no-var, prefer-const, prefer-rest-params, no-unused-vars, eqeqeq,
no-eval, no-implied-eval, no-self-compare and the typescript set
(no-explicit-any, ban-ts-comment, no-namespace, no-empty-object-type,
no-unsafe-function-type, ...), plus `complexity` at 20 to replace
biome's cognitive-complexity cap. Each was re-probed against a
deliberate violation; they fire.

Two details carried over from biome's own config rather than invented:
`eqeqeq` gets `{"null": "ignore"}`, because `surfaceId == null` in
lib/city/minimap.ts is a deliberate nullish check that biome permits by
default; and test/spec files are exempt from `complexity` and
`no-explicit-any`, which is what ultracite's preset did.

Why the rules are listed individually instead of enabling categories:
oxlint's default is `correctness` alone, which reports nothing here.
Going broader is not free -- `-D suspicious -D pedantic` reports 411 and
`-D style` 6551, and the bulk is rules that do not fit this codebase
(`react-in-jsx-scope` is obsolete under the modern JSX transform,
`no-inline-comments` fights the commenting style, `max-lines-per-function`
fights the scene-setup functions). ultracite's oxlint preset has the same
problem -- `no-plusplus`, `prefer-destructuring`, `no-inline-comments` --
so it is the same style refactor its biome preset was, and a JSON
`.oxlintrc.json` cannot `extends` its `.mjs` files regardless.

Known cost, accepted: **CSS is no longer linted.** biome checked
app/globals.css for unknown at-rules, unknown units and descending
specificity; oxlint does not lint CSS at all, though oxfmt still formats
it. Also `prefer-rest-params` is enabled but does not flag `arguments`
in a plain function declaration where biome's `noArguments` did.

Also: VS Code settings and a new extensions.json point at
`oxc.oxc-vscode`; Dependabot's lint-and-format group tracks oxlint and
oxfmt; two stale `biome-ignore` comments in the e2e spec and a
"(biome bans them)" aside in building-tint.ts are now plain prose.

devDependencies: 16 -> 14.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K4oDM5mtBbAtyPEZg9vKy8
@vercel

vercel Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
bridge Ready Ready Preview Sep 21, 2026 9:52am UTC

Request Review

@mdugue
mdugue marked this pull request as ready for review September 21, 2026 09:57
@mdugue
mdugue merged commit 188cf43 into main Sep 21, 2026
8 checks passed

This branch was successfully deployed

1 active deployment
Preview — 5c1cfa54 Deployed Sep 21, 2026 by vercel[bot]
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