Skip to content

fix: check components in symlinked directories with --tsgo / --incremental - #3164

Closed
xyrolle wants to merge 1 commit into
sveltejs:masterfrom
xyrolle:fix/tsgo-symlinked-dirs
Closed

xyrolle wants to merge 1 commit into
sveltejs:masterfrom
xyrolle:fix/tsgo-symlinked-dirs

Conversation

@xyrolle

@xyrolle xyrolle commented Oct 22, 2026 •

Copy link
Copy Markdown

Fixes #3163

--tsgo / --incremental didn't emit components under symlinked directories, because the findFiles walk doesn't descend into them, so the project in #3163 checked no files. During the overlay emission, links that lead out of the workspace are now followed, keeping the link's path (withSymlinks({ resolvePaths: false })).

  • Only the overlay emission follows links. The walk behind the default mode (openAllDocuments) stays as chore: switch from fast-glob to fdir #2433 left it.
  • Links whose target is inside the workspace, or contains it, are still skipped. That keeps loops (VSCode Plugin does not handle symlinks correctly #2364) and duplicate walks out, but a component that include or an import reaches only through such a link stays unchecked, as before.
  • A directory that can't be read during the walk is skipped, as fdir skips its own read errors.
  • resolvePaths needs fdir 6.3, and the symlink loop fixes are in 6.4, so the range goes to ^6.4.6, which the lockfile already has.

Known limitations (reproduced; how common they are is unknown):

  • Two links to the same outside folder are both emitted, so with an include that covers both, an error there is reported twice. The default mode reports it once.
  • fdir's own loop check compares path prefixes, so some links nested inside a linked directory are skipped and their components stay unchecked (e.g. src -> ../shared plus shared/alias -> ../shared-other), as before.

Covering links inside the workspace and these cases needs a loop check that tells loops from aliases (likely in fdir) and de-duplication of the reported diagnostics that doesn't drop distinct ones. I'd like to agree on that direction before growing this PR.

Test: test-sanity.js makes a temporary project whose src links to a directory outside it (a junction on Windows) with a type error, and checks that --tsgo reports it. It fails on master. Root pnpm test passes. pnpm lint passes with #3161's ignore rules; without them it fails on generated files after pnpm test.

@changeset-bot

changeset-bot Bot commented Oct 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 29abbc4

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.

--tsgo / --incremental check nothing in a symlinked source directory

1 participant