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(js_formatter): correctly handle line terminators in JSX string #3025

Merged
merged 2 commits into from
May 30, 2024

Conversation

ah-yu
Copy link
Contributor

@ah-yu ah-yu commented May 30, 2024

Summary

Closes #2877

We manage line terminators in two steps:

  1. Normalize line terminators during the IR generation phase by replacing \r\n with \n.
  2. Replace \n with different line terminators based on the line_ending option.

It appears that the normalizing step is skipped for JSX strings.

Test Plan

Add new test cases

@github-actions github-actions bot added A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages A-Changelog Area: changelog labels May 30, 2024
Copy link

codspeed-hq bot commented May 30, 2024

CodSpeed Performance Report

Merging #3025 will not alter performance

Comparing ah-yu:fix/crlf (5b0951b) with main (4ed208a)

Summary

✅ 92 untouched benchmarks

Copy link
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

@ah-yu ah-yu merged commit 13811df into biomejs:main May 30, 2024
13 checks passed
@ah-yu ah-yu deleted the fix/crlf branch May 30, 2024 11:23
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.

📝 New lines are added after formatting
2 participants