Skip to content

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

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

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

Conversation

@Thomasims

@Thomasims Thomasims commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Moves the repository onto the shared @antelopejs/tooling-configs presets: oxlint with the vendored anti-slop rules, oxfmt for formatting, and Knip for dead code.

Tooling

biome.json and @biomejs/biome are gone, replaced by oxlint.config.ts, oxfmt.config.ts and knip.config.ts. lint, lint:fix and format point at the new tools, and format:check and knip are new.

tsconfig

Type-aware linting runs through tsgolint, which rejects moduleResolution: "node" because TypeScript 7 removes the node10 resolver. Only the explicit option is rejected, so the field is simply dropped and module: "commonjs" is left alone — the emit stays byte-compatible.

Raising module to node16 was tried first and is not safe here: tsc then stops downlevelling await import(...) and emits a native ESM dynamic import, which bypasses the CommonJS resolver detour the ajs runtime installs and loads interface packages twice. baseUrl gives way to an explicit rootDir.

Code changes the linter asked for

  • import/no-cycle: index.tsmiddlewares/cors.tsindex.ts. The module config state moves into src/module-config.ts, which both import; index.ts re-exports configure, getConfig and setCorsConfig so the public surface is unchanged.
  • promise/no-callback-in-promise in continueExecution is a deliberate continuation-passing helper that keeps the synchronous fast path allocation-free, so it carries a targeted disable with that reason rather than a rewrite.
  • Import order across the repository is autofixed by oxlint --fix.
  • IdentifiableRouteCallback was exported but only used inside server.ts; Knip caught it and it is now file-local.

The 28 remaining findings are warnings the preset raises deliberately (complexity thresholds and anti-slop) and do not fail the build. They are a backlog to work through, not a gate.

Knip

reflect-metadata and @types/mocha are recorded as ignored with the reason: emitDecoratorMetadata makes tsc emit Reflect.metadata calls that need the polyfill at runtime even though nothing imports it, and @types/mocha supplies the globals for the suites ajs module test runs. ajs itself is ignored because CI installs @antelopejs/core globally.

Verification

pnpm build, pnpm lint and pnpm knip are clean. pnpm test is 174 passing / 0 failing — identical to untouched main, verified by building and running the suite from an origin/main worktree.

The formatting pass is its own commit and is recorded in .git-blame-ignore-revs.

The .github/ISSUE_TEMPLATE/** entry in oxfmt.config.ts is temporary and can be dropped once AntelopeJS/tooling-configs#5 ships.

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 moduleResolution
moves off the removed node10 to node16 and baseUrl gives way to rootDir.

Breaks the index -> middlewares/cors -> index cycle by moving the module
config state into its own file, and drops an unused exported type.
Under module=node16 tsc stops downlevelling `await import(...)` and emits a
native ESM dynamic import, which bypasses the CJS resolver detour the ajs
runtime installs and loads interface packages twice.

tsgolint only rejects the explicit, removed node10 `moduleResolution` option,
so dropping the field and leaving module=commonjs alone satisfies type-aware
linting while keeping the emit byte-compatible.
@Thomasims
Thomasims marked this pull request as draft September 7, 2026 10:36
@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