Prefer direct Either operations over projections

Proprietary

Finds usages of .left and .right projections on Either. Since Scala 2.13, Either is right-biased so map/flatMap work directly. Use swap to operate on the Left side instead of .left.

org.openrewrite.scala.errorhandling.PreferDirectEitherOps
mod run . --recipe=org.openrewrite.scala.errorhandling.PreferDirectEitherOps

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