Skip to content

Allow trailing commas after import attributes in ImportType #61920

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

Andarist
Copy link
Contributor

fixes #61916

@Copilot Copilot AI review requested due to automatic review settings June 23, 2025 18:35
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Jun 23, 2025
@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jun 23, 2025
Copy link

@Copilot 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 enables a trailing comma after the import attributes object in import(...) types and adds tests to verify valid and invalid comma placements.

  • Allow an optional comma before closing the import-attributes argument.
  • Add new test cases covering no comma, one trailing comma, and double-comma errors.

Reviewed Changes

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

File Description
tests/cases/conformance/importAttributes10.ts New tests for import attributes with single and double commas
src/compiler/parser.ts Insert parseOptional(SyntaxKind.CommaToken) before }

@RyanCavanaugh
Copy link
Member

@Andarist I'm going to assign the issue to copilot just for analysis purposes. No shade on this fix, which appears correct (but let's not tell the computer that)

@github-project-automation github-project-automation bot moved this from Not started to Needs merge in PR Backlog Jun 24, 2025
@RyanCavanaugh RyanCavanaugh merged commit 50b93bc into microsoft:main Jun 24, 2025
32 checks passed
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Trailing comma in import type attribute should be allowed
3 participants