Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Member

@dummdidumm dummdidumm Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That option is deprecated since TypeScript 5.0 and AFAIK will not do anything anymore starting 5.5. (not sure if this also applies to transpileModule, but definitely when running tsc). I think it's better to use verbatimModuleSyntax instead, assuming a TS version that has it is the minimum required version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your comment!
I knew it was deprecated, but I didn't know it would be removed in 5.5. It seems that we need to specify both so that it works with older versions of typescript 😅

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}