Find Compose effect-handler misuse

Proprietary

Effect calls whose shape mismatches the effect's contract: SideEffect(key) { } (SideEffect takes no keys); LaunchedEffect { } with no key (use LaunchedEffect(Unit)); LaunchedEffect lambdas with several distinct suspend calls that probably want splitting.

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

Recipe list

It runs these recipes, in this order.

  1. Find SideEffect(key) { … } calls
  2. Find LaunchedEffect { … } calls with no key argument
  3. Find LaunchedEffect bodies with several distinct suspend calls