-
Notifications
You must be signed in to change notification settings - Fork 889
The implementation of the 'no-unused-variable' rule breaks the tslint language service plugin #2649
Comments
actually I'll leave this open until we get verification that it's fixed via #2819 |
@adidahiya, I seem to still be hitting this with the following:
Workaround of disabling rule |
@BurtHarris @adidahiya There is another issue - #2876 - with the |
Similar As @BurtHarris, the same warning keeps comming. Apparently, there is no fix yet. |
Can someone summarise what needs to be done to get |
@donaldpipowitch here is my attempt of a summary: vscode-vs-tslint
tslint
|
A big thank you! 👏 |
@donaldpipowitch please do not forgot that using tslint as a TS language server plugin has several limitations: angelozerr/tslint-language-service#32 |
Any plans on fixing this? |
As the |
@strax works for me, many thanks! Do you have plans for this plugin to differentiate between unused parameters and locals (noUnusedParameters / noUnusedLocals)? I only want warnings for the latter (unused imports). |
@sbusch That might be tricky since TS emits the same error code for both unused variables and suggestions, and there's no obvious way to get the related symbol / AST node. PRs for the functionality are certainly welcome. |
I came to this issue while looking for a solution allowing us to use no-unused-variable together with typescript-tslint-plugin. The module Personally, I much more like the rule YMMV. |
Oh hey, this issue can be closed now that Discussion on how to reenable it (and hopefully other language features such as noImplicitAny): #4100 |
The short story is that the implementation of the 'no-unused-variable' rule reuses the TS compiler options
noUnusedLocals
andnoUnusedParameters
. This is done by creating a typescriptProgram
with these options enabled. TheProgram
is created with a 'fake' Host object, This Host object doesn't honor the platform's case sensitive conventions. This has the side effect that the Program ends up in an inconsistent state and breaks the TypeScript server and makes the tslint-languageservice-plugin unusable.The full details of the issue can be found here: microsoft/TypeScript#15344
As a workaround the tslint-language-service plugin removes the 'no-unused-variable' rule from the user's configuration.
The text was updated successfully, but these errors were encountered: