Skip to content

chore: migrate to oxfmt, oxlint and TypeScript 7 - #201

Open
Artmann wants to merge 1 commit into
mainfrom
chore/oxc-toolchain
Open

Artmann wants to merge 1 commit into
mainfrom
chore/oxc-toolchain

Conversation

@Artmann

@Artmann Artmann commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Prettier → oxfmt, ESLint → oxlint, TypeScript 5.7 → TypeScript 7 (the native
compiler, released as typescript@7.0.2).

Formatting

oxfmt --migrate=prettier carried .prettierrc.json over verbatim — every
option, including proseWrap: always and singleAttributePerLine — so the
rules are unchanged and oxfmt still covers md/json/css/yaml as well as TS.
Exactly two files reformatted, both a callback-with-object-literal that oxfmt
hugs:

-      return rows.map(
-        (row): TraceSummaryDto => ({
-          durationMs: row.durationMs,
+      return rows.map((row): TraceSummaryDto => ({
+        durationMs: row.durationMs,

.prettierignore became ignorePatterns in .oxfmtrc.json (which parses
JSONC, so the friction-log rationale came across intact), and the guard test
that keeps that list honest against doctor.config.json moved with it:
src/prettier-ignore.test.tssrc/format-ignore.test.ts.

Linting

.oxlintrc.json enables the import, oxc, typescript and unicorn
plugins, runs correctness at error, and keeps
typescript/no-explicit-any at error. yarn lint is oxlint --deny-warnings,
so the job no longer passes with findings sitting in it — which the old one did.

That meant fixing the three findings first:

  • DatabaseExplorer.tsx — unused useCollections import (ESLint warned about
    this too, and CI shipped it anyway).
  • exporter.test.ts(send.mock.calls[0]?.[0] as unknown[]).length throws a
    TypeError when the call is missing instead of failing the assertion. Replaced
    with one toEqual([100, 50]) over the mapped lengths, which also subsumes the
    toHaveBeenCalledTimes(2) above it.

Two eslint-disable-next-line comments naming rules that no longer exist are
deleted; the code lints clean without them.

import/no-unresolved has no oxlint equivalent (the resolver handles it) and
was off anyway, so it is gone rather than ported.

TypeScript 7

baseUrl was removed in 7, so tsconfig.base.json keeps only paths, which
now resolve relative to the config file that declares them — same result here,
since both sit in the repository root.

Worth knowing: the typescript package now ships the tsc binary and nothing
else — no tsserver.js, no compiler API. Nothing in this repository imports the
API, and @effect/language-service is loaded by the editor's own TypeScript
rather than this one, so the editor is unaffected unless it is explicitly
pointed at the workspace TypeScript. Noted in CLAUDE.md.

Verification

typecheck, lint, format:check, test (1607/1607), package and fallow
all pass locally.

before after
yarn typecheck 7.2s 1.8s
yarn lint 7.2s 0.4s
yarn format:check 2.6s 0.7s

yarn.lock loses ~1500 lines.

Follow-up

oxlint's type-aware rules (no-floating-promises and friends) need
oxlint-tsgolint; todo.md now tracks that in place of the "upgrade the lint
stack" item this closes.

🤖 Generated with Claude Code

https://claude.ai/code/session_0156WamccrozzRDnhxs9nRH7

Replaces Prettier with oxfmt, ESLint with oxlint, and TypeScript 5.7 with the
native TypeScript 7 compiler.

`oxfmt --migrate=prettier` carried the Prettier config over unchanged, so the
formatting rules are identical and only two files reformatted. The
`.prettierignore` patterns moved into `.oxfmtrc.json` as `ignorePatterns`,
comments and all, and `prettier-ignore.test.ts` follows them there as
`format-ignore.test.ts`.

`.oxlintrc.json` runs correctness as an error, `typescript/no-explicit-any` as
an error, and `--deny-warnings` fails the job on anything else, so the lint job
no longer passes with findings. The three findings that surfaced are fixed: an
unused import in `DatabaseExplorer`, and an optional chain in
`exporter.test.ts` that would have thrown a TypeError rather than failed an
assertion. Two `eslint-disable` comments for rules that no longer exist are
gone.

TypeScript 7 removed `baseUrl`, so `tsconfig.base.json` keeps only `paths`,
which resolve relative to the config that declares them. The `typescript`
package now ships `tsc` and nothing else; nothing here imports the compiler API.

Typecheck drops from 7s to 2s, lint from 7s to 0.4s.
@github-actions

Copy link
Copy Markdown
Contributor

React Doctor found no new issues. 🎉

Reviewed by React Doctor for commit cca8b97.

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.

1 participant