regal
regal copied to clipboard
Rule: `unnecessary-unification`
Avoid
input.number = 5
Prefer
input.number == 5
Motivation: while there are a few valid cases for unification, the unification operator (=) should not be used for simple comparison. TBD — more comprehensive explanation.
Merging this issue with #3 as I think a single rule to cover this is better, and more likely easier to implement as well. Rather than trying to detect if the intent is assignment or comparison, simply check whether the unification operator is necesseray at all. The cases where the unification operator is "necessary" are few, I think. Too tired to think right now 😅 @srenatus any good example cases you can think of?