-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
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 [email protected]:240a015b7833fd6628c5c8ccfaa7938e.git test-ts-unused
cd test-ts-unused
tsc
Related Issues:
HaveSpacesuit, jakobrosenberg, danilofuchs, andriyor, hydRAnger and 1 more
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug