I just wrote this code:
dirtyProperties() {
return this._getProperties()
.filter(([ prop ]) => prop.isDirty())
.map(([ _, propName ]) => propName);
}
and eslint threw a no-unused-vars error because of the _ variable.
Is this against the Airbnb style guide? I feel like using _ to ignore the first destructured variable should be pretty well understood and not using destructuring would make the code more verboe.
_ is just a convention. However, https://github.com/airbnb/javascript/blob/master/linters/.eslintrc#L46-L49 allows what you want in _arguments_ - I think this is just something eslint hasn't handled yet.
If I'm correct (and we're not just missing a rule for this) I'd suggest opening a bug on eslint itself, and request that rule exception.
Ooops, I just realized I can do [ , propName ].
Most helpful comment
Ooops, I just realized I can do
[ , propName ].