-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Handle BindingElement in fixUnusedIdentifier #23819
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
Conversation
//// x; | ||
////} | ||
////{ | ||
//// const { x, y } = o; |
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.
Would it be interesting to test the case where only one variable is declared and it is unused? Or is that covered by the other PR?
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.
That should be covered by #23805.
@@ -171,6 +171,10 @@ namespace ts.codefix { | |||
} | |||
break; | |||
|
|||
case SyntaxKind.BindingElement: |
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.
ArrayBindingPatterens are positional, so not sure how that works with them.. can you add a test for:
var [x, y, z] = [0, 1, 2];
y;
e892692
to
8671615
Compare
8671615
to
2b47e15
Compare
Fixes half of #22330 -- other half fixed by #23805.