Skip to content

Remove ES5 references, misc cleanup - #63075

Merged
Jake Bailey (jakebailey) merged 3 commits into
microsoft:mainfrom
jakebailey:es5-cleanup
Feb 3, 2026
Merged

Remove ES5 references, misc cleanup#63075
Jake Bailey (jakebailey) merged 3 commits into
microsoft:mainfrom
jakebailey:es5-cleanup

Conversation

@jakebailey

@jakebaileyJake Bailey (jakebailey) commented Jan 31, 2026

Copy link
Copy Markdown
Member

Some cleanup after #63067.

This removes all remaining non-test references to ScriptTarget.ES5. Most are just dead code or can be rephrased.

The one behavior difference is in the third commit. For enums, we were being conservative and printing identifiers that are only valid in ES2015+ as string literals. However, this does not practically matter because declaration emit just reuses the nodes, so everyone has been emitting these characters anyway. That and, we always parse declaration files with the latest options such that they're always cached (fairly certain; definitely true in Corsa), so it doesn't matter there. All that changes is the types baseline, which also implies that hover would change, which it does.

Strada before:

image

Corsa today (what this PR would do):

image

And of course, Corsa does not even have the code to do it the old way, lacking ES5 stuff or the plumbing to even pass that down.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request removes remaining non-test references to ScriptTarget.ES5 after the deprecation of ES5 as a compilation target. The PR includes cleanup changes across the codebase and adds a new test to document the behavior change for enum member name validation.

Changes:

  • Changed identifier text validation from ES5 to ESNext standard in checker.ts, affecting how enum member names are validated for type representation
  • Simplified conditions in transformers and emitter that previously checked for ES5, now using ES2015 or removing the check entirely
  • Added comprehensive test case demonstrating enum member name behavior with special characters

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 14 comments.

Show a summary per file
FileDescription
tests/cases/compiler/enumMemberNameNonIdentifier.tsNew test file demonstrating enum member name handling for non-standard identifiers
tests/baselines/reference/enumMemberNameNonIdentifier.typesBaseline showing type representation for enum members with special character names
tests/baselines/reference/enumMemberNameNonIdentifier.symbolsBaseline showing symbol information for enum members with special character names
tests/baselines/reference/enumMemberNameNonIdentifier.jsBaseline showing JavaScript and declaration file output for enum test
src/compiler/transformers/ts.tsChanged class IIFE promotion check from <= ES5 to < ES2015
src/compiler/emitter.tsRemoved ES5 version check for trailing comma support in object literals
src/compiler/checker.tsChanged enum member identifier validation from ES5 to ESNext; removed ES5 check in class name collision detection

Comment threadtests/cases/compiler/enumMemberNameNonIdentifier.ts Outdated
Comment threadtests/baselines/reference/enumMemberNameNonIdentifier.types Outdated
Comment threadtests/baselines/reference/enumMemberNameNonIdentifier.symbols Outdated
Comment threadtests/baselines/reference/enumMemberNameNonIdentifier.js Outdated
Comment threadtests/baselines/reference/enumMemberNameNonIdentifier.js Outdated
Comment threadtests/cases/compiler/enumMemberNameNonIdentifier.ts Outdated
Comment threadtests/baselines/reference/enumMemberNameNonIdentifier.types Outdated
Comment threadtests/baselines/reference/enumMemberNameNonIdentifier.types Outdated
Comment threadtests/baselines/reference/enumMemberNameNonIdentifier.symbols Outdated
Comment threadtests/baselines/reference/enumMemberNameNonIdentifier.symbols Outdated
@github-project-automationgithub-project-automationBot moved this from Not started to Needs merge in PR BacklogFeb 3, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queueFeb 3, 2026
Merged via the queue into microsoft:main with commit 0a74ec4Feb 3, 2026
33 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the es5-cleanup branch February 3, 2026 00:18
@github-project-automationgithub-project-automationBot moved this from Needs merge to Done in PR BacklogFeb 3, 2026
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Aug 3, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamFor Uncommitted BugPR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants

@jakebailey@RyanCavanaugh@andrewbranch@typescript-bot