quick-lint-js

Find bugs in JavaScript programs.

E0286: lower case letters compared with toUpperCase

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

let x = "BaNaNa";

// always returns 'false'
if (x.toUpperCase() === "banana") {
} 

// always returns 'true'
if (x.toUpperCase() !== "banana") {
} 

Introduced in quick-lint-js version 2.9.0.

Documentation for other errors