-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Unused variables are not shown as errors in VS Code when using noUnusedLocals
#55099
Comments
Sounds like a duplicate of #13408. |
Ah, thanks. 6 years old 🫠 |
This feels like the opposite of #13408 (TS should be able to treat some things as warnings instead of errors), in that a thing that |
TIL that option exists. I'm a bit baffled by its existence though, IMO it never makes sense to have the IDE report something as a warning that will be an error at compile time, "style check" or no. |
#37616 was the PR that originated this FWIW |
Oh wow, thanks so much @RyanCavanaugh. I scanned all the options but didn't realize that |
Bug Report
I'm using
noUnusedLocals
with TypeScript and VS Code. When a variable is unused, it will mark the variable with yellow squiggly lines (warning) instead of red ones (error) even though when running TypeScript with this option on the command line it shows the issue as an error. I expect that unused variables are reported as errors in VS Code.🕗 Version & Regression Information
Latest Version (5.1.x).
⏯ Playground Link
Does not apply.
💻 Code
tsconfig.json
contains:🙁 Actual behavior
Yellow squiggly lines:

🙂 Expected behavior
I would prefer them to be red, so that files in the tab view are also marked as red (error) for easier visual clarity, like when there are syntax or type errors:

The text was updated successfully, but these errors were encountered: