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

Allow single empty line between JSX expressions #7246

Merged
merged 7 commits into from
Jan 30, 2025

Conversation

shulhi
Copy link
Member

@shulhi shulhi commented Jan 14, 2025

Fix #7204

@fhammerschmidt
Copy link
Member

Ohhhhhhhhh, nice one!

@cknitt
Copy link
Member

cknitt commented Jan 26, 2025

@shulhi Very nice, thanks a lot!

I would like to release alpha.8 soon and include this if possible.

Could you fix the tests and add a CHANGELOG entry?

@shulhi
Copy link
Member Author

shulhi commented Jan 28, 2025

@shulhi Very nice, thanks a lot!
Could you fix the tests and add a CHANGELOG entry?

There's a bit of an edge case that I'm currently investigating.

@shulhi shulhi force-pushed the feat/keep-line-in-jsx branch from 1ec6560 to 90cf7d8 Compare January 29, 2025 05:28
Copy link
Member

@cknitt cknitt left a comment

Choose a reason for hiding this comment

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

Looks great to me!

@shulhi shulhi merged commit 3750ca3 into rescript-lang:master Jan 30, 2025
21 checks passed
@cknitt
Copy link
Member

cknitt commented Jan 30, 2025

@shulhi I just noticed the following "side effect" that was not clear to me before: This does not only allow empty lines between JSX expressions, but there is a case where it adds an empty line: When the JSX expression has a proceeding comment.

For example,

(
  <>
    <A />
    // Comment
    <B />
  </>
)

gets reformatted to

(
  <>
    <A />

    // Comment
    <B />
  </>
)

Maybe this is a good thing though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Formatter: Allow empty line between JSX expressions
3 participants