Skip to content

Support lib: "baseline-widely-available"Β #62536

@will-stone

Description

@will-stone

πŸ” Search Terms

"Baseline Widely Available"

βœ… Viability Checklist

⭐ Suggestion

When creating websites, it is now an industry standard to support Baseline Widely Available JS APIs. Rather than only being able to select an ECMAScript year in the lib config, how about adding "baseline-widely-available" where it updates with each TS release, only allowing JS API and syntax that is marked as Widely Available?

πŸ“ƒ Motivating Example

To ensure that you only use API and syntax supported by all major browsers, you will be able to set:

{
  "compilerOptions": {
    "lib": ["baseline-widely-available"]
  }
}

This means that you can be assured that all the JS you write has been supported for at least 30 months.

πŸ’» Use Cases

  1. Writing modern websites and always knowing which APIs are available for use.
  2. You could use ESLint rules to ban too modern JS API but that is an opt-out structure, where this would prevent mistakes at the lowest level, when writing the code.
  3. Currently using lib: "ES2022" as this covers the time gap but it's not self-updating and could still include items that some browsers are yet to support in the 30 month version history.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions