--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.js --- # Input ```jsx const foo = ` text ${a == b} `; // existing comment a == b; if (a == b) { false; } if (/** some weird comment **/ a == b) { } let a = `Output of "biome rage": formatter enabled: ${formatter == true} linter: ${linter} `; ``` # Diagnostics ``` invalid.js:3:5 lint/suspicious/noDoubleEquals FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use === instead of == 1 │ const foo = ` 2 │ text > 3 │ ${a == b} │ ^^ 4 │ `; 5 │ i == is only allowed when comparing against null 1 │ const foo = ` 2 │ text > 3 │ ${a == b} │ ^^ 4 │ `; 5 │ i Using == may be unsafe if you are relying on type coercion i Unsafe fix: Use === 3 │ ${a·===·b} │ + ``` ``` invalid.js:7:3 lint/suspicious/noDoubleEquals FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use === instead of == 6 │ // existing comment > 7 │ a == b; │ ^^ 8 │ 9 │ if (a == b) { i == is only allowed when comparing against null 6 │ // existing comment > 7 │ a == b; │ ^^ 8 │ 9 │ if (a == b) { i Using == may be unsafe if you are relying on type coercion i Unsafe fix: Use === 7 │ a·===·b; │ + ``` ``` invalid.js:9:7 lint/suspicious/noDoubleEquals FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use === instead of == 7 │ a == b; 8 │ > 9 │ if (a == b) { │ ^^ 10 │ false; 11 │ } i == is only allowed when comparing against null 7 │ a == b; 8 │ > 9 │ if (a == b) { │ ^^ 10 │ false; 11 │ } i Using == may be unsafe if you are relying on type coercion i Unsafe fix: Use === 9 │ if·(a·===·b)·{ │ + ``` ``` invalid.js:14:11 lint/suspicious/noDoubleEquals FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use === instead of == 13 │ if (/** some weird comment > 14 │ **/ a == b) { │ ^^ 15 │ 16 │ } i == is only allowed when comparing against null 13 │ if (/** some weird comment > 14 │ **/ a == b) { │ ^^ 15 │ 16 │ } i Using == may be unsafe if you are relying on type coercion i Unsafe fix: Use === 14 │ ····**/·a·===·b)·{ │ + ``` ``` invalid.js:19:34 lint/suspicious/noDoubleEquals FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! Use === instead of == 18 │ let a = `Output of "biome rage": > 19 │ formatter enabled: ${formatter == true} │ ^^ 20 │ linter: ${linter} 21 │ `; i == is only allowed when comparing against null 18 │ let a = `Output of "biome rage": > 19 │ formatter enabled: ${formatter == true} │ ^^ 20 │ linter: ${linter} 21 │ `; i Using == may be unsafe if you are relying on type coercion i Unsafe fix: Use === 19 │ ··formatter·enabled:·${formatter·===·true} │ + ```