You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I thought about allowing underscore prefixed variables in array destructuring (similar to object destructuring).
But in array destructuring you can simply omit the variable completely. That's why I decided not to allow them:
const[_one,two,_three,_four,five]=arr;console.log(two,five);// can be simplified toconst[,two,,five]=arr;console.log(two,five);
I'd like to hear your opinion why this is not the way to go for you.
Funnily enough, naming-convention can already do this indirectly by setting an unused regex with an underscore, but that feels too rube-goldberg for me to feel okay introducing it at work.
Just a suggestion... similar to
no-unused-variable
:This allows you to use things like
_
for array destructuring in parameters to skip no-unused for them.The text was updated successfully, but these errors were encountered: