Repository navigation
Change default --target to latest ECMAScript version #62198
Description
Activity
- addedBreaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeSuggestionAn idea for TypeScriptAn idea for TypeScriptCommittedThe team has roadmapped this issueThe team has roadmapped this issue
on Aug 4, 2025 DanielRosenwasser commented
on Sep 3, 2025 MemberAuthorMore actionsIf tests break, it likely indicates that the original test file needs to have an updated
// @target: ....Coming over from #54500 (comment), is
esnextores2015being proposed for the default target? This issue seems to indicateesnextbut that issue seems to indicatees2015.DanielRosenwasser commented
on Oct 13, 2025 MemberAuthorMore actionsKirk Waiblinger (@kirkwaiblinger) the idea with that issue is that the lowest target will eventually be
es2015, meaninges5won't be supported. The original idea here isesnextwould be the default.Reacted by Kirk WaiblingerDanielRosenwasser commented
on Oct 13, 2025 MemberAuthorMore actionsWe recently had a design meeting where we decided on something a little bit less ambitious - instead of defaulting to
esnextwhich contains stage 3 features that not every runtime will expect, we will default to the latest stable ECMAScript target. That means TypeScript 6.0 and 7.0 will default toes2025ores2026.We punted on giving a specific name for this target. Instead of
escurrentor something similar, we will just update the default periodically toes2025,es2026,es2027, etc.Reacted by Jake Bailey, Kirk Waiblinger, Ryan Cavanaugh and Yann Brelière- changed the title
[-]Change default `--target` to `esnext`[/-][+]Change default `--target` to latest ECMAScript version[/+]on Oct 13, 2025 kirkwaiblinger commented
on Oct 14, 2025 More actionsGotcha, that's helpful clarification! Would updating this default value be subject to the 2.5 year breaking change cadence? (I know TS 7 will ignore that cadence but interested to know what to expect going forward)
RyanCavanaugh commented
on Oct 14, 2025 MemberMore actionsNo, the default would be "whatever was currently current at the time of the beta" the same way
esnextis a moving targetReacted by Kirk Waiblinger and roottool- assigned and unassigned
on Jan 21, 2026 - addedFix AvailableA PR has been opened for this issueA PR has been opened for this issue
on Jan 30, 2026
The nature of TypeScript has changed in the last decade, where "evergreen runtimes" are now the norm. While it's true that there is often a rollout gap for features before they can safely be adopted, the current default target of
es5is an extreme way of serving those developers. What's more,--target es5will no longer be supported in 7.0, and will be deprecated in 6.0 (see #62196).While we do believe that most people do end up specifying a
--targetother than the default, that default is likely closer to the latest stable ECMAScript version thanes5(or evenes2015) these days. And we want to encourage that.Specifying the latest stable ECMAScript version as a target by default:
There are some "dangers" here. Any code that does not specify a
targetwill have different JavaScript output which may occasionally differ in semantics (due to semantic differences from downleveled code, things likeuseDefineForClassFields, or even divergences in how engines support newer features).Certain code like decorators (not currently supported in any major engine) will not work either(this last point only applied to the original proposal of targetingesnext; but now we are changing the default to the latest ECMAScript version).Knowing how to reconfigure TypeScript for this change may be a challenge. Users will often be able to look for
tsconfig.json,tsconfig.*.json,jsconfig.json, files to explicitly specify atarget, but they can't just look for the string"target"anywhere because the entire problem is that it was never specified! Because TypeScript configuration can be contained in JS objects and then fed through our API, and any generated errors can be ignored, this may make upgrades particularly difficult. Users should look for calls to APIs such ascreateProgram,getEmitOutput,transpile,transpileModule, andtranspileDeclaration.See more discussion around 6.0 deprecations/changes at #54500.