-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Code fix prefix unused2 #16309
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
Code fix prefix unused2 #16309
Conversation
@@ -18,7 +18,9 @@ namespace ts.codefix { | |||
|
|||
switch (token.kind) { | |||
case ts.SyntaxKind.Identifier: | |||
return deleteIdentifier(); | |||
let actions = deleteIdentifier(<Identifier>token); | |||
(actions || (actions = [])).push(prefixIdentifierWithUnderscore(<Identifier>token)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should not do this all the time. only for parameters and for..of/for .. in variables
//// } |] | ||
|
||
verify.rangeAfterCodeFix(`namespace greeter { | ||
class _class1 { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is still an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to condition the _
addition
* for-in * for-of * parameters
@mhegazy can you take another look? |
please port this to release-2.4 |
port #16309 (prefix unused with _) to release-2.4
Fixes #14420.
Note that we do not add underscores for parameter declarations or imports, as underscores do no work for suppressing unused errors for these constructs.