Skip to content

Conversation

Dunqing
Copy link
Member

@Dunqing Dunqing commented Oct 16, 2025

No description provided.

@github-actions github-actions bot added A-formatter Area - Formatter C-bug Category - Bug labels Oct 16, 2025
Copy link
Member Author

Dunqing commented Oct 16, 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

codspeed-hq bot commented Oct 16, 2025

CodSpeed Performance Report

Merging #14653 will not alter performance

Comparing 10-16-fix_formatter_skip_the_leading_semicolon_when_calculating_leading_lines (001b24e) with main (a9d50a7)1

Summary

✅ 33 untouched
⏩ 4 skipped2

Footnotes

  1. No successful run was found on main (26c5f5a) during the generation of this report, so a9d50a7 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 4 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.

Copy link
Contributor

@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 fixes a formatting issue where the formatter incorrectly calculated leading lines when a semicolon preceded a statement, specifically affecting cases like ;(function() {})() where the leading semicolon should be considered when determining line breaks.

  • Added logic to skip leading semicolons when calculating leading lines in the formatter
  • Added test fixtures to verify the fix handles semicolon-prefixed expressions correctly

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
crates/oxc_formatter/src/formatter/source_text.rs Added logic to detect and skip leading semicolons when calculating leading lines
crates/oxc_formatter/tests/fixtures/js/semicolons/empty-line.js Test input file with semicolon-prefixed IIFE to verify the fix
crates/oxc_formatter/tests/fixtures/js/semicolons/empty-line.js.snap Expected test output showing correct formatting with and without semicolons
crates/oxc_formatter/tests/fixtures/js/semicolons/options.json Test configuration for both semicolon true and false options

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

graphite-app bot commented Oct 16, 2025

Merge activity

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Oct 16, 2025
@graphite-app graphite-app bot force-pushed the 10-16-fix_formatter_skip_the_leading_semicolon_when_calculating_leading_lines branch from 001b24e to e0eb966 Compare October 16, 2025 21:50
@graphite-app graphite-app bot merged commit e0eb966 into main Oct 16, 2025
20 checks passed
@graphite-app graphite-app bot deleted the 10-16-fix_formatter_skip_the_leading_semicolon_when_calculating_leading_lines branch October 16, 2025 21:58
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 16, 2025
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.

1 participant