Find Compose ViewModel wiring issues

Proprietary

ViewModel acquisition inside composables — hiltViewModel<X>() and viewModel<X>() — and StateFlow exposure: MutableStateFlow without an asStateFlow() read-only view.

org.openrewrite.kotlin.compose.FindComposeViewModelIssues$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.compose.FindComposeViewModelIssues$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 hiltViewModel<X>() calls inside @Composable
  2. Find viewModel<X>() calls inside @Composable
  3. Find non-private MutableStateFlow properties