Replace eslint with oxlint + oxfmt; stabilize the tsdown build#404
Open
damusix wants to merge 3 commits into
Open
Replace eslint with oxlint + oxfmt; stabilize the tsdown build#404damusix wants to merge 3 commits into
damusix wants to merge 3 commits into
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.
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.