Find x?.something.orEmpty() patterns

Proprietary

x?.something.orEmpty() mixes safe-call and a null-coalescing extension. Either drop the ?. (if x is non-null) or chain through ?: emptyList() — the mix obscures which call is providing the fallback.

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