Closed Treverix closed 4 years ago
From the svelte API:
If a statement consists entirely of an assignment to an undeclared variable, Svelte will inject a let declaration on your behalf.
So basically, this is valid code in svelte - but shown as an error in the IDE
<script> $: foo = "bar"; </script>
svelte will inject a let foo so foo shouldn't be displayed as an unresolved variable here.
let foo
Extended example - both foo and bar shouldn't be shown in error:
<script> $: foo = "bar"; $: bar = foo; </script>
Yes, this is very tricky to implement.
Closing in favor of #7
From the svelte API:
So basically, this is valid code in svelte - but shown as an error in the IDE
svelte will inject a
let foo
so foo shouldn't be displayed as an unresolved variable here.Extended example - both foo and bar shouldn't be shown in error: