twitter / compose-rules

Static checks to aid with a healthy adoption of Compose
https://twitter.github.io/compose-rules
Other
1.36k stars 93 forks source link

Support Multipreview annotations in `ModifierMissing` rule #91

Closed msfjarvis closed 2 years ago

msfjarvis commented 2 years ago

Is your feature request related to a problem? Please describe.

Compose now supports providing multiple preview annotations through a "proxy" annotation as documented here, and this currently trips the ModifierMissing lint since it only checks for the Preview annotation.

Describe the solution you'd like

One of these two, depending on complexity

Describe alternatives you've considered

🤷🏼

Additional context

mrmans0n commented 2 years ago

I think we can do something like this here:

Adding an allowlist of names would also be interesting so that could be done on top of that too.

msfjarvis commented 2 years ago

and then filter out the annotations with that prefix in the ModifierMissing rule.

I'm assuming you meant suffix here?

Other than that, sounds like a plan! Would it be easier to do this internally or can I send a PR?

mrmans0n commented 2 years ago

Haha, yes, I meant suffix 🤦

No worries, I am already on it. I'll do them incrementally but likely ship them altogether in the next release