-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Svelte 5: TS property type annotations are not fully erased #12685
Comments
I vaguely remember TS saying that this may be the right behavior because of how classes work now, and if you use some new option to downlevel classes differently it's the same output - but I could be mistaken |
The new option is useDefineForClassFields and it's the default if target is ES2022 or higher. |
I tested changing the |
Describe the bug
If a property is only typed and not assigned, it should be removed from output, otherwise there can be issues with shadowing.
Reproduction
REPL
Class after Svelte strips the types:
In TS playground
(
vitePreprocess
andsveltePreprocess
seem to remove the properties.)Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: