Skip to content

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Dec 27, 2025

Add a leading ; for the JSXFragment to solve a syntax error caused by the semicolon being disabled.

Copilot AI review requested due to automatic review settings December 27, 2025 08:35
@github-actions github-actions bot added A-formatter Area - Formatter C-bug Category - Bug labels Dec 27, 2025
Copy link
Member Author

Dunqing commented Dec 27, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

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 a bug where JSX fragments were missing a leading semicolon when the formatter's semicolon option is set to "AsNeeded". The fix ensures JSX fragments are handled consistently with JSX elements when determining if an expression statement needs a leading semicolon to prevent ASI (Automatic Semicolon Insertion) issues.

  • Added Expression::JSXFragment(_) to the pattern match in expression_statement_needs_semicolon function
  • Fixed 6 TypeScript test cases that were previously failing to parse
  • Improved test coverage from 99.40% to 99.46%

Reviewed changes

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

File Description
crates/oxc_formatter/src/write/mod.rs Added JSXFragment to the list of expressions that need a leading semicolon when semicolons are disabled, placing it alongside JSXElement for consistency
tasks/coverage/snapshots/formatter_typescript.snap Updated snapshot showing 6 previously failing JSX/TSX fragment-related tests now pass, improving overall test coverage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 27, 2025

CodSpeed Performance Report

Merging #17386 will not alter performance

Comparing 12-27-fix_formatter_jsxfragment_is_missing_a_leading_semicolon_when_semicolon_is_disabled (f7d6de0) with main (e073925)

Summary

✅ 38 untouched
⏩ 7 skipped1

Footnotes

  1. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

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

Labels

A-formatter Area - Formatter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants