Open pq opened 1 month ago
As described here, the lint would conflict with avoid_renaming_method_parameters
for instance methods. That lint is there for several reasons, one being to ensure that inherited documentation stays correct.
Generally, there can be good reasons for having a name for a parameter that is not used, if the function is publicly visible. The parameter is there for a reason, its name may describe that reason. Even for private function declarations, it may be more useful to know the names of parameters that aren't used by this particular function implementation. If the parameter is there, it's probably because it means something, so if we can't remove the entire parameter, there can be reasons for the name.
Not always, it's also fine to decide that you don't care, or that you know that nobody will see this seemingly public function.
For function literals, used as a callback, it makes much more sense, because that's not also exposed as something you can call.
With wildcard variables, we have a proper way to mark unused parameters as intentionally unused. Given that, we might consider a lint that flags unused parameters with the expectation that intentionally unused params should either be removed or converted to wildcards.
For example:
BAD
GOOD
/fyi @kallentu @lrhn @munificent