-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Avoid extra offset in arrow function body when using long types (alternative solution) #11515
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
Regression testing showed that this was a bad idea in this case
👋 @thorn0! The diff in integration tests makes absolute sense to me, so I’m more than happy to proceed with your solution 😍 |
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.
Overall looks good! But diffs are large, so I think we should release this as minor.
@sosukesuzuki this PR fixes a regression in Prettier 2.3.0 – the new behaviour closely matches 2.2.1. Given this and the fact that 2.4.0 is quite new, would it be reasonable to include the PR into 2.4.1? If this was a completely new behaviour, I'd agree with you, but a former change between 2.2 and 2.3 tweaks the weights a bit I guess 🙂 |
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.
I like it
Hmmm... I still think this should be released in 2.5, as it is not a fix for the regressions that occurred in 2.4, and it would create a large diff. Many users will not like a big diff in a patched version. (But I'm not confident that this is the best way). |
Description
This is an alternative to #10956. It uses the following formatting:
@kachkaev How does this look to you?
Regression testing (prettier/prettier-regression-testing#73 (comment)) has shown that "prefer to keep the arrow signature on one line if possible" is a bad idea in this case.
Testing results for the current version of this PR: prettier/prettier-regression-testing#73 (comment)
Closes #10848
Checklist
changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.✨Try the playground for this PR✨