quick-lint-js

Find bugs in JavaScript programs.

E0287: upper case letters compared with toLowerCase

Comparing the result of a function named toLowerCase to a string literal with one or more upper case letters will always yield the same result.

let x = "BaNaNa";

// always returns 'false'
if (x.toLowerCase() === "BANANA") {
} 

// always returns 'true'
if (x.toLowerCase() !== "BANANA") {
} 

Introduced in quick-lint-js version 2.9.0.

Documentation for other errors