Skip to content
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

fix(formatter): refine the logic for identifying comments on the last attribute in JSX #4835

Merged
merged 3 commits into from
Jan 6, 2025

Conversation

bushuai
Copy link
Contributor

@bushuai bushuai commented Jan 5, 2025

Summary

closes #4719

the bracketSameLine rule now works the same as prettier when a comment is placed before the last JSX attribute with configuration:

 "javascript": {
   "formatter": {
     "bracketSameLine": true
   }
 }
<Component
  foo={fooValue}
  // comment
- bar={barValue}
->
+ bar={barValue}>
  some content
</Component>

Test Plan

added a test case and updated the snapshots.

@github-actions github-actions bot added A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages A-Changelog Area: changelog labels Jan 5, 2025
Copy link

codspeed-hq bot commented Jan 5, 2025

CodSpeed Performance Report

Merging #4835 will improve performances by 7.14%

Comparing bushuai:fix/bracket-same-line (2f4e18e) with main (a658a29)

Summary

⚡ 1 improvements
✅ 96 untouched benchmarks

Benchmarks breakdown

Benchmark main bushuai:fix/bracket-same-line Change
pure_9395922602181450299.css[cached] 3.6 ms 3.4 ms +7.14%

@arendjr arendjr merged commit eedb22e into biomejs:main Jan 6, 2025
12 checks passed
@arendjr
Copy link
Contributor

arendjr commented Jan 6, 2025

Thanks!

@bushuai bushuai deleted the fix/bracket-same-line branch January 7, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bracketSameLine not respected if comment before last parameter
2 participants