noMisrefactoredShorthandAssign (since v1.3.0)
Diagnostic Category: lint/suspicious/noMisrefactoredShorthandAssign
Sources:
- Same as: 
misrefactored_assign_op 
Disallow shorthand assign when variable appears on both sides.
This rule helps to avoid potential bugs related to incorrect assignments or unintended side effects that may occur during refactoring.
Examples
Section titled ExamplesInvalid
Section titled Invalida += a + bcode-block.js:1:1 lint/suspicious/noMisrefactoredShorthandAssign  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Variable appears on both sides of an assignment operation.
  
  > 1 │ a += a + b
      │ ^^^^^^^^^^
    2 │ 
  
  ℹ This assignment might be the result of a wrong refactoring.
  
  ℹ Unsafe fix: Use a += b instead.
  
    1 │ a·+=·a·+·b
      │      ---- 
a -= a - bcode-block.js:1:1 lint/suspicious/noMisrefactoredShorthandAssign  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Variable appears on both sides of an assignment operation.
  
  > 1 │ a -= a - b
      │ ^^^^^^^^^^
    2 │ 
  
  ℹ This assignment might be the result of a wrong refactoring.
  
  ℹ Unsafe fix: Use a -= b instead.
  
    1 │ a·-=·a·-·b
      │      ---- 
a *= a * bcode-block.js:1:1 lint/suspicious/noMisrefactoredShorthandAssign  FIXABLE  ━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Variable appears on both sides of an assignment operation.
  
  > 1 │ a *= a * b
      │ ^^^^^^^^^^
    2 │ 
  
  ℹ This assignment might be the result of a wrong refactoring.
  
  ℹ Unsafe fix: Use a *= b instead.
  
    1 │ a·*=·a·*·b
      │      ---- 
Valid
Section titled Valida += ba = a + ba = a - b