Skip to content

Design Meeting Notes, 3/1/2024 #57599

@DanielRosenwasser

Description

@DanielRosenwasser

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design NotesNotes from our design meetings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions