Skip to content

Fix crash in formatter on comment lookalikes in JSX closing tags - #64644

Open
Mateusz Burzyński (Andarist) wants to merge 2 commits into
microsoft:mainfrom
Andarist:fix-format-jsx-comment-in-end-tag
Open

Mateusz Burzyński (Andarist) wants to merge 2 commits into
microsoft:mainfrom
Andarist:fix-format-jsx-comment-in-end-tag

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

fixes the issue reported here: #64622 (comment)

Copilot AI balanced review requested due to automatic review settings October 5, 2026 15:54
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Oct 5, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 1 High severity · 1 Medium severity · 1 Low severity

Open (3)
What changed in this PR

Adds regression coverage and scanner logic changes to prevent formatter crashes when JSX closing tags contain comment-lookalike sequences (e.g., </* */>), matching the linked TypeScript issue.

Changes:

  • Add fourslash regression tests covering JSX closing-tag /* */ lookalikes and a couple of additional formatter edge cases.
  • Extend the formatting scanner with a new rescan action for JSX closing tags to avoid mis-tokenizing </ sequences.
File Description
tsc/​internal/​fourslash/​tests/​formatTypeArgumentStartingWithLessThan_test.go New regression test for formatting with << type-argument edge case.
tsc/​internal/​fourslash/​tests/​formatNestedJSDocNullableType_test.go New regression test for nested JSDoc nullable type formatting.
tsc/​internal/​fourslash/​tests/​formatJsxClosingTagFollowedByAsterisk_test.go New regression test for </* */> in JSX fragments.
tsc/​internal/​fourslash/​tests/​formatJsxClosingTagFollowedByAsteriskAfterText_test.go New regression test for </* */a> after text in JSX.
tsc/​internal/​fourslash/​tests/​formatJsxClosingTagFollowedByAsteriskAfterExpression_test.go New regression test for </* */a> after an expression in JSX.
tsc/​internal/​format/​scanner.go Add a targeted rescan path for JSX closing tags to avoid interpreting /* as a comment.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread tsc/internal/format/scanner.go
Comment thread tsc/internal/format/scanner.go

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 Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

2 participants