--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.js --- # Input ```jsx const x1 = "test"; x1: expr; // nested scope function test() { { x1: for (let i = 0; i < 10; i++) { } } } ``` # Diagnostics ``` invalid.js:2:1 lint/suspicious/noLabelVar ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Do not use the x1 variable name as a label 1 │ const x1 = "test"; > 2 │ x1: expr; │ ^^ 3 │ 4 │ // nested scope i The variable is declared here > 1 │ const x1 = "test"; │ ^^ 2 │ x1: expr; 3 │ i Creating a label with the same name as an in-scope variable leads to confusion. ``` ``` invalid.js:7:5 lint/suspicious/noLabelVar ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Do not use the x1 variable name as a label 5 │ function test() { 6 │ { > 7 │ x1: for (let i = 0; i < 10; i++) { │ ^^ 8 │ } 9 │ } i The variable is declared here > 1 │ const x1 = "test"; │ ^^ 2 │ x1: expr; 3 │ i Creating a label with the same name as an in-scope variable leads to confusion. ```