chore: replace Biome with oxlint, oxfmt and Knip - #24
Open
Thomasims wants to merge 4 commits into
Open
Conversation
Adopts the shared @antelopejs/tooling-configs presets: oxlint with the vendored anti-slop rules, oxfmt for formatting and Knip for dead code. Type-aware linting needs a tsconfig tsgolint accepts, so the removed moduleResolution node10 and baseUrl options go away and the self-referential path mappings the tests use become relative. The module stays on commonjs so the emit keeps using require, which is what the AntelopeJS resolver hooks. import(no-cycle) found two real cycles through index.ts: components.ts needed GetDataControllerMeta and metadata.ts needed the endpoint callback types, both of which index.ts declared. Both now live in metadata.ts, which neither of the other two entry points depends on in reverse, and index.ts re-exports them so the @antelopejs/interface-data-api surface is byte-identical. The components cycle was not theoretical: requiring dist/components.js first threw "Cannot read properties of undefined (reading 'Get')" because index.ts evaluated Parameters.Get() while components was still half-initialized.
Thomasims
marked this pull request as draft
September 7, 2026 10:37
Thomasims
marked this pull request as ready for review
September 7, 2026 16:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces Biome with the shared
@antelopejs/tooling-configspresets: oxlint(type-aware, with the vendored anti-slop rules), oxfmt for formatting and Knip
for dead-code detection.
oxlintis pinned to 1.81.0 because the JS plugin APIis still alpha and has to match the version tooling-configs builds against.
tsconfig
Type-aware linting runs through tsgolint, which rejects options TypeScript 7
removed, so
moduleResolution: "node"andbaseUrlare gone and theself-referential
@antelopejs/interface-data-apipath mappings the test suitesuse are now written relative, which is what the compiler wants once
baseUrlis absent.
modulestayscommonjson purpose. Raising it tonode16would look like thetidier fix and is a runtime break: tsc stops downlevelling dynamic imports and
emits native ESM ones, which bypass the CommonJS resolver detour the
ajsruntime installs.
The import cycles
import(no-cycle)found two, both throughindex.ts:components.tsimportedGetDataControllerMetafromindex.ts, whileindex.tsimportsParameters,QueryandValidationfromcomponents.ts.metadata.tsimported theDataControllerCallbackWithOptionstype fromindex.ts, whileindex.tsimportsDataAPIMetafrommetadata.ts.Both are fixed by moving the shared declarations down into
metadata.ts— theendpoint callback types (
DataControllerCallback,DataControllerCallbackWithOptions,ExtractCallback,DataControllerDef,ExtractDefCallbacks) andGetDataControllerMeta, all of which describemetadata rather than controllers.
metadata.tsimports neither of the other twomodules, so the graph is now acyclic.
The public surface is unchanged.
index.tsre-exports every moved symbol,and
Object.keys(require("dist/index.js"))is identical before and after; themetadatasubpath gains those names, which is purely additive.The first cycle was not theoretical. On
main, requiring thecomponentssubpath before the root throws:
because
index.tsevaluatesParameters.Get()at module scope whilecomponentsis still half-initialized. Loadingdist/components.jsfirst workson this branch.
Other code changes the linter forced
perfectionist(sort-imports): import ordering across the source and thesuites, all applied by
oxlint --fix.unicorn(no-useless-fallback-in-spread):{ ...(callback.options ?? {}), ...(options ?? {}) }becomes{ ...callback.options, ...options }.Spreading
undefinedinto an object literal is already a no-op, so this isbehaviour-preserving.
Nothing was disabled. The remaining oxlint output is warnings only, which are a
deliberate backlog and are left as they are.
pnpm lintexits 0.Knip
Only
ajsneeded an ignore: CI installs@antelopejs/coreglobally instead ofadding the CLI to every package. Nothing was deleted — no unused files, exports
or dependencies are reported, and an interface package's exports are its
versioned contract, so they are kept whatever Knip could not see reaching them.
Verification
pnpm build,pnpm lint,pnpm knip,pnpm format:checkall exit 0.pnpm test: 89 passing, identical to the baseline measured on an untouchedmainworktree.The oxfmt pass is a separate commit and is recorded in
.git-blame-ignore-revsso
git blamestays readable. It also normalizes Markdown, YAML and thepackage.jsonkey order, which accounts for most of the diff.