Skip to content

Design Meeting Notes, 3/1/2024 #57599

Closed
Closed

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.

Activity

  1. uhyo commented on Mar 2, 2024

    @uhyo
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design Notes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions