Skip to content

build: move Svelte checks to native TypeScript after upstream false-success fixes #405

Closed

Description

@chhoumann

Move PodNotes Svelte checks to TypeScript 7 only after upstream fixes false success on syntax errors and compiler failures. Standalone typecheck can move independently.

Native Svelte checking returns success for malformed components and a missing compiler

Tested on Linux x64 with Node 22.23.2, svelte-check 4.7.6, Svelte 5.57.1, typescript 6.0.3, and @typescript/native aliased to typescript 7.0.2. The project has a tsconfig that includes src/**/*.svelte and strict checking. No incremental flag was used.

Malformed unimported component

Create an unimported src/ui/Devx1Malformed.svelte containing only an unclosed element:

<div>

Run the legacy checker:

node node_modules/svelte-check/bin/svelte-check --tsconfig ./tsconfig.json --fail-on-warnings

It exits 1 and reports:

Error: `<div>` was left open
https://svelte.dev/e/element_unclosed (svelte)
svelte-check found 2 errors and 0 warnings in 1 file

Run the native checker after clearing generated overlays:

node -e "require('node:fs').rmSync('.svelte-check', { recursive: true, force: true })"
node node_modules/svelte-check/bin/svelte-check --tsgo --tsconfig ./tsconfig.json --fail-on-warnings

It exits 0 and reports svelte-check found 0 errors and 0 warnings. The component is still present and malformed. Remove the fixture after the probe.

The installed checker's emitSvelteFiles catches transformation errors and removes the entry. The subsequent Svelte diagnostic pass iterates only the remaining entries, so it never reports the syntax error.

Missing native compiler

With all sources valid, temporarily remove the Linux native executable from its expected path:

mv node_modules/@typescript/typescript-linux-x64/lib/tsc node_modules/@typescript/typescript-linux-x64/lib/tsc.disabled
node node_modules/svelte-check/bin/svelte-check --tsgo --tsconfig ./tsconfig.json --fail-on-warnings
mv node_modules/@typescript/typescript-linux-x64/lib/tsc.disabled node_modules/@typescript/typescript-linux-x64/lib/tsc

The checker exits 0 and reports svelte-check found 0 errors and 0 warnings, even though its compiler cannot run. The standalone native TypeScript launcher exits nonzero for the missing executable.

The installed checker collects the compiler's stdout and stderr but ignores the exit status and signal. It parses only diagnostic headers, so a loader exception becomes an empty diagnostic list.

Experimental API comparison

--tsgo-experimental-api reports the malformed component and exits 1. With the executable missing, it prints Error: Executable not found and svelte-check failed, but exits 0. It therefore does not provide a safe replacement for the CLI mode.

Expected behavior

Both native modes must report malformed components under the configured include paths and return nonzero when the compiler cannot run. Generated overlays for deleted components should also be pruned without requiring incremental mode.

Existing issue sveltejs/language-tools#2995 describes a related transformation-failure case. This draft has not been filed upstream.

PodNotes acceptance

  • An unimported malformed component fails both source and test Svelte checks.
  • A missing or failed native compiler fails the command.
  • The same TS and Svelte type errors fail the command.
  • Deleted component overlays cannot leave stale diagnostics.
  • No output-banner wrapper is needed.
  • Repeated timings justify the migration and the production bundle stays byte-identical.

Activity

  1. changed the title [-]build: remove Svelte overlay cleanup after upstream deleted-file fix[/-] [+]build: move Svelte checks to native TypeScript after upstream false-success fixes[/+] on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions