chore: replace Biome with oxlint, oxfmt and Knip - #32
Open
Thomasims wants to merge 5 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 option goes away and baseUrl gives way to rootDir. The module stays on commonjs: node16 emit turns the dynamic interface imports into native ESM, which bypasses the AntelopeJS resolver and breaks every test at construct time. Breaks the query -> expression -> query cycle by moving DecodeValue and DecodeFunction next to the Expression class they recurse with, drops a comment-only file and a handful of exports Knip found unused.
Thomasims
marked this pull request as draft
September 7, 2026 10:36
oxfmt formats this repository with two-space indentation; the .editorconfig still declared tabs at width 4, so editors fought the formatter on every save.
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.
Moves the repository onto the shared
@antelopejs/tooling-configspresets: oxlint with the vendored anti-slop rules, oxfmt for formatting, and Knip for dead code.Tooling
biome.jsonand@biomejs/biomeare gone, replaced byoxlint.config.ts,oxfmt.config.tsandknip.config.ts.lint,lint:fixandformatpoint at the new tools, andformat:checkandknipare new.tsconfig
Type-aware linting runs through tsgolint, which rejects options TypeScript 7 removes.
moduleResolution: "node"(node10) is one of them, so it goes;baseUrlgives way to an explicitrootDir. Nothing else in the build changes.moduledeliberately stays oncommonjsrather than moving tonode16. Undernode16TypeScript stops downlevellingawait import(...)and emits a native ESM dynamic import, which does not go through the AntelopeJS CJS resolver detour. The interface package then gets loaded twice and its internal circular requires blow up — every test fails at construct time withClass extends value undefined is not a constructor or nullfrom@antelopejs/interface-database/dist/datum.js. DroppingmoduleResolutionentirely and leavingmodulealone satisfies tsgolint and keeps the CommonJS emit, so type-aware linting is fully enabled here.Code changes the linter asked for
import/no-cycle:query.ts→expression.ts→query.ts.DecodeValueandDecodeFunctionare mutually recursive withExpression.decode, so they move intoexpression.tsalongside the class they recurse with;pipeline.tsandselection.tsimport them from there.query.tsis left as the interface entry point (RunQuery,ReadCursor,CloseCursor).import/no-cycle,pipeline.ts↔selection.ts: this pair carries a targeted disable on each side rather than a rewrite.SelectionQueryextendsAggregationPipeline, andAggregationPipelineis also the one that has to decode the right-hand side ofunion,joinandlookup, which is always a full schema/instance/table stream and therefore aSelectionQuery. The cycle is a base class dispatching to its own subclass decoder; every module-level way to break it (a registry, a decoder injected at load time) replaces a compile-time edge with a runtime load-order hazard in the query compiler, which is not a trade worth making for a lint clean-up. Both imports carryoxlint-disable-next-line import/no-cyclewith that reasoning.unicorn/no-thenableinstage_lookup: MongoDB's$condoperator literally takes athenbranch. The existingbiome-ignorebecomes anoxlint-disable-next-linewith the same reason.typescript/no-floating-promisesinDisconnect:internal.UnsetClient()returns a fresh, deliberately unresolved client promise, so awaiting it would deadlock. It is now explicitlyvoid-ed, matching what the interface package itself does.unicorn/no-empty-file:src/implementations/database/index.tscontained nothing but a stale block comment listing features and MongoDB documentation links, and was imported by nothing. It is deleted. Say the word if that scratchpad is still wanted somewhere.oxlint --fix.The 5 remaining findings are warnings the preset raises deliberately (
max-linesonpipeline.ts,max-params,max-lines-per-functionon a test, and twoawait-thenable) and do not fail the build. They are a backlog to work through, not a gate.Knip
Removed as genuinely dead:
ListDatabasesinconnection.tshad no callers at all. Un-exported because nothing outside their own file uses them and none are part of the package surface (src/index.tsre-exports none of them):GetDatabase,IndexDefinition,COLLECTION_NAME_SEPARATOR, andExpression(which became file-local onceDecodeValuemoved in).reflect-metadataand@types/mochaare recorded as ignored with the reason:emitDecoratorMetadatamakes tsc emitReflect.metadatacalls that need the polyfill at runtime even though nothing imports it, and@types/mochasupplies the globals for the suitesajs module testruns.ajsitself is ignored because CI installs@antelopejs/coreglobally.Verification
pnpm build,pnpm lintandpnpm knipare clean.pnpm testis 169 passing / 0 failing — identical to untouchedmain, measured in a throwaway worktree before any of this landed.The formatting pass is its own commit and is recorded in
.git-blame-ignore-revs.The
.github/ISSUE_TEMPLATE/**entry inoxfmt.config.tsis temporary and can be dropped once AntelopeJS/tooling-configs#5 ships.