Skip to content

Replace ESLint with oxlint, add oxfmt, upgrade to TypeScript 7 - #54

Merged
rkalis merged 2 commits into
upgrade-depsfrom
oxlint
Dec 3, 2026
Merged

rkalis merged 2 commits into
upgrade-depsfrom
oxlint

Conversation

@mr-zwets

@mr-zwets mr-zwets commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Replaces ESLint with oxlint, adds oxfmt for formatting, and upgrades TypeScript to 7. This uses the same oxlint/oxfmt setup as CashScript/cashscript#480 (one patch version newer); the TypeScript 7 upgrade is specific to this PR. Stacked on #53; review and merge that first.

Why

  • TypeScript 7. typescript-eslint relies on TypeScript's JavaScript compiler API, which TypeScript 7 (the Go-native compiler) no longer ships, so it only supports typescript <6.1. Without ESLint, nothing holds TypeScript back.
  • Fast. pnpm lint and pnpm format each take about 0.05s (oxlint and oxfmt themselves report under 10ms).
  • Fewer dependencies. Five ESLint packages (eslint, typescript-eslint, eslint-plugin-react-hooks, eslint-plugin-react-refresh, globals) are replaced by two pinned tools.
  • Same setup across repos as the cashscript monorepo.

Commits

  1. Tooling switch. Removes ESLint and adds oxlint 1.96.0 and oxfmt 0.81.0 (exact pins, since oxfmt is pre-1.0), .oxlintrc.json, .oxfmtrc.json, and pnpm format / pnpm format:check. TypeScript 6.0 → 7.0.
  2. Mechanical reformat. The output of pnpm format and nothing else (34 files: the TypeScript sources plus README.md, index.html, package.json, tsconfig.json, pnpm-workspace.yaml, index.scss and the two oxc configs). In the example contracts only the semicolons after the closing backticks change; the contract sources inside the template strings are untouched. Best reviewed by re-running the command rather than reading the diff.

What changes in enforcement

  • Carried over: rules-of-hooks (error), exhaustive-deps (warn) and only-export-components (warn, allowConstantExport). These are the only rules the ESLint config had, and oxlint has all three built in.
  • New warnings: oxlint's only-export-components also flags 5 helper exports in src/components/shared/index.tsx that eslint-plugin-react-refresh did not. They're real: they stop fast refresh from updating those components in place.
  • Not enabled: oxlint's default correctness category is turned off, as in #480. It reports 18 warnings on existing code (no-useless-escape, no-unused-vars, set-state-in-effect, no-wrapper-object-types, and two no-unsafe-optional-chaining hits in TransactionInputs.tsx that look like real bugs). Worth enabling in a follow-up cleanup.
  • Formatting: .oxfmtrc.json uses the same options as cashscript (printWidth: 125, single quotes, trailing commas).

Notes for review

  • Editor support. The typescript@7 package no longer ships tsserver, so VS Code's "Use Workspace Version" won't work. Editors use their bundled TypeScript, or the TypeScript native-preview extension for TS 7.
  • There's no CI in this repo yet, so format:check and lint aren't enforced automatically.

Verification

  • pnpm build (TypeScript 7 type-check + Vite build), pnpm lint (0 errors, 14 warnings) and pnpm format:check pass
  • The reformat leaves the app's behaviour unchanged. The non-minified production bundle differs in only two places, where oxfmt split JSX text into separate pieces ("Wallets " → "Wallets", " ", and " ", "(" → " ("). The rendered text is the same. The production (minified) CSS is byte-identical; reformatting index.scss and index.html only changes whitespace and the <!doctype html> casing.
  • Re-running pnpm format on commit 1 reproduces commit 2 exactly

🤖 Generated with Claude Code

@vercel

vercel Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cashscript-playground Error Error Dec 3, 2026 10:55am UTC

Request Review

mr-zwets and others added 2 commits December 3, 2026 11:53
Same setup as CashScript/cashscript#480. typescript-eslint relies on
TypeScript's JavaScript compiler API, which TypeScript 7 no longer ships,
so it blocked the upgrade.

- remove eslint, typescript-eslint, eslint-plugin-react-hooks,
  eslint-plugin-react-refresh and globals
- add oxlint and oxfmt, pinned to exact versions (oxfmt is pre-1.0)
- .oxlintrc.json keeps the existing rules (rules-of-hooks,
  exhaustive-deps, only-export-components) with the correctness
  category off, like #480
- .oxfmtrc.json uses the same options as the cashscript repo
- add `format` and `format:check` scripts
- TypeScript 6.0 → 7.0

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Output of `pnpm format` and nothing else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rkalis
rkalis merged commit 32a802a into main Dec 3, 2026
1 of 2 checks passed

This branch had an error being deployed

1 failed deployment
Preview — 8db2f475 Deployed Dec 3, 2026 by vercel[bot]
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.

2 participants