Use logical assignment operator shorthand
ProprietaryConverts 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. LogicalAssignmentOperatorsmod run . --recipe= org. openrewrite. javascript. cleanup. LogicalAssignmentOperatorsInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.