--- source: crates/biome_js_analyze/tests/spec_tests.rs expression: invalid.jsonc --- # Input ```cjs const a = s.toUpperCase() === 'abc'; ``` # Diagnostics ``` invalid.jsonc:1:11 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This expression always returns false. > 1 │ const a = s.toUpperCase() === 'abc'; │ ^^^^^^^^^^^^^^^^^^^^^^^^^ i This call convert the string to upper case > 1 │ const a = s.toUpperCase() === 'abc'; │ ^^^^^^^^^^^^^^^ i ... but this value is not in upper case > 1 │ const a = s.toUpperCase() === 'abc'; │ ^^^^^ i Unsafe fix: Use upper case string value. - const·a·=·s.toUpperCase()·===·'abc'; + const·a·=·s.toUpperCase()·===·"ABC"; ``` # Input ```cjs const c = s.toUpperCase() == 'abc'; ``` # Diagnostics ``` invalid.jsonc:1:11 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This expression always returns false. > 1 │ const c = s.toUpperCase() == 'abc'; │ ^^^^^^^^^^^^^^^^^^^^^^^^ i This call convert the string to upper case > 1 │ const c = s.toUpperCase() == 'abc'; │ ^^^^^^^^^^^^^^^ i ... but this value is not in upper case > 1 │ const c = s.toUpperCase() == 'abc'; │ ^^^^^ i Unsafe fix: Use upper case string value. - const·c·=·s.toUpperCase()·==·'abc'; + const·c·=·s.toUpperCase()·==·"ABC"; ``` # Input ```cjs const a2 = 'abc' === s.toUpperCase(); ``` # Diagnostics ``` invalid.jsonc:1:12 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This expression always returns false. > 1 │ const a2 = 'abc' === s.toUpperCase(); │ ^^^^^^^^^^^^^^^^^^^^^^^^^ i This call convert the string to upper case > 1 │ const a2 = 'abc' === s.toUpperCase(); │ ^^^^^^^^^^^^^^^ i ... but this value is not in upper case > 1 │ const a2 = 'abc' === s.toUpperCase(); │ ^^^^^ i Unsafe fix: Use upper case string value. - const·a2·=·'abc'·===·s.toUpperCase(); + const·a2·=·"ABC"·===·s.toUpperCase(); ``` # Input ```cjs if (s.toUpperCase() === 'abc' && c == d && e == f) {} ``` # Diagnostics ``` invalid.jsonc:1:5 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This expression always returns false. > 1 │ if (s.toUpperCase() === 'abc' && c == d && e == f) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^ i This call convert the string to upper case > 1 │ if (s.toUpperCase() === 'abc' && c == d && e == f) {} │ ^^^^^^^^^^^^^^^ i ... but this value is not in upper case > 1 │ if (s.toUpperCase() === 'abc' && c == d && e == f) {} │ ^^^^^ i Unsafe fix: Use upper case string value. - if·(s.toUpperCase()·===·'abc'·&&·c·==·d·&&·e·==·f)·{} + if·(s.toUpperCase()·===·"ABC"·&&·c·==·d·&&·e·==·f)·{} ``` # Input ```cjs while (s.toUpperCase() === 'abc' && c == d && e == f) {} ``` # Diagnostics ``` invalid.jsonc:1:8 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This expression always returns false. > 1 │ while (s.toUpperCase() === 'abc' && c == d && e == f) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^ i This call convert the string to upper case > 1 │ while (s.toUpperCase() === 'abc' && c == d && e == f) {} │ ^^^^^^^^^^^^^^^ i ... but this value is not in upper case > 1 │ while (s.toUpperCase() === 'abc' && c == d && e == f) {} │ ^^^^^ i Unsafe fix: Use upper case string value. - while·(s.toUpperCase()·===·'abc'·&&·c·==·d·&&·e·==·f)·{} + while·(s.toUpperCase()·===·"ABC"·&&·c·==·d·&&·e·==·f)·{} ``` # Input ```cjs while (s.toUpperCase() === 'abc') {} ``` # Diagnostics ``` invalid.jsonc:1:8 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This expression always returns false. > 1 │ while (s.toUpperCase() === 'abc') {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^ i This call convert the string to upper case > 1 │ while (s.toUpperCase() === 'abc') {} │ ^^^^^^^^^^^^^^^ i ... but this value is not in upper case > 1 │ while (s.toUpperCase() === 'abc') {} │ ^^^^^ i Unsafe fix: Use upper case string value. - while·(s.toUpperCase()·===·'abc')·{} + while·(s.toUpperCase()·===·"ABC")·{} ``` # Input ```cjs let b = s.toLowerCase() === `eFg`; ``` # Diagnostics ``` invalid.jsonc:1:9 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This expression always returns false. > 1 │ let b = s.toLowerCase() === `eFg`; │ ^^^^^^^^^^^^^^^^^^^^^^^^^ i This call convert the string to lower case > 1 │ let b = s.toLowerCase() === `eFg`; │ ^^^^^^^^^^^^^^^ i ... but this value is not in lower case > 1 │ let b = s.toLowerCase() === `eFg`; │ ^^^^^ i Unsafe fix: Use lower case string value. - let·b·=·s.toLowerCase()·===·`eFg`; + let·b·=·s.toLowerCase()·===·"efg"; ``` # Input ```cjs do {} while (s.toLowerCase() === 'ABC'); ``` # Diagnostics ``` invalid.jsonc:1:14 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This expression always returns false. > 1 │ do {} while (s.toLowerCase() === 'ABC'); │ ^^^^^^^^^^^^^^^^^^^^^^^^^ i This call convert the string to lower case > 1 │ do {} while (s.toLowerCase() === 'ABC'); │ ^^^^^^^^^^^^^^^ i ... but this value is not in lower case > 1 │ do {} while (s.toLowerCase() === 'ABC'); │ ^^^^^ i Unsafe fix: Use lower case string value. - do·{}·while·(s.toLowerCase()·===·'ABC'); + do·{}·while·(s.toLowerCase()·===·"abc"); ``` # Input ```cjs for (; s.toLowerCase() === 'ABC'; ) {} ``` # Diagnostics ``` invalid.jsonc:1:8 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This expression always returns false. > 1 │ for (; s.toLowerCase() === 'ABC'; ) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^ i This call convert the string to lower case > 1 │ for (; s.toLowerCase() === 'ABC'; ) {} │ ^^^^^^^^^^^^^^^ i ... but this value is not in lower case > 1 │ for (; s.toLowerCase() === 'ABC'; ) {} │ ^^^^^ i Unsafe fix: Use lower case string value. - for·(;·s.toLowerCase()·===·'ABC';·)·{} + for·(;·s.toLowerCase()·===·"abc";·)·{} ``` # Input ```cjs switch (s.toUpperCase()) { case 'ABC': case 'abc': case 'aBc': default: } ``` # Diagnostics ``` invalid.jsonc:1:45 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This case will never match. > 1 │ switch (s.toUpperCase()) { case 'ABC': case 'abc': case 'aBc': default: } │ ^^^^^ i This call convert the string to upper case > 1 │ switch (s.toUpperCase()) { case 'ABC': case 'abc': case 'aBc': default: } │ ^^^^^^^^^^^^^^^ i ... but this value is not in upper case > 1 │ switch (s.toUpperCase()) { case 'ABC': case 'abc': case 'aBc': default: } │ ^^^^^ i Unsafe fix: Use upper case string value. - switch·(s.toUpperCase())·{·case·'ABC':·case·'abc':·case·'aBc':·default:·} + switch·(s.toUpperCase())·{·case·'ABC':·case·"ABC":·case·'aBc':·default:·} ``` ``` invalid.jsonc:1:57 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This case will never match. > 1 │ switch (s.toUpperCase()) { case 'ABC': case 'abc': case 'aBc': default: } │ ^^^^^ i This call convert the string to upper case > 1 │ switch (s.toUpperCase()) { case 'ABC': case 'abc': case 'aBc': default: } │ ^^^^^^^^^^^^^^^ i ... but this value is not in upper case > 1 │ switch (s.toUpperCase()) { case 'ABC': case 'abc': case 'aBc': default: } │ ^^^^^ i Unsafe fix: Use upper case string value. - switch·(s.toUpperCase())·{·case·'ABC':·case·'abc':·case·'aBc':·default:·} + switch·(s.toUpperCase())·{·case·'ABC':·case·'abc':·case·"ABC":·default:·} ``` # Input ```cjs for (; s['toLowerCase']() === 'ABC'; ) {} ``` # Diagnostics ``` invalid.jsonc:1:8 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This expression always returns false. > 1 │ for (; s['toLowerCase']() === 'ABC'; ) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ i This call convert the string to lower case > 1 │ for (; s['toLowerCase']() === 'ABC'; ) {} │ ^^^^^^^^^^^^^^^^^^ i ... but this value is not in lower case > 1 │ for (; s['toLowerCase']() === 'ABC'; ) {} │ ^^^^^ i Unsafe fix: Use lower case string value. - for·(;·s['toLowerCase']()·===·'ABC';·)·{} + for·(;·s['toLowerCase']()·===·"abc";·)·{} ``` # Input ```cjs for (; s[`toUpperCase`]() === 'abc'; ) {} ``` # Diagnostics ``` invalid.jsonc:1:8 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This expression always returns false. > 1 │ for (; s[`toUpperCase`]() === 'abc'; ) {} │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ i This call convert the string to upper case > 1 │ for (; s[`toUpperCase`]() === 'abc'; ) {} │ ^^^^^^^^^^^^^^^^^^ i ... but this value is not in upper case > 1 │ for (; s[`toUpperCase`]() === 'abc'; ) {} │ ^^^^^ i Unsafe fix: Use upper case string value. - for·(;·s[`toUpperCase`]()·===·'abc';·)·{} + for·(;·s[`toUpperCase`]()·===·"ABC";·)·{} ``` # Input ```cjs switch (s['toLowerCase']()) { case 'Abc': case 'aBc': case 'abC': default: } ``` # Diagnostics ``` invalid.jsonc:1:36 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This case will never match. > 1 │ switch (s['toLowerCase']()) { case 'Abc': case 'aBc': case 'abC': default: } │ ^^^^^ i This call convert the string to lower case > 1 │ switch (s['toLowerCase']()) { case 'Abc': case 'aBc': case 'abC': default: } │ ^^^^^^^^^^^^^^^^^^ i ... but this value is not in lower case > 1 │ switch (s['toLowerCase']()) { case 'Abc': case 'aBc': case 'abC': default: } │ ^^^^^ i Unsafe fix: Use lower case string value. - switch·(s['toLowerCase']())·{·case·'Abc':·case·'aBc':·case·'abC':·default:·} + switch·(s['toLowerCase']())·{·case·"abc":·case·'aBc':·case·'abC':·default:·} ``` ``` invalid.jsonc:1:48 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This case will never match. > 1 │ switch (s['toLowerCase']()) { case 'Abc': case 'aBc': case 'abC': default: } │ ^^^^^ i This call convert the string to lower case > 1 │ switch (s['toLowerCase']()) { case 'Abc': case 'aBc': case 'abC': default: } │ ^^^^^^^^^^^^^^^^^^ i ... but this value is not in lower case > 1 │ switch (s['toLowerCase']()) { case 'Abc': case 'aBc': case 'abC': default: } │ ^^^^^ i Unsafe fix: Use lower case string value. - switch·(s['toLowerCase']())·{·case·'Abc':·case·'aBc':·case·'abC':·default:·} + switch·(s['toLowerCase']())·{·case·'Abc':·case·"abc":·case·'abC':·default:·} ``` ``` invalid.jsonc:1:60 lint/correctness/noStringCaseMismatch FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ! This case will never match. > 1 │ switch (s['toLowerCase']()) { case 'Abc': case 'aBc': case 'abC': default: } │ ^^^^^ i This call convert the string to lower case > 1 │ switch (s['toLowerCase']()) { case 'Abc': case 'aBc': case 'abC': default: } │ ^^^^^^^^^^^^^^^^^^ i ... but this value is not in lower case > 1 │ switch (s['toLowerCase']()) { case 'Abc': case 'aBc': case 'abC': default: } │ ^^^^^ i Unsafe fix: Use lower case string value. - switch·(s['toLowerCase']())·{·case·'Abc':·case·'aBc':·case·'abC':·default:·} + switch·(s['toLowerCase']())·{·case·'Abc':·case·'aBc':·case·"abc":·default:·} ```