no-multi-assign
Configuration
rslint.config.ts
Rule Details
This rule disallows chained assignment expressions within a single statement, such as a = b = c. Chained assignments are often a sign of a typo (foo = bar == 0 was meant) and they hide whether each name is being declared or merely reassigned, which can lead to surprising scope and const-vs-let mistakes.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
Options
This rule has an object option:
"ignoreNonDeclaration": When set totrue, allows chained assignments that do not introduce new declarations (i.e. plainAssignmentExpressions). Defaults tofalse.
Examples of correct code for this rule with { "ignoreNonDeclaration": true }:
Examples of incorrect code for this rule with { "ignoreNonDeclaration": true }: