Prefer pattern matching over asInstanceOf casts

Proprietary

Finds .asInstanceOf[T] type casts that should be replaced with pattern matching. Idiomatic Scala prefers pattern matching over explicit casts.

org.openrewrite.scala.cleanup.PreferPatternMatch
mod run . --recipe=org.openrewrite.scala.cleanup.PreferPatternMatch

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.