Find Flow.collect calls inside a @Composable

Proprietary

Flow.collect inside a @Composable ties collection to recomposition rather than the composable's lifecycle, leaking work on re-entry. Use collectAsStateWithLifecycle (Compose) or wrap with LaunchedEffect { flow.collect { … } }.

org.openrewrite.kotlin.coroutines.FindFlowCollectInsideCompose$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.coroutines.FindFlowCollectInsideCompose$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.