Skip to content

Commit

Permalink
fix: false positives for import vars with TS in svelte/valid-compile (
Browse files Browse the repository at this point in the history
#790)

close #652

This PR fixes the issue mentioned in the comments below.


#652 (comment)

In the code posted at the top of the thread the rule seems to work
correctly, and correctly shows the svelte compiler warnings.
  • Loading branch information
ota-meshi committed Jun 17, 2024
1 parent 23f7bf2 commit f7b7649
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-lobsters-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-svelte": patch
---

fix: false positives for import vars with TS in `svelte/valid-compile`
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export function transform(
ts.ScriptTarget.ESNext,
module: ts.ModuleKind.ESNext,
importsNotUsedAsValues: ts.ImportsNotUsedAsValues.Preserve,
preserveValueImports: true,
sourceMap: true
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script lang="ts">
import { page } from '$app/stores';
</script>

{$page}

0 comments on commit f7b7649

Please sign in to comment.