--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.js --- # Input ```jsx a += (a + b) object.a += object.a + b; a -= a - b a *= a * b a *= b * a a /= a / b a %= a % b a **= a ** b a >>= a >> b a <<= a << b a >>>= a >>> b a &= a & b a &= b & a a |= a | b a |= b | a a ^= a ^ b a ^= b ^ a ``` # Diagnostics ``` invalid.js:1:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. > 1 │ a += (a + b) │ ^^^^^^^^^^^^ 2 │ 3 │ object.a += object.a + b; i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a += b instead. 1 │ a·+=·(a·+·b) │ ----- - ``` ``` invalid.js:3:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 1 │ a += (a + b) 2 │ > 3 │ object.a += object.a + b; │ ^^^^^^^^^^^^^^^^^^^^^^^^ 4 │ 5 │ a -= a - b i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use object.a += b instead. 3 │ object.a·+=·object.a·+·b; │ ----------- ``` ``` invalid.js:5:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 3 │ object.a += object.a + b; 4 │ > 5 │ a -= a - b │ ^^^^^^^^^^ 6 │ 7 │ a *= a * b i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a -= b instead. 5 │ a·-=·a·-·b │ ---- ``` ``` invalid.js:7:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 5 │ a -= a - b 6 │ > 7 │ a *= a * b │ ^^^^^^^^^^ 8 │ 9 │ a *= b * a i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a *= b instead. 7 │ a·*=·a·*·b │ ---- ``` ``` invalid.js:9:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 7 │ a *= a * b 8 │ > 9 │ a *= b * a │ ^^^^^^^^^^ 10 │ 11 │ a /= a / b i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a *= b instead. 9 │ a·*=·b·*·a │ ---- ``` ``` invalid.js:11:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 9 │ a *= b * a 10 │ > 11 │ a /= a / b │ ^^^^^^^^^^ 12 │ 13 │ a %= a % b i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a /= b instead. 11 │ a·/=·a·/·b │ ---- ``` ``` invalid.js:13:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 11 │ a /= a / b 12 │ > 13 │ a %= a % b │ ^^^^^^^^^^ 14 │ 15 │ a **= a ** b i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a %= b instead. 13 │ a·%=·a·%·b │ ---- ``` ``` invalid.js:15:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 13 │ a %= a % b 14 │ > 15 │ a **= a ** b │ ^^^^^^^^^^^^ 16 │ 17 │ a >>= a >> b i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a **= b instead. 15 │ a·**=·a·**·b │ ----- ``` ``` invalid.js:17:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 15 │ a **= a ** b 16 │ > 17 │ a >>= a >> b │ ^^^^^^^^^^^^ 18 │ 19 │ a <<= a << b i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a >>= b instead. 17 │ a·>>=·a·>>·b │ ----- ``` ``` invalid.js:19:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 17 │ a >>= a >> b 18 │ > 19 │ a <<= a << b │ ^^^^^^^^^^^^ 20 │ 21 │ a >>>= a >>> b i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a <<= b instead. 19 │ a·<<=·a·<<·b │ ----- ``` ``` invalid.js:21:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 19 │ a <<= a << b 20 │ > 21 │ a >>>= a >>> b │ ^^^^^^^^^^^^^^ 22 │ 23 │ a &= a & b i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a >>>= b instead. 21 │ a·>>>=·a·>>>·b │ ------ ``` ``` invalid.js:23:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 21 │ a >>>= a >>> b 22 │ > 23 │ a &= a & b │ ^^^^^^^^^^ 24 │ 25 │ a &= b & a i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a &= b instead. 23 │ a·&=·a·&·b │ ---- ``` ``` invalid.js:25:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 23 │ a &= a & b 24 │ > 25 │ a &= b & a │ ^^^^^^^^^^ 26 │ 27 │ a |= a | b i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a &= b instead. 25 │ a·&=·b·&·a │ ---- ``` ``` invalid.js:27:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 25 │ a &= b & a 26 │ > 27 │ a |= a | b │ ^^^^^^^^^^ 28 │ 29 │ a |= b | a i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a |= b instead. 27 │ a·|=·a·|·b │ ---- ``` ``` invalid.js:29:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 27 │ a |= a | b 28 │ > 29 │ a |= b | a │ ^^^^^^^^^^ 30 │ 31 │ a ^= a ^ b i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a |= b instead. 29 │ a·|=·b·|·a │ ---- ``` ``` invalid.js:31:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 29 │ a |= b | a 30 │ > 31 │ a ^= a ^ b │ ^^^^^^^^^^ 32 │ 33 │ a ^= b ^ a i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a ^= b instead. 31 │ a·^=·a·^·b │ ---- ``` ``` invalid.js:33:1 lint/suspicious/noMisrefactoredShorthandAssign FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Variable appears on both sides of an assignment operation. 31 │ a ^= a ^ b 32 │ > 33 │ a ^= b ^ a │ ^^^^^^^^^^ 34 │ i This assignment might be the result of a wrong refactoring. i Unsafe fix: Use a ^= b instead. 33 │ a·^=·b·^·a │ ---- ```