Skip to content

Replace eslint with oxlint + oxfmt; stabilize the tsdown build#404

Open
damusix wants to merge 3 commits into
hapijs:wip/tsfrom
damusix:wip/ts
Open

Replace eslint with oxlint + oxfmt; stabilize the tsdown build#404
damusix wants to merge 3 commits into
hapijs:wip/tsfrom
damusix:wip/ts

Conversation

@damusix

@damusix damusix commented Jun 6, 2026

Copy link
Copy Markdown

Why

Two things, both tooling — no library behavior changes.

  1. Replace eslint with oxlint + oxfmt via the shared @hapi/oxc-plugin, aligning hoek with the toolchain the ecosystem is moving to. One shared lint/format config replaces the local eslint setup.
  2. Fix a latent build bug. tsdown was emitting a content-hashed dist/index-<hash>.d.ts, but package.json declares types: ./dist/index.d.ts — a path that never existed in the output. Published type resolution would break. The build also rewrote package.json on every run.

What the fix does

The tsdown config now pins three non-default flags:

  • hash: false — emit a stable dist/index.d.ts matching the declared types.
  • exports: false — stop tsdown rewriting package.json on build.
  • clean: falsedist is managed explicitly; the build never deletes source.

Worth knowing

  • The diff is broad because oxfmt reformats every file. No logic changed — the full suite (234 tests) stays green at 100% coverage, which is the guard that the reformat moved no behavior.
  • CI is red until @hapi/oxc-plugin is published. It's referenced at ^1.0.0 but isn't on npm yet, so npm install fails in CI. Locally it's resolved via a workspace symlink. Nothing here can fix that — it clears when the plugin publishes.

damusix added 3 commits June 5, 2026 01:22
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.
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