--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: SuppressionComments.js --- # Input ```jsx // rome-ignore lint/correctness/noUnreachable: this comment does nothing function SuppressionComments1() { beforeReturn(); return; afterReturn(); } function SuppressionComments2() { beforeReturn(); return; // rome-ignore lint/correctness/noUnreachable: supress warning afterReturn(); } ``` # Diagnostics ``` SuppressionComments.js:1:1 suppressions/deprecatedSuppressionComment FIXABLE DEPRECATED ━━━━━━━━━━ ! // rome-ignore is deprecated, use // biome-ignore instead > 1 │ // rome-ignore lint/correctness/noUnreachable: this comment does nothing │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 │ function SuppressionComments1() { 3 │ beforeReturn(); i Unsafe fix: Use // biome-ignore instead 1 │ - //·rome-ignore·lint/correctness/noUnreachable:·this·comment·does·nothing 1 │ + //·biome-ignore·lint/correctness/noUnreachable:·this·comment·does·nothing 2 2 │ function SuppressionComments1() { 3 3 │ beforeReturn(); 4 4 │ return; 5 5 │ afterReturn(); 6 │ - } 6 │ + } 7 │ + 8 │ + function·SuppressionComments2()·{ 9 │ + ····beforeReturn(); 10 │ + ····return; 11 │ + ····//·rome-ignore·lint/correctness/noUnreachable:·supress·warning 12 │ + ····afterReturn(); 13 │ + } 14 │ + ``` ``` SuppressionComments.js:5:5 lint/correctness/noUnreachable ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This code will never be reached ... 3 │ beforeReturn(); 4 │ return; > 5 │ afterReturn(); │ ^^^^^^^^^^^^^^ 6 │ } 7 │ i ... because this statement will return from the function beforehand 2 │ function SuppressionComments1() { 3 │ beforeReturn(); > 4 │ return; │ ^^^^^^^ 5 │ afterReturn(); 6 │ } ``` ``` SuppressionComments.js:11:5 suppressions/deprecatedSuppressionComment FIXABLE DEPRECATED ━━━━━━━━━━ ! // rome-ignore is deprecated, use // biome-ignore instead 9 │ beforeReturn(); 10 │ return; > 11 │ // rome-ignore lint/correctness/noUnreachable: supress warning │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 12 │ afterReturn(); 13 │ } i Unsafe fix: Use // biome-ignore instead 1 │ - 2 │ - ····//·rome-ignore·lint/correctness/noUnreachable:·supress·warning 3 │ - ····afterReturn 1 │ + //·rome-ignore·lint/correctness/noUnreachable:·this·comment·does·nothing 2 │ + function·SuppressionComments1()·{ 3 │ + ····beforeReturn(); 4 │ + ····return; 5 │ + ····afterReturn(); 6 │ + } 7 │ + 8 │ + function·SuppressionComments2()·{ 9 │ + ····beforeReturn(); 10 │ + ····return; 11 │ + ····//·biome-ignore·lint/correctness/noUnreachable:·supress·warning 12 │ + ····afterReturn(); 13 │ + } 14 │ + ``` ``` SuppressionComments.js:1:1 suppressions/unused ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Suppression comment is not being used > 1 │ // rome-ignore lint/correctness/noUnreachable: this comment does nothing │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2 │ function SuppressionComments1() { 3 │ beforeReturn(); ```