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
Snippets are available anywhere in their scope.
The language tools falsely surface errors if the order of definition and usage is reversed on the same level.
Leaving here as a record. I thought it would be easier to just transform it into a function declaration but snippets are actually block-scoped so the following won't be flagged as an error if it was transformed to a var or a function declaration but would result in a runtime error. This might also mean, at least nested one, const is more correct than the current var.
#2444#2417#2425#2385 (comment)
The snippet is now transformed into a function with the return type so that The default parameter type can be inferred:
`const foo = (a: string, b = 1): ReturnType<import('svelte').Snippet> => {}`
Describe the bug
Snippets are available anywhere in their scope.
The language tools falsely surface errors if the order of definition and usage is reversed on the same level.
Reproduction
Expected behaviour
No error.
System Info
Which package is the issue about?
No response
Additional Information, eg. Screenshots
No response
The text was updated successfully, but these errors were encountered: