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
Don't always put {" "}
on a new line when formatting JSX children
#1582
Comments
I think this helps clarify why the |
☝🏻 I've put together a PR that places the |
Based on @SimenB's comment in #1831 (comment) I'm investigating whether it might make sense to place the It looks like it will be a little more work as there are some difficulties around having them trail multiline elements, so I don't have anything to show for it yet. |
I have a PR that places I'd be interested in people's thoughts! |
This is now done in #1964 🎉 |
The change in #1120 means Prettier will now fill a line with as many JSX children as possible before moving to a new line.
This behaviour means that our decision to always have
{" "}
appear on a line by itself can appear strange in a number of cases.For example:
Becomes:
Potentially it would be nicer formatted as:
I'm not sure how to accomplish this yet, so I've opened this issue as a place to discuss whether we'd like to make this change and how we might accomplish it.
The text was updated successfully, but these errors were encountered: