-
-
Notifications
You must be signed in to change notification settings - Fork 223
Closed
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working
Description
Describe the bug
If I use the value of a store in an action or transition directive using the $ shorthand, VSCode still thinks the store variable is unused.
To Reproduce
Try creating a Svelte component with the following code snippet:
<script>
import { fly } from 'svelte/transition';
import { readable } from 'svelte/store';
const transitionStore = new readable(fly);
const actionStore = new readable((node) => {
console.log(node);
});
</script>
<div transition:$transitionStore={{ y: 100 }} use:$actionStore>
I'm some content
</div>Both stores are marked as unused despite being used in the directives (see screenshots below).
If the stores are in the same file as the component, this is only a mild annoyance. However, if they are imported from a different file, the imports are removed when you run "Organize imports" since VSCode thinks they aren't used.
Expected behavior
Using a store value means the store variable is not marked unused.
System (please complete the following information):
- OS: Windows 10 (WSL 2 with the Ubuntu distro)
- IDE: VSCode
- Plugin/Package: Svelte for VSCode
Metadata
Metadata
Assignees
Labels
FixedFixed in master branch. Pending production release.Fixed in master branch. Pending production release.bugSomething isn't workingSomething isn't working
