noMultiAssign
このコンテンツはまだ日本語訳がありません。
Summary
Section titled “Summary”- Diagnostic Category:
lint/nursery/noMultiAssign - This rule doesn’t have a fix.
- The default severity of this rule is information.
- Sources:
- Inspired from
no-multi-assign
- Inspired from
How to configure
Section titled “How to configure”{ "linter": { "rules": { "nursery": { "noMultiAssign": "error" } } }}Description
Section titled “Description”Disallow use of chained assignment expressions
Chaining the assignment of variables can lead to unexpected results and be difficult to read.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”const foo = bar = "baz";code-block.js:1:7 lint/nursery/noMultiAssign ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ℹ Unexpected chained assignment.
> 1 │ const foo = bar = “baz”;
│ ^^^^^^^^^^^^^^^^^
2 │
ℹ Variables with chained assignments in declarations may cause unintended implicit globals or unexpected scoping.
ℹ Split into separate assignments.
const foo = "baz";const bar = "baz";Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.