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
<script>
let { array = [] } = $props()
let array2 = $derived(array.filter(i => !i.hidden))
</script>
In this short example, filter is marked red
'array' is of type 'unknown'.
For example, when I use next code in TS playground, it will not mark array or filter as error. Expected errors are $props() and i. But not arary or filter.
My configuration:
installed using Vite (fresh installation)
but not Svelte kit
just JS Svelte 5 (newest)
or even TS (no difference)
newest Svelte extension for VS code
newest VS Code update
Such error come up with Svelte 5 first (Svelte 4 show no errors).
I hoped all the time that this will be fixed with final v5.
I played with checkJS - or ts-nocheck.
But this will hide any error.
Reproduction
<script>
let { array = [] } = $props()
let array2 = $derived(array.filter(i => !i.hidden))
</script>
Expected behaviour
no error
System Info
OS: Windows
IDE: VSCode
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
In this short example, filter is marked red
'array' is of type 'unknown'.
For example, when I use next code in TS playground, it will not mark array or filter as error. Expected errors are $props() and i. But not arary or filter.
My configuration:
installed using Vite (fresh installation)
but not Svelte kit
just JS Svelte 5 (newest)
or even TS (no difference)
newest Svelte extension for VS code
newest VS Code update
Such error come up with Svelte 5 first (Svelte 4 show no errors).
I hoped all the time that this will be fixed with final v5.
I played with checkJS - or ts-nocheck.
But this will hide any error.
Reproduction
Expected behaviour
no error
System Info
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
No response
The text was updated successfully, but these errors were encountered: