noMultiAssign
Ta treść nie jest jeszcze dostępna w Twoim języku.
Summary
Section titled “Summary”- Rule available since:
v2.3.11 - 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.
ℹ This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information.
const foo = "baz";const bar = "baz";Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.