quick-lint-js
quick-lint-js copied to clipboard
10$: warn on 'x == []'
x == []
is always false. Warn when comparing against an array literal, object literal, class literal, [arrow] function, or regexp literal.
I think this is wrong. It's not always false.
const x = "";
console.log(x == []); // prints true
const x = 0;
console.log(x == []); // prints true
class Custom {
static valueOf() {
return 1;
}
}
const x = 1;
console.log(x == Custom); // prints true
I think this is wrong. It's not always false.
You are correct. We should only warn for ===
or !==
.
May I get this issue assigned to me, please? (I do not want the payment).