Skip to content

fix(formatter): fix 4 prettier conformance tests#18057

Merged
graphite-app[bot] merged 1 commit intomainfrom
prettier-conformance
Jan 16, 2026
Merged

fix(formatter): fix 4 prettier conformance tests#18057
graphite-app[bot] merged 1 commit intomainfrom
prettier-conformance

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Jan 16, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 16, 2026 06:26
@Boshen Boshen requested a review from Dunqing as a code owner January 16, 2026 06:26
@github-actions github-actions bot added A-formatter Area - Formatter C-bug Category - Bug labels Jan 16, 2026
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 prettier conformance issues in the JavaScript formatter, improving compatibility from 96.85% to 97.50% (5 additional tests passing).

Changes:

  • Improved comment handling for empty statements in loop bodies
  • Fixed sequence expression formatting in return/throw statements with leading comments
  • Enhanced let identifier parenthesization logic for statement context
  • Optimized ASI protection to avoid unnecessary semicolons for keyword expressions

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
tasks/prettier_conformance/snapshots/prettier.js.snap.md Updates test results showing 5 more passing tests and improved match ratios for several others
crates/oxc_formatter/src/utils/statement_body.rs Adds space before empty statements with leading comments
crates/oxc_formatter/src/print/return_or_throw_statement.rs Adds inner parentheses for sequence expressions with leading comments
crates/oxc_formatter/src/print/mod.rs Optimizes ASI protection for keyword expressions and removes redundant comment handling
crates/oxc_formatter/src/parentheses/expression.rs Rewrites let identifier parenthesization logic with comprehensive tree traversal

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

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 16, 2026

Merging this PR will not alter performance

✅ 38 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing prettier-conformance (132253a) with main (f69b6da)

Open in CodSpeed

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.

@Dunqing
Copy link
Member

Dunqing commented Jan 16, 2026

Needs to run cargo coverage formatter

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jan 16, 2026
Copy link
Member Author

Boshen commented Jan 16, 2026

Merge activity

@graphite-app graphite-app bot force-pushed the prettier-conformance branch from 132253a to 125962d Compare January 16, 2026 06:51
@graphite-app graphite-app bot merged commit 125962d into main Jan 16, 2026
21 checks passed
@graphite-app graphite-app bot deleted the prettier-conformance branch January 16, 2026 06:57
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Jan 16, 2026
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.

3 participants