You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New rule: consider_making_a_member_private (if its not used outside) #93
changed the title [-]New rule: consider_making_a_field_private (if its not used outside)[/-][+]New rule: consider_making_a_member_private (if its not used outside)[/+]on Apr 17, 2024
I'm very excited for this one! I could see it being very valuable for any class members. For some reason, Dart doesn't recognize that a member is unused unless it's private. So this would be a double whammy if it enforced all members that could be public were public.
Should this only be applied to class members? What about top-level ones and class definitions themselves? I think it would be worth having it to all definitions, because top-level functions that are only used internally also add noise to code completion. As a bonus, it could help us identify unused definitions (something that I used to do with dart code metrics).
Reacted by Kyle Venn, Nathnael Legesse and danylo-safonov-solid
@kevmoo just published a new package that is related to this rule: https://pub.dev/packages/undead. What is proposed here is probably slightly different from this new package, but let's think about how it affects this request and whether depending on undead or other Kevin's work will make better sense.
This'll help with dead_code
BAD:
GOOD: