Skip to content

chore: replace Biome with oxlint, oxfmt and Knip - #7

Open
Thomasims wants to merge 4 commits into
mainfrom
chore/oxc-tooling
Open

chore: replace Biome with oxlint, oxfmt and Knip#7
Thomasims wants to merge 4 commits into
mainfrom
chore/oxc-tooling

Conversation

@Thomasims

@Thomasims Thomasims commented Sep 7, 2026

Copy link
Copy Markdown

Replaces @biomejs/biome with the shared @antelopejs/tooling-configs presets: oxlint (type-aware, via oxlint-tsgolint) for linting, oxfmt for formatting, and Knip for dead-code and dependency analysis.

Tooling swap

  • biome.json deleted, @biomejs/biome removed.
  • Added oxlint.config.ts, oxfmt.config.ts, knip.config.ts, each extending the shared preset.
  • oxlint is pinned to exactly 1.81.0 — the JS plugin API is alpha and has to match the version tooling-configs builds against.
  • Scripts: lintoxlint, lint:fixoxlint --fix, formatoxfmt ., format:checkoxfmt --check ., plus a new knip. .github/workflows/ci.yml gains pnpm format:check and pnpm knip steps next to the existing pnpm lint, in a separate ci: commit. This package has no test suite, so there is no pnpm test step.
  • oxfmt.config.ts carries a temporary .github/ISSUE_TEMPLATE/** ignore — those are Markdown templates with a .yml extension that oxfmt cannot parse. It goes away with tooling-configs#5.

tsconfig

Type-aware linting runs tsgolint, which rejects options TypeScript 7 removed and auto-discovers each file's tsconfig.json (so pointing it at a separate config does not help). One change: "moduleResolution": "node" is deleted. tsgolint only rejects the explicit removed node10 value, so dropping the field satisfies it while the emit stays byte-compatible.

"module": "commonjs" is deliberately left alone. Raising it to node16 looks like the tidier fix and is a runtime break: tsc then stops downlevelling await import(...) and emits a native ESM dynamic import, which bypasses the CommonJS resolver detour the ajs runtime installs. There was no baseUrl to remove and rootDir was already set, so this is the whole tsconfig diff.

What the linter forced

One thing: import order in src/index.ts, autofixed by oxlint --fixstripe now sorts before @antelopejs/interface-core. That is the entire source diff.

pnpm lint then reports zero errors and zero warnings. Nothing is disabled anywhere in the repo — there are no oxlint-disable comments in this PR.

What Knip needed

Nothing. No unused files, exports or dependencies, and no ignore entries were required, so knip.config.ts is the bare preset. pnpm knip exits 0 (the remaining "configuration hints" are preset globs — nuxt-layer/**, playground/**, scripts/** — that simply do not match this repo).

Worth stating explicitly for an interface package: Knip flagged no exported symbol as unused, so nothing was deleted on its advice. The internal namespace, IntentChangeContext and the six exported functions are all published contract. Note the scope of that check: src/index.ts is this repo's only source file and it is Knip's entry point, so Knip does not evaluate its exports at all — by design, since an interface's entry exports are the contract. Knip does catch unused files and unused exports in any non-entry module (verified with a planted dead export); there simply are none here.

Verification

The public surface of a versioned interface must not move, so it was checked against a build from an untouched origin/main worktree:

  • package.json exports declares . and ./package.json. The runtime export keys of . are identical: CompletePayment, GetClient, InitializePayment, WaitForPayment, WatchAllPayments, WatchPayment, and internal with {client, SetClient, UnsetClient, intentChanges}.
  • dist/index.js is byte-identical to the origin/main build, before and after the oxfmt pass. dist/index.d.ts contains exactly the same lines, differing only in the order of its two import statements — the declaration-file echo of the source import sort above. The source map shifts by the same one line.
  • pnpm lint, pnpm knip and pnpm format:check all exit 0.

Test baseline: this package has no test suite. There is no test script and no antelopeJs.test entry on origin/main, and CI does not run one. So there is no pass/fail to compare — the verification above rests on the byte-identical build, not on tests.

The oxfmt pass is a separate commit recorded in .git-blame-ignore-revs to keep git blame readable. It normalizes package.json key order and reflows Markdown code blocks in AGENTS.md, CHANGELOG.md and docs/; no source file changed.

Swaps @biomejs/biome for the shared @antelopejs/tooling-configs presets:
oxlint (type-aware, via oxlint-tsgolint) for linting, oxfmt for formatting
and Knip for dead-code and dependency analysis. The lint / format scripts
are repointed and a `knip` script is added; CI already runs `pnpm lint`.

tsconfig: tsgolint rejects the `moduleResolution: "node"` (node10) value
TypeScript 7 removed, and it discovers each file's tsconfig itself, so the
field is dropped rather than raised — `module: "commonjs"` is untouched so
the emit stays byte-compatible. There was no `baseUrl` to remove and
`rootDir` was already set.

The only change the linter forced is the import order oxlint autofixed in
src/index.ts (`stripe` now sorts before `@antelopejs/interface-core`).
Nothing is disabled, and `pnpm lint` reports zero errors and zero warnings.
`pnpm knip` reports no unused files, exports or dependencies, so
knip.config.ts is the bare preset.

Verified: dist/index.js is byte-identical to the origin/main build,
dist/index.d.ts differs only in the order of its two import lines, and the
runtime export keys of the `.` subpath match (CompletePayment, GetClient,
InitializePayment, WaitForPayment, WatchAllPayments, WatchPayment, and
internal{client,SetClient,UnsetClient,intentChanges}). This package has no
test suite — there is no `test` script and no `antelopeJs.test` entry on
origin/main — so there is no test result to compare.
@Thomasims
Thomasims marked this pull request as ready for review September 7, 2026 16:10
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