Avoid extra offset in arrow function body when using long types (alternative solution)#11515
Avoid extra offset in arrow function body when using long types (alternative solution)#11515sosukesuzuki merged 9 commits intoprettier:mainfrom
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 😍 |
sosukesuzuki
left a comment
There was a problem hiding this comment.
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 🙂 |
|
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.mdfile followingchangelog_unreleased/TEMPLATE.md.✨Try the playground for this PR✨