src/content/docs/linter/rules/no-multi-assign.mdx
import { Tabs, TabItem } from '@astrojs/starlight/components';
<Tabs> <TabItem label="JavaScript (and super languages)" icon="seti:javascript"> :::caution This rule is part of the [nursery](/linter/#nursery) group. This means that it is experimental and the behavior can change at any time. ::: ## Summary - Rule available since: `v2.3.11` - Diagnostic Category: [`lint/nursery/noMultiAssign`](/reference/diagnostics#diagnostic-category) - This rule doesn't have a fix. - The default severity of this rule is [**information**](/reference/diagnostics#information). - Sources: - Inspired from [`no-multi-assign`](https://eslint.org/docs/latest/rules/no-multi-assign){
"linter": {
"rules": {
"nursery": {
"noMultiAssign": "error"
}
}
}
}
Disallow use of chained assignment expressions
Chaining the assignment of variables can lead to unexpected results and be difficult to read.
const foo = bar = "baz";
const foo = "baz";
const bar = "baz";