Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design Meeting Notes, 3/1/2024 #57599

Closed
DanielRosenwasser opened this issue Mar 1, 2024 · 1 comment
Closed

Design Meeting Notes, 3/1/2024 #57599

DanielRosenwasser opened this issue Mar 1, 2024 · 1 comment
Labels
Design Notes Notes from our design meetings

Comments

@DanielRosenwasser
Copy link
Member

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 Candidates #54500)

Type Predicate Function Inference

#57465

  • We like the PR, we just want to hunt down that 1% performance regression.
@DanielRosenwasser DanielRosenwasser added the Design Notes Notes from our design meetings label Mar 1, 2024
@uhyo
Copy link
Contributor

uhyo commented Mar 2, 2024

Who uses it [no-default-lib]?

Just wanted to note that no-default lib works as a marker of default library files now;

I'm maintaining better-typescript-lib (a modified version of TypeScript's default library) and it had to include no-default-lib in every file in order to be recognized as a default library file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Notes Notes from our design meetings
Projects
None yet
Development

No branches or pull requests

3 participants