Skip to content

Fix nested destructured require bindings in declaration emit - #65630

Open
Mohd Shami (mohdshamii) wants to merge 1 commit into
microsoft:mainfrom
mohdshamii:fix-65628
Open

Mohd Shami (mohdshamii) wants to merge 1 commit into
microsoft:mainfrom
mohdshamii:fix-65628

Conversation

@mohdshamii

Copy link
Copy Markdown

Fixes #65628

Analysis

In CommonJS declaration emit, canTransformCjsRequireToImport previously only checked if elements in a destructuring pattern had dynamic computed property names:

// lib.js
const { b: { c } } = require("./m");
module.exports.c = c;

Copilot AI balanced review requested due to automatic review settings November 22, 2026 08:47
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 22, 2026
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 22, 2026

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@mohdshamii

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@jakebailey

Copy link
Copy Markdown
Member

If you're willing, this would be much easier to review if it were two commits, one that adds the test and baselines showing bad behavior, then one commit with the fix and baseline update showing it works.

@typescript-automation typescript-automation Bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 25, 2026

This branch has not been deployed

No deployments
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.

Declaration emit drops nested destructured require bindings in JS (const { b: { c } } = require("./m"))

3 participants