Array destruction and unused vars marked by eslint

1.4k Views Asked by At

I have code like this in my code:

let [a, b, c, d, e] = await component.getState.call(game.gameId);

Variables b, c, e used below in code but not a and d. In the same time I have eslint check that marks unused variables.

Is there any way to write destruction more correct to resolve this issue? I know about esling-disable-line no-unused but prefer to avoid it.

1

There are 1 best solutions below

0
kiddorails On BEST ANSWER

Replace it with empty placeholders:

let [, b, c, , e] = await component.getState.call(game.gameId);