noLabelVar
Esta página aún no está disponible en tu idioma.
Summary
Section titled “Summary”- Rule available since: 
v1.0.0 - Diagnostic Category: 
lint/suspicious/noLabelVar - This rule is recommended, which means is enabled by default.
 - This rule doesn’t have a fix.
 - The default severity of this rule is error.
 - Sources:
- Same as 
no-label-var 
 - Same as 
 
How to configure
Section titled “How to configure”{  "linter": {    "rules": {      "suspicious": {        "noLabelVar": "error"      }    }  }}Description
Section titled “Description”Disallow labels that share a name with a variable
Examples
Section titled “Examples”Invalid
Section titled “Invalid”const x1 = "test";x1: expr;code-block.js:2:1 lint/suspicious/noLabelVar ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ✖ Do not use the x1 variable name as a label
  
    1 │ const x1 = “test”;
  > 2 │ x1: expr;
      │ ^^
    3 │ 
  
  ℹ The variable is declared here
  
  > 1 │ const x1 = “test”;
      │       ^^
    2 │ x1: expr;
    3 │ 
  
  ℹ Creating a label with the same name as an in-scope variable leads to confusion.
  
const x = "test";z: expr;Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.