-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix parentheses around sequence expression as body of arrow chain #11593
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
Conversation
Sidebar: is there a reason #9992 is using const f = () => ({ k }) => k; it will get split across multiple lines, as in const f =
() =>
({ k }) =>
k; That seems obviously wrong to me; I'd be happy to submit a PR fixing it. |
@bakkot Have you seen #10955? I think we already have code for this prettier/src/language-js/print/function.js Line 343 in 20df210
|
@fisker I wrote that comment. And yes, the problem is that #9992 introduced a |
Sorry, I didn't see the description. I don't like coping the existing code, but seems hard to reuse? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! But please update changelog.
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
Description
Fixes #10955.
#9992 introduced a special case for printing the bodies of chained arrows, which has very different logic from printing a regular arrow. It neglected to copy over the logic to handle this case.
Checklist
changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.✨Try the playground for this PR✨