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 incorrectly wrapped arrow functions with return types #10940

Merged
merged 3 commits into from May 25, 2021

Conversation

thorn0
Copy link
Member

@thorn0 thorn0 commented May 24, 2021

Description

fixes #10923

Checklist

  • I’ve added tests to confirm my change works.
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

Comment on lines +184 to +186
if (willBreak(returnTypeDoc)) {
throw new ArgExpansionBailout();
}
Copy link
Member

Choose a reason for hiding this comment

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

Can you add tests that matches this condition?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

Comment on lines +148 to +150
(
thing: string
): complex<
Copy link
Member

Choose a reason for hiding this comment

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

It may be a trivial matter, but this line breaks is expected?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not, but it's a separate issue

Copy link
Member

Choose a reason for hiding this comment

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

ok

Copy link
Member

@sosukesuzuki sosukesuzuki left a comment

Choose a reason for hiding this comment

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

I've tried the same issue, but I have no good solution. Thank you!

@thorn0
Copy link
Member Author

thorn0 commented May 24, 2021

I still remembered how these things work after working on #10712. BTW, first I thought this is a regression in 2.3, but it turned out it's an old bug.

@thorn0 thorn0 merged commit 3616182 into prettier:main May 25, 2021
@thorn0 thorn0 deleted the expand-arg-with-return-type branch May 25, 2021 07:39
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants