menu

operator-assignment

Require compound assignment where equivalent

place = place + value reads and writes the same stable place and is equivalent to place += value. Instead, you SHOULD use the corresponding compound assignment.

Reported

1function advance(value: int32): int32 {2    let result = value;3    result = result + 1;4    return result;5}

Accepted

1function advance(value: int32): int32 {2    let result = value;3    result += 1;4    return result;5}