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): Allow JSX expressions to nestle on arrow chains #1033

Merged
merged 2 commits into from
Dec 4, 2023

Conversation

faultyserver
Copy link
Contributor

Summary

Fixes #1024.

JSX Expressions are similar to objects, arrows, and function expressions for arrow chain bodies, where they can render their initial tag on the same line as the end of the arrow chain signatures. This was already supported for single arrow expressions, but the logic didn't carry over into the Chain layout.

This also addresses a big diff in a Prettier test about arrow chains within jsx expressions, and adds the same logic for inserting a soft line break at the end of the expression, again matching the Single layout that already existed.

Test Plan

Prettier diff snapshot is deleted because they now match. Also added a spec test to ensure it continues working as expected.

Copy link

netlify bot commented Dec 4, 2023

Deploy Preview for rad-torte-839a59 canceled.

Name Link
🔨 Latest commit 380eb0f
🔍 Latest deploy log https://app.netlify.com/sites/rad-torte-839a59/deploys/656d187c2a7b360008e119f4

@github-actions github-actions bot added A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages labels Dec 4, 2023
@Conaclos Conaclos merged commit 290c67b into main Dec 4, 2023
18 checks passed
@Conaclos Conaclos deleted the faulty/curried-jsx branch December 4, 2023 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Formatter Area: formatter L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📝 Wrapped JSX Expressions in Arrow Chains should be parenthesized
2 participants