Use operator-assignment shorthand where possible

Proprietary

Converts assignments like x = x + y into the equivalent operator-assignment shorthand x += y for the arithmetic and bitwise operators +, -, *, /, %, **, <<, >>, >>>, &, ^ and |. Only applies where the target is a name, a property of a name or of this, or an element with a literal key, and is the left operand. An assignment whose comments the rewrite would drop is left unchanged, including, unlike ESLint, a comment inside the parentheses around the right side. Replicates the autofix of the ESLint rule operator-assignment under its default options.

io.moderne.javascript.cleanup.OperatorAssignment
mod run . --recipe=io.moderne.javascript.cleanup.OperatorAssignment

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