- 
                Notifications
    
You must be signed in to change notification settings  - Fork 13.1k
 
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
Milestone
Description
TypeScript Version: 2.8.0-dev.20180302
Search Terms: "remove declaration for" remove declaration destructuring
Code
--noUnusedLocals needs to be on.
The "remove declaration for" quick fix for unused locals is broken:
function f() {
	const {abs, floor, ceil} = Math
	const {sin, cos, tan} = Math
}Expected behavior:
After code fix on abs:
function f() {
	const {floor, ceil} = Math
	const {sin, cos, tan} = Math
}After code fix "fix all":
function f() {
}Possible side effects of the RHS are ignored by the const abs = Math.abs quick fix, so this should be mirrored here.
Actual behavior:
function f() {
	const {, floor, ceil} = Math
	const {sin, cos, tan} = Math
}After code fix "fix all":
function f() {
	const {,,} = Math
	const {,,} = Math
}screencast: https://gfycat.com/SleepyEnchantingArcticfox
Related Issues:
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this