Skip to content

Replace prettier with oxfmt, add oxlint, upgrade to TypeScript 7 - #26

Merged
rkalis merged 2 commits into
pnpmfrom
oxlint
Dec 3, 2026
Merged

rkalis merged 2 commits into
pnpmfrom
oxlint

Conversation

@mr-zwets

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

Copy link
Copy Markdown
Member

Summary

Replaces prettier with oxfmt, adds oxlint, and upgrades TypeScript to 7. It uses the same oxfmt options as CashScript/cashscript#480 and CashScript/cashscript-playground#54. oxlint runs with its default correctness rules (#480 instead turns those off and lists 13 rules explicitly), with no-unused-vars using #480's options as a warning. The tools are pinned one patch version newer than #480, matching the playground. Stacked on #25; review and merge that first.

Changes

  • Linting: the repo had no linter (yarn lint ran prettier --write). pnpm lint now runs oxlint with its default rules, with no-unused-vars configured like the cashscript repo (_-prefixed arguments allowed, caught errors ignored). It reports 8 warnings and no errors: unused token / context parameters in the VS Code provider implementations, an unused fs import in extension.ts, an unused capabilities variable in server.ts, and the empty src/tests/index.ts (removed in the follow-up PR).
  • Formatting: prettier is replaced by oxfmt, with the same options as the cashscript repo: printWidth: 125 (prettier used 120 here), single quotes, trailing commas. pnpm format / pnpm format:check added; .prettierrc and .prettierignore removed.
  • TypeScript 5.8 → 7.0. TypeScript 6 made strict the default, which turns on strictPropertyInitialization. That flagged two fields in CashscriptCompletionProvider that are assigned at the start of provideCompletionItems before they're read; they're now marked as definitely assigned (doc!, pos!). No other type errors.
  • Both tools are pinned to exact versions (oxlint 1.96.0, oxfmt 0.81.0), since oxfmt is pre-1.0.

Commits

  1. Tooling switch, including TypeScript 7.
  2. Reformat: the output of pnpm format and nothing else. Because oxfmt's output matches prettier's apart from the wider print width, this only touches 4 source files (re-wrapped at the wider print width) and package.json. There's no .git-blame-ignore-revs entry, since the reformat is this small; that also means any merge method works.

Notes for review

  • oxfmt sorts package.json keys by default, including the keywords and categories arrays. Only top-level keys and those two arrays are sorted (contributes, files and contributors are unchanged). In the .vsix this only reorders the <Tags> and <Categories> strings, which has no effect in VS Code or on the Marketplace.
  • 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. Bundling is unaffected, because rolldown strips types without type-checking.

Testing

  • pnpm typecheck (TypeScript 7), pnpm build, pnpm lint and pnpm format:check pass
  • The minified bundles (rolldown -c --environment MINIFY:true) are byte-identical before and after the reformat commit
  • Language server smoke test over stdio against every .cash file in examples/: diagnostics identical to main; extension.js activates with a stubbed vscode module

🤖 Generated with Claude Code

mr-zwets and others added 2 commits December 2, 2026 09:51
Same oxlint/oxfmt setup as CashScript/cashscript#480 and the playground.

- add oxlint and oxfmt, pinned to exact versions (oxfmt is pre-1.0)
- .oxlintrc.json uses oxlint's default rules, with no-unused-vars
  configured like the cashscript repo
- .oxfmtrc.json uses the same options as the cashscript repo
  (printWidth 125 instead of prettier's 120 here)
- `lint` now runs oxlint (it used to run `prettier --write`); add
  `format` and `format:check`
- TypeScript 5.8 → 7.0. TypeScript 6 made `strict` the default, which
  enables strictPropertyInitialization; mark the two CompletionProvider
  fields that are assigned at the start of provideCompletionItems as
  definitely assigned

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Output of `pnpm format` and nothing else: package.json key sorting and
re-wrapping at the wider print width. The minified bundles are
byte-identical before and after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rkalis
rkalis merged commit b037d96 into main Dec 3, 2026
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