If isInteger was marked as a type guard, then you could write code like this:
function f(s: string | number) {
if (!Number.isInteger(s)) {
console.log(s.substring(0, 0));
}
}
which is clearly wrong.There's an open feature request for a new kind of "one-sided" type guards that don't cause narrowing when they return false.