no-cond-assign
Configuration
rslint.config.ts
Rule Details
Disallows assignment operators in conditional expressions (if, while, do-while, for, and ternary). Assignments in conditional statements are frequently a typo where the developer meant to use a comparison operator (===) instead of an assignment operator (=).
In the default "except-parens" mode, assignments are allowed if they are wrapped in extra parentheses, which signals the assignment is intentional. In "always" mode, all assignments in conditionals are flagged.
Examples of incorrect code for this rule:
Examples of correct code for this rule: