Skip to content

Conversation

@jakebailey
Copy link
Member

@jakebailey jakebailey commented Jan 31, 2026

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.

Copy link
Contributor

Copilot AI left a comment

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
File Description
tests/cases/compiler/enumMemberNameNonIdentifier.ts New test file demonstrating enum member name handling for non-standard identifiers
tests/baselines/reference/enumMemberNameNonIdentifier.types Baseline showing type representation for enum members with special character names
tests/baselines/reference/enumMemberNameNonIdentifier.symbols Baseline showing symbol information for enum members with special character names
tests/baselines/reference/enumMemberNameNonIdentifier.js Baseline showing JavaScript and declaration file output for enum test
src/compiler/transformers/ts.ts Changed class IIFE promotion check from <= ES5 to < ES2015
src/compiler/emitter.ts Removed ES5 version check for trailing comma support in object literals
src/compiler/checker.ts Changed enum member identifier validation from ES5 to ESNext; removed ES5 check in class name collision detection

@github-project-automation github-project-automation bot moved this from Not started to Needs merge in PR Backlog Feb 3, 2026
@jakebailey jakebailey added this pull request to the merge queue Feb 3, 2026
Merged via the queue into microsoft:main with commit 0a74ec4 Feb 3, 2026
33 checks passed
@jakebailey jakebailey deleted the es5-cleanup branch February 3, 2026 00:18
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants