Skip to content

fix: prevent unused variable error for bindable #2710

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

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

jasonlyu123
Copy link
Member

@jasonlyu123 jasonlyu123 commented Mar 11, 2025

#2268

I was originally thinking about filtering it out in the language server so that it's easier to only filter out the props that are being reassigned. However, TypeScript combines the diagnostics into one when destructured variables are unused, this route won't work.

As for why the error isn't reliable in the editor, I tried debugging and found that if the symbol is already analysed prior to the diagnostics, the error/hint won't show. So it's a race condition. Our diagnostics are delayed later than TSServer, so it's easier to trigger. (Edit. found a reproduction in ts file and filed a upstream issue)

@dummdidumm dummdidumm merged commit 05c515e into sveltejs:master Mar 13, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants