dart-lang / linter

Linter for Dart.
https://dart.dev/tools/linter-rules
BSD 3-Clause "New" or "Revised" License
628 stars 172 forks source link

proposal: `avoid_unused_private_function_parameters` #4957

Open stephane-archer opened 2 months ago

stephane-archer commented 2 months ago

does it make any sense to have unused function parameters when the function is private in a class?


class foo {
void _bar(int I) {
print("hello word");
}
}
lrhn commented 1 month ago

Maybe.

If you override the method in subclasses inside the same library, and the other methods use the parameter.

If you tear off the method and pass it to something expecting a parameter.

stephane-archer commented 1 month ago

Can an optional lint, in that case, could make sense? Not everyone needs to do this and an unused parameters can be hard to spot in your codebase.