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
550 stars 21 forks source link

Stop content emitter detection also by contentEmittersDenylist #313

Closed mrmans0n closed 1 month ago

mrmans0n commented 1 month ago

Simplified the detection of potential content emitters in functions, with a slight behavior change:

Before, no children would be considered if the parents were any of these set of hardcoded composables:

    setOf(
        "AlertDialog",
        "DatePickerDialog",
        "Dialog",
        "ModalBottomSheetLayout",
        "ModalBottomSheet",
        "Popup",
    )

Now, no children will be considered if the parents were any of these hardcoded composables, plus any of the composables defined in contentEmittersDenylist in the rules configuration. That way, you can get rid of false positives that might have originated with your own foundational composables.