Find return Unit / return kotlin.Unit statements
ProprietaryFunctions that return Unit don't need an explicit return at all — return (no expression) or simply falling off the end is the conventional shape. Writing return Unit repeats the implicit value.
org. openrewrite. kotlin. bestpractices. FindRedundantReturnUnit$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. bestpractices. FindRedundantReturnUnit$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.