Find data class declarations with List<T> properties

Proprietary

When a data class is passed to a @Composable and one of its properties is a kotlin.collections.List<T>, Compose marks the entire class unstable. Wrap the list in ImmutableList<T> from kotlinx.collections.immutable (or split the list out and remember it separately) so stability inference can prove the holder is @Stable.

org.openrewrite.kotlin.compose.FindDataClassWithListProperty$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.compose.FindDataClassWithListProperty$KtRecipe'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.