-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Format assignments more consistently #10222
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
2805616
to
e94cc2a
Compare
b5957b8
to
719746a
Compare
e3da2b2
to
3b26905
Compare
6a5214d
to
97b9b70
Compare
f5b8014
to
adff4ac
Compare
var numberValue2_renamed2 = require("ES6_ExportFrom_Intermediary2") | ||
.numberValue2_renamed2; | ||
var numberValue2_renamed2 = | ||
require("ES6_ExportFrom_Intermediary2").numberValue2_renamed2; |
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 am afraid we will get a lot of issues on this, but for me it looks very good, better, so I am 👍 on it
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.
Do you think many people prefer to have that property on a separate line? We'll see.
I'm done with this PR, BTW. What do you think about the rest of the changes? If you approve it (or somebody else), I'll merge it today.
a: | ||
a(), | ||
b: | ||
[], |
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.
These look broken?
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.
It's beyond printWidth
. If the names of the keys were longer, it wouldn't look that bad. Special handling for short keys is a separate open issue: #3711
function Bar() { | ||
throw new Error("Internal error: Illegal constructor"); | ||
} | ||
) |
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.
minor but also looks unintended?
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.
Something to improve in the future. The idea was to format type assertions similarly to function calls while preserving at the same time the usual behavior of comments in Prettier. If a comment is on its own line, Prettier doesn't change that. But now I see that the behavior of the parens could depend on this condition (whether the comment is own-line) too.
Description
A take on #2482
Checklist
changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.✨Try the playground for this PR✨