Skip to content

feat(svelte-check): detect tsrs as TypeScript 7 - #3214

Open
janosh wants to merge 1 commit into
sveltejs:masterfrom
janosh:svelte-check-tsrs
Open

janosh wants to merge 1 commit into
sveltejs:masterfrom
janosh:svelte-check-tsrs

Conversation

@janosh

@janosh janosh commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

closes #3191

tsrs is a Rust port of TypeScript 7 with the same CLI and API subpaths (sync, async, ast, fs). svelte-check only accepted packages named typescript or @typescript/native-preview, so --tsgo and --tsgo-experimental-api failed with "requires TypeScript 7 to be installed" when only tsrs was installed.

  • tryParseTs7Version (was tryParseTsGoVersion) also looks for tsrs. one table maps each accepted package name to its compiler bin (tsc / tsgo / tsrs), replacing the name check and the bin ternary in getTs7BinPath (was getTsGoBinPath)
  • renamed since they now find more than tsgo
  • no version parsing changes needed: since 7.1.0-beta.tsrs2 tsrs versions name the TypeScript release they port (7.1.0-beta.tsrs5 parses as 7.1). the -ts… suffix parsing proposed in the issue was for the older 0.x.y-ts7.1.0-beta versions
  • @typescript/native@npm:tsrs works too, and already does for --experimental-ts7 (that lookup doesn't check the package name). happy to add tsrs there as well in a follow-up
  • new case in test-sanity.js: a fake tsrs package must be accepted and its tsrs bin run. it fails without this change

also tested on copies of test-error with svelte-check installed from a tarball: tsrs, typescript@7.1.0-beta and @typescript/native-preview all report the same diagnostics for both flags.

related: #3144 adds a separate --tsc-rs flag for a different Rust port.

tsrs is a Rust port of TypeScript 7 with the same CLI and API subpaths. Accept it
under its own package name for --tsgo and --tsgo-experimental-api, and run its
tsrs bin. tryParseTsGoVersion and getTsGoBinPath are renamed tryParseTs7Version
and getTs7BinPath since they now find more than tsgo.
@changeset-bot

changeset-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8cbc09d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
svelte-check Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

svelte-check --tsgo-experimental-api: detect tsrs as TypeScript 7

1 participant