--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: TerminatorsPlurals.js --- # Input ```jsx function TerminatorsPlural1() { return; Statement1(); Statement2(); Statement3(); Statement4(); } function TerminatorsPlural2() { if (a) { return; } else { return; } Statement1(); Statement2(); Statement3(); Statement4(); } function TerminatorsPlural3() { if (a) { return; } else if (b) { return; } else { return; } Statement1(); Statement2(); Statement3(); Statement4(); } function TerminatorsPlural4() { if (a) { return; } else if (b) { return; } else if (c) { return; } else { return; } Statement1(); Statement2(); Statement3(); Statement4(); } ``` # Diagnostics ``` TerminatorsPlurals.js:3:5 lint/correctness/noUnreachable ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This code will never be reached ... 1 │ function TerminatorsPlural1() { 2 │ return; > 3 │ Statement1(); │ ^^^^^^^^^^^^^ > 4 │ Statement2(); > 5 │ Statement3(); > 6 │ Statement4(); │ ^^^^^^^^^^^^^ 7 │ } 8 │ i ... because this statement will return from the function beforehand 1 │ function TerminatorsPlural1() { > 2 │ return; │ ^^^^^^^ 3 │ Statement1(); 4 │ Statement2(); ``` ``` TerminatorsPlurals.js:16:5 lint/correctness/noUnreachable ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This code will never be reached ... 14 │ } 15 │ > 16 │ Statement1(); │ ^^^^^^^^^^^^^ > 17 │ Statement2(); > 18 │ Statement3(); > 19 │ Statement4(); │ ^^^^^^^^^^^^^ 20 │ } 21 │ i ... because either this statement ... 9 │ function TerminatorsPlural2() { 10 │ if (a) { > 11 │ return; │ ^^^^^^^ 12 │ } else { 13 │ return; i ... or this statement will return from the function beforehand 11 │ return; 12 │ } else { > 13 │ return; │ ^^^^^^^ 14 │ } 15 │ ``` ``` TerminatorsPlurals.js:31:5 lint/correctness/noUnreachable ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This code will never be reached ... 29 │ } 30 │ > 31 │ Statement1(); │ ^^^^^^^^^^^^^ > 32 │ Statement2(); > 33 │ Statement3(); > 34 │ Statement4(); │ ^^^^^^^^^^^^^ 35 │ } 36 │ i ... because either this statement, ... 22 │ function TerminatorsPlural3() { 23 │ if (a) { > 24 │ return; │ ^^^^^^^ 25 │ } else if (b) { 26 │ return; i ... this statement, ... 24 │ return; 25 │ } else if (b) { > 26 │ return; │ ^^^^^^^ 27 │ } else { 28 │ return; i ... or this statement will return from the function beforehand 26 │ return; 27 │ } else { > 28 │ return; │ ^^^^^^^ 29 │ } 30 │ ``` ``` TerminatorsPlurals.js:48:5 lint/correctness/noUnreachable ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This code will never be reached ... 46 │ } 47 │ > 48 │ Statement1(); │ ^^^^^^^^^^^^^ > 49 │ Statement2(); > 50 │ Statement3(); > 51 │ Statement4(); │ ^^^^^^^^^^^^^ 52 │ } 53 │ i ... because either this statement, ... 37 │ function TerminatorsPlural4() { 38 │ if (a) { > 39 │ return; │ ^^^^^^^ 40 │ } else if (b) { 41 │ return; i ... this statement, ... 39 │ return; 40 │ } else if (b) { > 41 │ return; │ ^^^^^^^ 42 │ } else if (c) { 43 │ return; i ... this statement, ... 41 │ return; 42 │ } else if (c) { > 43 │ return; │ ^^^^^^^ 44 │ } else { 45 │ return; i ... or this statement will return from the function beforehand 43 │ return; 44 │ } else { > 45 │ return; │ ^^^^^^^ 46 │ } 47 │ ```