You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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';consttransitionStore=newreadable(fly);constactionStore=newreadable((node)=>{console.log(node);});</script><divtransition:$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.
Screenshots
System (please complete the following information):
OS: Windows 10 (WSL 2 with the Ubuntu distro)
IDE: VSCode
Plugin/Package: Svelte for VSCode
The text was updated successfully, but these errors were encountered:
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:
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.
Screenshots
System (please complete the following information):
The text was updated successfully, but these errors were encountered: