--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.js --- # Input ```jsx loop: for (let i = 0; i < 5; i++) { continue loop; } while (i--) { continue; } while (1) { continue; } for (let i = 0; i < 10; i++) { if (i > 5) { console.log("foo"); continue; } else if (i >= 5 && i < 8) { console.log("test"); } else { console.log("test"); } } for (let i = 0; i < 9; i++) { continue; } test: for (let i = 0; i < 9; i++) continue test; test2: do { continue test2; } while (true); ``` # Diagnostics ``` invalid.js:2:2 lint/correctness/noUnnecessaryContinue FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Unnecessary continue statement 1 │ loop: for (let i = 0; i < 5; i++) { > 2 │ continue loop; │ ^^^^^^^^^^^^^^ 3 │ } 4 │ i Unsafe fix: Delete the unnecessary continue statement 1 1 │ loop: for (let i = 0; i < 5; i++) { 2 │ - → continue·loop; 3 2 │ } 4 3 │ ``` ``` invalid.js:6:2 lint/correctness/noUnnecessaryContinue FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Unnecessary continue statement 5 │ while (i--) { > 6 │ continue; │ ^^^^^^^^^ 7 │ } 8 │ i Unsafe fix: Delete the unnecessary continue statement 4 4 │ 5 5 │ while (i--) { 6 │ - → continue; 7 6 │ } 8 7 │ ``` ``` invalid.js:10:2 lint/correctness/noUnnecessaryContinue FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Unnecessary continue statement 9 │ while (1) { > 10 │ continue; │ ^^^^^^^^^ 11 │ } 12 │ i Unsafe fix: Delete the unnecessary continue statement 8 8 │ 9 9 │ while (1) { 10 │ - → continue; 11 10 │ } 12 11 │ ``` ``` invalid.js:16:3 lint/correctness/noUnnecessaryContinue FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Unnecessary continue statement 14 │ if (i > 5) { 15 │ console.log("foo"); > 16 │ continue; │ ^^^^^^^^^ 17 │ } else if (i >= 5 && i < 8) { 18 │ console.log("test"); i Unsafe fix: Delete the unnecessary continue statement 14 14 │ if (i > 5) { 15 15 │ console.log("foo"); 16 │ - → → continue; 17 │ - → }·else·if·(i·>=·5·&&·i·<·8)·{ 16 │ + → }·else·if·(i·>=·5·&&·i·<·8)·{ 18 17 │ console.log("test"); 19 18 │ } else { ``` ``` invalid.js:25:2 lint/correctness/noUnnecessaryContinue FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Unnecessary continue statement 24 │ for (let i = 0; i < 9; i++) { > 25 │ continue; │ ^^^^^^^^^ 26 │ } 27 │ i Unsafe fix: Delete the unnecessary continue statement 23 23 │ 24 24 │ for (let i = 0; i < 9; i++) { 25 │ - → continue; 26 25 │ } 27 26 │ ``` ``` invalid.js:28:35 lint/correctness/noUnnecessaryContinue FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Unnecessary continue statement 26 │ } 27 │ > 28 │ test: for (let i = 0; i < 9; i++) continue test; │ ^^^^^^^^^^^^^^ 29 │ 30 │ test2: do { i Unsafe fix: Delete the unnecessary continue statement 28 │ test:·for·(let·i·=·0;·i·<·9;·i++)·continue·test; │ ------------- ``` ``` invalid.js:31:2 lint/correctness/noUnnecessaryContinue FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Unnecessary continue statement 30 │ test2: do { > 31 │ continue test2; │ ^^^^^^^^^^^^^^^ 32 │ } while (true); i Unsafe fix: Delete the unnecessary continue statement 29 29 │ 30 30 │ test2: do { 31 │ - → continue·test2; 32 31 │ } while (true); ```