Description Erroring on Types and Namespaces Named undefined
#57573
#57575
You can currently create variables, types, and namespaces named undefined.
Technically this is implemented to-spec - you can rename a variable undefined.
We could be more extreme about this.
We're okay with forbidding in type names (e.g. type parameters, type aliases, interfaces...), but not in namespaces and variables.
Understanding no-default-lib
#57524
What does no-default-lib mean?
Originally, we wanted people to be able to specify an alternative lib.
We created no-default-lib to say "I have my own lib, don't provide one."
This precedes noLib and the lib array.
Who uses it?
Deno uses it - kinda makes sense?
Let's ask Deno folks about why they need it.
Some people on GitHub are using it in questionable ways.
What is it supposed to do when someone has a lib array set?
This is spooky action at a distance. The fact that this can appear in a .d.ts file and override your compiler settings is extremely sketchy.
We want to deprecate this.
Wait we remember now - skipDefaultLibCheck also uses these directives to skip full type-checking of these files.
But we also have skipLibCheck
But you don't always want that because hand-authored .d.ts files should be checked.
We would like to come up with an alternative, we want to deprecate this (6.0 Deprecation List #54500 )
Type Predicate Function Inference
#57465
We like the PR, we just want to hunt down that 1% performance regression.
Reactions are currently unavailable
You can’t perform that action at this time.
Erroring on Types and Namespaces Named
undefined#57573
#57575
undefined.undefined.Understanding
no-default-lib#57524
no-default-libmean?lib.no-default-libto say "I have my own lib, don't provide one."noLiband thelibarray.libarray set?.d.tsfile and override your compiler settings is extremely sketchy.skipDefaultLibCheckalso uses these directives to skip full type-checking of these files.skipLibCheck.d.tsfiles should be checked.Type Predicate Function Inference
#57465