Find named companion object Constants patterns
ProprietaryA companion object Constants { const val X = ... } adds a named singleton to hold what are essentially file-level constants. Promote the constants to top-level const vals — they read the same and avoid the synthetic holder class.
org. openrewrite. kotlin. bestpractices. FindNamedCompanionObjectOfConstants$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. bestpractices. FindNamedCompanionObjectOfConstants$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.