-
-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat) detect invalid Svelte import paths (#1448)
Detect that an import of a .svelte file is pointing to a non-existent file by removing the ambient module definitions in svelte and svelte2tsx from the eyes of TS #1444
- Loading branch information
1 parent
d4c2fc1
commit 1415196
Showing
10 changed files
with
89 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...e-server/test/plugins/typescript/features/diagnostics/fixtures/$$props-usage/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...server/test/plugins/typescript/features/diagnostics/fixtures/invalid-import/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"range": { "start": { "line": 1, "character": 28 }, "end": { "line": 1, "character": 51 } }, | ||
"severity": 1, | ||
"source": "ts", | ||
"message": "Cannot find module './doesnt-exist.svelte' or its corresponding type declarations.", | ||
"code": 2307, | ||
"tags": [] | ||
} | ||
] |
10 changes: 10 additions & 0 deletions
10
...rver/test/plugins/typescript/features/diagnostics/fixtures/invalid-import/expectedv2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ | ||
"range": { "start": { "line": 1, "character": 28 }, "end": { "line": 1, "character": 51 } }, | ||
"severity": 1, | ||
"source": "ts", | ||
"message": "Cannot find module './doesnt-exist.svelte' or its corresponding type declarations.", | ||
"code": 2307, | ||
"tags": [] | ||
} | ||
] |
6 changes: 6 additions & 0 deletions
6
...-server/test/plugins/typescript/features/diagnostics/fixtures/invalid-import/input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<script lang="ts"> | ||
import InvalidImport from './doesnt-exist.svelte'; | ||
import ValidImport from './valid-import.svelte'; | ||
InvalidImport;ValidImport; | ||
</script> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters