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 solution you'd like
Allow for comma trails when destructuring in an #each block. This is consistent with JS object destructure notation, which supports this:
letobj={x: 1,y: 2};let{
x,
y,}=obj;console.log(x,y);// prints "1 2"
Describe alternatives you've considered
Have a clearer error message explaining that trailing commas are not supported. The current Not implemented Empty can lead to some hair-tearing situations, even if svelte decides to not support trailing commas in #each blocks.
How important is this feature to you?
Minor priority.
Additional context
This was brought up in the discord after someone encountered this particular issue.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, when destructuring in an
#each
block with a trailing comma like this:The following error is spit out:
(see this repl for an example)
Describe the solution you'd like
Allow for comma trails when destructuring in an #each block. This is consistent with JS object destructure notation, which supports this:
Describe alternatives you've considered
Have a clearer error message explaining that trailing commas are not supported. The current
Not implemented Empty
can lead to some hair-tearing situations, even if svelte decides to not support trailing commas in #each blocks.How important is this feature to you?
Minor priority.
Additional context
This was brought up in the discord after someone encountered this particular issue.
The text was updated successfully, but these errors were encountered: