Skip to content

feat: add --tsc-rs flag to svelte-check - #3144

Open
bmdavis419 wants to merge 1 commit into
sveltejs:masterfrom
bmdavis419:davis/svelte-check-tsc-rs
Open

bmdavis419 wants to merge 1 commit into
sveltejs:masterfrom
bmdavis419:davis/svelte-check-tsc-rs

Conversation

@bmdavis419

Copy link
Copy Markdown

Adds --tsc-rs to svelte-check: run TypeScript diagnostics with tsc-rs, a Rust port of the TypeScript 7 compiler. Works exactly like --tsgo (same disk-overlay mode, combinable with --incremental and --watch) — only the spawned compiler binary differs. Requires tsc-rs installed in the workspace.

On a real SvelteKit app (62 .svelte + 81 .ts files), --tsc-rs produced diagnostics identical to --tsgo and ran ~20% faster (warm --incremental: 1.30s vs 1.61s).

Important files:

packages/svelte-check/src/options.ts

  • New --tsc-rs CLI flag.

packages/svelte-check/src/index.ts

  • Plumbs the flag into the overlay mode; errors if combined with --tsgo or --tsgo-experimental-api.

packages/svelte-check/src/incremental.ts

  • Compiler parameter is now 'tsc' | 'tsgo' | 'tsc-rs'; resolves the tsc-rs binary from the workspace (clear install-hint error if missing). No output-parser changes — tsc-rs's --pretty output matches tsgo's.

packages/svelte-check/test-sanity.js

  • Clean-project and error-project cases for --tsc-rs, mirroring --tsgo (tsc-rs added as a devDependency, same as @typescript/native-preview for tsgo).

Notes:

  • Includes a changeset (minor). If you'd prefer a generic engine option over a branded flag, happy to rework.
  • tsc-rs honors language-service plugins configured in tsconfig, so plugin diagnostics (e.g. Effect) can surface under --tsc-rs where --tsgo and the default mode don't report them. Left as engine behavior; mentioning in case you want it documented.

Models used: implemented by Claude Opus 5.5 (claude-opus-5-5), orchestrated and verified by muse-wonder-full-1.0 (Muse Code in T3 Code). Tests run locally: svelte-check sanity suite 15/15 on Svelte 4 and Svelte 5.

Use tsc-rs, a Rust port of the TypeScript 7 compiler, for TypeScript
diagnostics. It works like `--tsgo`: it writes the transpiled Svelte files
to disk, takes the same overlay tsconfig and can be combined with
`--incremental` and `--watch`. It cannot be combined with `--tsgo` or
`--tsgo-experimental-api`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d1ce703

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 Minor

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

@blt-r

blt-r commented Oct 26, 2026

Copy link
Copy Markdown

this should be probably changed to use tsrs by cloudflare/void0 now

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