Open sindresorhus opened 3 months ago
Since $_
is allowed as a parameter, the same rules used for normal parameters apply here as well. In the example, if any of $historyItem
or historyItem
is used in the closure block, $historyItem
can be considered to be used. If there is no reference at all, it can be replaced with $_
(or $_historyItem
once that's implemented).
However, silencing the rule completely for $
-prefixed parameters might be too cautious.
New Issue Checklist
Bug Description
The rule triggers on
$historyItem
, but the parameter is kinda used.$historyItem
results in a binding, but it also makes it possible to access the normal variable withhistoryItem
implicitly. So even though$historyItem
is not directly used, it cannot be removed.In short, make it not trigger on
$
-prefixed parameters in a closure.Environment