Increase default tsc --init target over time #49206
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
Suggestion
π Search Terms
increase tsc init target es2016 default
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
As of 2022, all releases within the last year of browsers serving >0.1% of worldwide users support at least all of ECMAScript 2019 and nearly all of ECMAScript 2020-2021, while the LTS-supported versions of Node.js support all of ECMAScript 2021. There's very little reason not to have a target at least as high as
"es2019"
.How about increasing the default
tsc --init
value fortarget
in later TypeScript versions over time to match the highest ECMAScript version supported by all LTS Node versions? That'd be"es2021"
today.π Motivating Example
Higher targets by default for consumers running
tsc --init
means they'll be able to use more language features asString.replaceAll
by default. It's confusing totsc --init
, then not be able to use them.π» Use Cases
Increasing default targets to emit code much cleaner in modern runtimes gives a nicer default output for new TypeScript projects. For beginners to TypeScript in particular, it makes the learning curve a little easier as they won't have to mess with configuration options to be able to use basic features.
This issue is thematically similar to but not the same as #47572 and #47573. Those issue are about changing the default compiler options when no value is specified on the CLI or in a TSConfig file. This issue is about changing the target specified when using
tsc --init
.The text was updated successfully, but these errors were encountered: