twitter / compose-rules

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

ModifierWithoutDefault for functions without a measurable size #114

Open eygraber opened 1 year ago

eygraber commented 1 year ago

Is your feature request related to a problem? Please describe. The compose API guidelines say that:

Element functions without a measurable content size (e.g. Canvas, which draws arbitrary user content in the size available) MAY require the modifier parameter and omit the default value.

Describe the solution you'd like That the rule doesn't fail for functions without a measurable size.

Describe alternatives you've considered Suppressing the rule in situations where there's a function without a measurable size.

I'm not sure if the Layout function falls into this category or not. Maybe a separate issue is warranted, but as an aside, should this rule apply to non public functions?