Replace eslint with oxlint + oxfmt; stabilize the tsdown build - #404
Merged
Conversation
Drop @hapi/eslint-plugin and typescript-eslint for the shared @hapi/oxc-plugin oxlint/oxfmt config. Split the combined lint script into typecheck/lint/fmt and format the tree under oxfmt. Exclude the new oxc config files from coverage. Vitest, tsdown, and runtime behavior unchanged.
The local 'tsdown' build (exports: true) rewrote package.json on build, repointing types at a hashed dist name and dropping oxfmt formatting. Restore the declared types entry and re-apply oxfmt.
Add hash:false so the build emits dist/index.d.ts instead of a hashed dist/index-<hash>.d.ts that the declared types path never matched. Also set exports:false (tsdown's exports:true rewrites package.json on every build) and clean:false (its clean:true can resolve to the project root and wipe the tree). dist is managed explicitly.
Bring hoek's TypeScript-conversion stack in line with the canonical tlds `next` branch so the ecosystem shares one toolchain and publish shape. - Bump TS 6, vitest 4, tsdown 0.22, oxlint 1.69, oxfmt 0.54; consume @hapi/oxc-plugin from npm (^1.0.1) instead of the local symlink. - Emit dist/index.mjs as a single "." export with a types reference; drop main/module (tsdown exports:true). - Ship API.md + README.md in the package so consumers and LLMs reach the human-written docs. - Move source lib/ -> src/. - Replace the @hapi/code-backed toHoequal matcher with hoek's own deepEqual; drop the @hapi/code and @hapi/lab dev-deps. - Fix bump fallout: TS 6 (annotate Map entries, widen AnyPrototype to WeakKey, add "node" to tsconfig types) and coverage-v8 4 (v8-ignore the captureStackTrace guard, drop reach's unreachable else-if).
Contributor
|
I'll work on the code in the target branch, this is too hard here. |
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.
Why
Two things, both tooling — no library behavior changes.
@hapi/oxc-plugin, aligninghoekwith the toolchain the ecosystem is moving to. One shared lint/format config replaces the local eslint setup.tsdownwas emitting a content-hasheddist/index-<hash>.d.ts, butpackage.jsondeclarestypes: ./dist/index.d.ts— a path that never existed in the output. Published type resolution would break. The build also rewrotepackage.jsonon every run.What the fix does
The
tsdownconfig now pins three non-default flags:hash: false— emit a stabledist/index.d.tsmatching the declaredtypes.exports: false— stoptsdownrewritingpackage.jsonon build.clean: false—distis managed explicitly; the build never deletes source.Worth knowing
@hapi/oxc-pluginis published. It's referenced at^1.0.0but isn't on npm yet, sonpm installfails in CI. Locally it's resolved via a workspace symlink. Nothing here can fix that — it clears when the plugin publishes.