🔍 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
- Writing modern websites and always knowing which APIs are available for use.
- 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.
- 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.
🔍 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
libconfig, 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
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.