Closed Drjacky closed 1 year ago
Usually IDE highlights such cases, but I guess this can be made into a rule too. Detekt has similar rules such as "UnusedImport", so we can follow its lead here :)
I think that UnusedPrivateMember
should detect that. And it's provided out of the box by detekt. If it doesn't it seems like a bug in UnusedPrivateMember
. I mean, that use case doesn't feels like something special about Compose. Any unused parameter should be flagged.
Are you sure? This here is not a private member, but an unused function parameter. Or has UnusedPrivateMember
evolved to detect those too? I recall it can do many things :)
The name is clearly missleading. We could open an issue on detekt to rename it. But a function parameter is "private" in the function scope. As I said, missleading name but it should find this kind of issues. If it doesn't we should open an issue to detekt.
Hah, indeed this seems like a bug!
Reported it with more details here: https://github.com/detekt/detekt/issues/5373
Closing this issue, because once it will be fixed in detekt you'll be able to use built-in detekt rules for this type of issue.