Assignments within sub-expressions are hard to spot and therefore make the code less readable. Ideally, sub-expressions should not have side-effects.
if (val = value() && check()) { // Noncompliant
// ...
}
val = value();
if (val && check()) {
// ...
}
The rule does not raise issues for the following patterns:
let a = b = 0; a = b = c = 0; (a = 0) != b a = 0, b = 1, c = 2 () => a = 0 a || (a = 0) while (a = 0);