Disallow "Yoda" conditions

Proprietary

Flips comparisons that have a literal on the left and a non-literal expression on the right, so the variable reads first. For example, "red" === color becomes color === "red" and 5 > count becomes count < 5. Directional operators are mirrored when the operands swap. Replicates the autofix of the ESLint rule yoda under its default options.

org.openrewrite.javascript.cleanup.Yoda
mod run . --recipe=org.openrewrite.javascript.cleanup.Yoda

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