Use logical assignment operator shorthand

Proprietary

Converts a = a || b and a || (a = b) into the ES2021 logical assignment shorthand a ||= b, and equivalently for &&= and ??=. Replicates the autofix of the ESLint rule logical-assignment-operators under its default options.

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

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