Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Change default target from ES5 to ESNext#62388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge3 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/fix-62198

Conversation

Copilot
Copy link
Contributor

@CopilotCopilotAI commentedSep 3, 2025
edited
Loading

This PR changes the default TypeScript compilation target fromes5 toesnext to better align with modern JavaScript environments and "evergreen runtimes" that are now the norm.

Changes Made

  • Updated the default target fallback insrc/compiler/utilities.ts fromScriptTarget.ES5 toScriptTarget.ESNext
  • Updated the help documentation default insrc/compiler/commandLineParser.ts fromScriptTarget.ES5 toScriptTarget.ESNext
  • Accepted updated test baselines reflecting the new ESNext output instead of ES5 downleveling

Impact

When no explicit--target is specified, TypeScript will now:

  • Preserve modern JavaScript syntax (classes, arrow functions, spread operators, etc.)
  • Generate cleaner, more readable output
  • Target modern JavaScript environments by default

Before (ES5 default):

// Inputconstx=[1,2,3];console.log(...x);// Output (downleveled)varx=[1,2,3];console.log.apply(console,x);

After (ESNext default):

// Inputconstx=[1,2,3];console.log(...x);// Output (preserved)constx=[1,2,3];console.log(...x);

Migration

This is abreaking change. Users who need ES5 output for compatibility with older environments should explicitly specify--target es5 in theirtsconfig.json:

{"compilerOptions": {"target":"es5"  }}

Tests with explicit// @target: es5 directives continue to work correctly and are unaffected.

Rationale

  • ES5 will be deprecated in TypeScript 6.0 and removed in 7.0 (Deprecate--target es5, make lowest targetes2015 #62196)
  • Modern JavaScript environments support ESNext features natively
  • Reduces unnecessary code transformation and improves output quality
  • Aligns with TypeScript's core value proposition as "JavaScript with type syntax"

Fixes#62198.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Clickhere to start the survey.

CopilotAIand others added2 commitsSeptember 3, 2025 23:22
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
@CopilotCopilotAI changed the title[WIP] Change default--target toesnextChange default target from ES5 to ESNextSep 3, 2025
Copilot finished work on behalf ofDanielRosenwasserSeptember 3, 2025 23:50
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@DanielRosenwasserDanielRosenwasserAwaiting requested review from DanielRosenwasser

At least 1 approving review is required to merge this pull request.

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Change default--target toesnext
2 participants
@Copilot@DanielRosenwasser

[8]ページ先頭

©2009-2025 Movatter.jp