Repository navigation
build: run svelte-check on TypeScript 6 and guard svelte/internal in .ts files - #2225
Conversation
Both tests fail on master. svelte-check --tsgo exits 0 with zero diagnostics when the native TypeScript executable cannot start, and Oxlint applies the svelte/internal guard only to .svelte.ts files.
svelte-check 4.7.6 under --tsgo ignores the native compiler's exit status, so pnpm run check and pnpm run lint passed a component type error when the native executable could not start. The TypeScript 6 path reports it. tsc keeps the native compiler, which fails on a type error and on a missing executable.
Only svelte-check --tsgo and --incremental write .svelte-check, and check uses neither. TypeScript's ** pattern already skips dot-directories, and Oxlint lints only src and tests.
ESLint's svelte/no-svelte-internal covered every linted .ts file. The Oxlint port enabled the selector only through quickadd/svelte-runes on .svelte.ts files. It is now its own rule on **/*.ts, and svelte-runes keeps only the store and dispatcher guards.
…re basenames The preload uses module.registerHooks, which Node 22.15 added, and package.json allows Node 22.12. Oxlint prints file:// URLs in JetBrains terminals, so the guard assertions compare file basenames.
svelte-check --tsgo and --incremental leave the directory behind, and checkouts that ran check after #2224 already have one.
The strict-check test moves next to the native-compiler test. Both read the check command from package.json in one place, and the preload extends NODE_OPTIONS instead of replacing it.
pnpm run lint already ends with pnpm run check.
Also label the .gitignore entry and restore the README condition that svelte-check must run on the native compiler's API before the TypeScript 6 package can go.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to The tooling changes appear ready to merge after normal checks; no specific outstanding failure is established. Pre-merge checks |
|
Independent verification: PASS+NOTES
I tested two detached worktrees, each with its own
Extra checks:
Notes (not blocking):
All probes were removed and the renamed native |
Summary
#2224 left two gaps in
pnpm run lint. When the native TypeScript executable cannot start,svelte-check --tsgoexits 0 with no errors, even for an imported component with a type error. svelte-check 4.7.6, the latest release, ignores the native compiler's exit status. The Oxlint port also applied thesvelte/internalimport guard only to.svelte.tsfiles, while ESLint covered every.tsfile.checknow runs svelte-check on the TypeScript 6 path, which reports the type error.tsckeeps the native compiler, which exits 1 on a type error and on a missing executable.Changes
checkissvelte-check --fail-on-warnings. The tsconfig and Oxlint ignores for.svelte-checkare removed because they had no effect. The.gitignoreentry stays for overlays that earlier--tsgoruns left behind.svelte/internalselector is its own Oxlint rule,quickadd/svelte-internal, on every.tsfile.quickadd/svelte-runeskeeps the store and dispatcher guards on.svelte.tsfiles. The component checker's rules are unchanged.tests/tooling/svelteCheck.test.tsruns thecheckcommand with the native compiler unable to start and requires it to fail on a component type error. The strict-check test moved there too. The Oxlint fixture test now coverssvelte/internalin.ts,.svelte.ts, and.test.tsfiles.pnpm run checka second time afterpnpm run lint.This PR leaves out unimported components. Neither svelte-check path sees them under the
**/*.tsinclude, which predates #2224, andlint:sveltealready rejects a malformed one. The policy checker's rule gaps belong to the sharedsvelte-policypackage.pnpm run checkis slower, because the TypeScript 6 checker runs in JavaScript and checks every.tsfile again.--tsgo-experimental-apiwas rejected because it also exits 0 when the native compiler is missing.Testing / validation
checkandlintgo from exit 0 to exit 1. Asvelte/internalimport in.tsand.test.tsfiles takeslint:nativefrom exit 0 to exit 1. Deleting a component after a check passes on both.pnpm install --frozen-lockfile,pnpm run build-with-lint, andpnpm run testpass (7,019 passed, 28 skipped).main.jsandstyles.cssare byte-identical to master.pnpm run check: 2.3 s → 8.9 s, median of 5 alternating runs per side.Release impact: none. The bundle is unchanged, and
build:requests no release.Checklist
Note
Run svelte-check on TypeScript 6 and split
svelte-internalguard into its own rule--tsgofrom thecheckscript so svelte-check runs on the TypeScript 6 API package, whiletsckeeps using the native compilerquickadd(svelte-internal)now reportssvelte/internalimports, andquickadd(svelte-runes)keeps only thesvelte/storeandcreateEventDispatcherchecks (tooling/oxlint-plugin.mjs)quickadd/svelte-internalrule at error severity for all**/*.tsfiles, including.svelte-check/overlay pathstscbinary cannot startquickadd(svelte-runes)no longer flagssvelte/internalimports, and the release workflow no longer runspnpm run check(lint and test remain)Macroscope summarized 3be3032.
Summary by CodeRabbit