Skip to content

Conversation

@Andarist
Copy link
Contributor

Copilot AI review requested due to automatic review settings July 22, 2025 08:31
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Jul 22, 2025
@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug labels Jul 22, 2025
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 PR fixes the issue where TypeScript was emitting redundant and invalid extra renamed keyword exports in JavaScript declaration files. The change addresses a bug where exports using JavaScript keywords as export names (like export { _null as null }) were generating unnecessary additional export declarations.

  • Removes logic that created redundant export declarations for keyword exports
  • Simplifies the private symbol handling logic by using logical OR assignment
  • Cleans up unnecessary variable tracking for export declarations

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
jsDeclarationsKeywordExport1.ts Test case demonstrating exports with keyword names (null, void)
jsDeclarationsKeywordExport1.types Expected type output for the test case
jsDeclarationsKeywordExport1.symbols Expected symbol resolution for the test case
jsDeclarationsKeywordExport1.js Expected compiled output including declaration file
checker.ts Core fix removing redundant export declaration generation logic
Comments suppressed due to low confidence (1)

context.approximateLength += 16 + internalSymbolName.length; // `export default internalName;`
addResult(factory.createExportAssignment(/*modifiers*/ undefined, /*isExportEquals*/ false, factory.createIdentifier(internalSymbolName)), ModifierFlags.None);
}
else if (needsExportDeclaration) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was originally added by @weswigham in #38982

I tried to think of a potential missing test case, but I couldn't find one. Perhaps this just became handled by other code paths since this was introduced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Backlog Bug PRs that fix a backlog bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

export { _void as void } leads to exporting duplicate identifiers

2 participants