Skip to content

Commit

Permalink
(fix) detect invalid Svelte import paths for svelte-check (#1471)
Browse files Browse the repository at this point in the history
#1448 #1468

Since the file is copied to the svelte-check build output. The path also needed to be considered
  • Loading branch information
jasonlyu123 committed May 3, 2022
1 parent 9680a40 commit 59b6bbf
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -134,7 +134,10 @@ export namespace DocumentSnapshot {
if (!normalizedPath.endsWith('node_modules/svelte/types/runtime/ambient.d.ts')) {
originalText = ts.sys.readFile(filePath) || '';
}
if (normalizedPath.endsWith('svelte2tsx/svelte-shims.d.ts')) {
if (
normalizedPath.endsWith('svelte2tsx/svelte-shims.d.ts') ||
normalizedPath.endsWith('svelte-check/dist/src/svelte-shims.d.ts')
) {
// If not present, the LS uses an older version of svelte2tsx
if (originalText.includes('// -- start svelte-ls-remove --')) {
originalText =
Expand Down

0 comments on commit 59b6bbf

Please sign in to comment.