quick-lint-js

Find bugs in JavaScript programs.

E0710: '^' is the XOR operator; to exponentiate, use '**' instead

The Exclusive OR operator ^ can sometimes be mistaken for the exponentiation operator **.

let x = 2 ^ 8

If the intention was to exponentiate, the operator ^ should be replaced with **

let x = 2 ** 8

Alternatively, if the intention was to use the ^ operator for XOR operation, The resulting literal could be used directly (2 ^ 8 = 10)

let x = 10

Documentation for other errors