Closed
Description
When destructing array, I want some variables/const to be declared but explicitly make them unused. Typescript has a feature of underscoring the unused parameters for functions:
const f = (a, _b) => a`)
But it doesn't work for array destruction:
const [a, _b] = [1, 2]
TypeScript Version: 3.5.0-dev.20190512
Search Terms:
- declared but never used noUnusedLocals
Code
const [a, _b] = [1, 2]
export default a
Expected behavior:
No error
Actual behavior:
Got an error, '_b' is declared but its value is never read
:
Playground Link:
git clone git@gist.github.com:240a015b7833fd6628c5c8ccfaa7938e.git test-ts-unused
cd test-ts-unused
tsc
Related Issues: