Why Typescript allows to pass null / undefined there?
// "strictNullChecks": false
function someFun(param: (foo: any) => any) {}
someFun(null); // no error - incorrect
someFun(undefined); // no error - incorrect
Quoting from the docs
In strict null checking mode, the null and undefined values are not in the domain of every type and are only assignable to themselves and any (the one exception being that undefined is also assignable to void)
..T and T | undefined are considered synonymous in regular type checking mode (because undefined is considered a subtype of any T),
--strictNullChecksdisabled. Are you asking "why does disabling--strictNullChecksdisable strict null checks"? That's answered below. Or are you asking "why is--strictNullChecksdisabled by default"? That's probably answered here: it would break existing real world code that used TypeScript before these--strictoptions existed.