mrmans0n / compose-rules

Lint rules for ktlint/detekt aimed to contribute to a healthier usage of Compose. Actively maintained and evolved fork of the Twitter Compose rules.
https://mrmans0n.github.io/compose-rules
Other
543 stars 20 forks source link

ModifierNotUsedAtRoot reports misuses when a denylisted content emitter / non emitter is used #240

Closed mrmans0n closed 4 months ago

mrmans0n commented 4 months ago

ModifierNotUsedAtRoot needs to allow for configuration of contentEmittersDenylist so they can be ignored, plus ignore the basic non-emitters.

Example of false positive (excuse the stupidness of the example itself lol):

@Composable
fun A(modifier: Modifier = Modifier) {
  Dialog { // <- Dialog can't have a modifier
    Surface(..., modifier = modifier, ...) { ... }
  }
}