Closed
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: