This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 664
feature(rome_js_formatter): Static Member Expression formatting #2727
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MichaReiser
commented
Jun 17, 2022
MichaReiser
force-pushed
the
feature/format-static-member-expression
branch
from
June 20, 2022 06:27
05135f3
to
c2c9890
Compare
Deploying with Cloudflare Pages
|
MichaReiser
force-pushed
the
feature/format-static-member-expression
branch
from
June 20, 2022 06:28
c2c9890
to
1d596c4
Compare
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
MichaReiser
commented
Jun 20, 2022
@@ -107,11 +106,7 @@ const composition = (ViewComponent, ContainerComponent) => | |||
|
|||
romise.then( | |||
(result) => | |||
result.veryLongVariable.veryLongPropertyName > someOtherVariable ? "ok" : "fail", | |||
result.veryLongVariable | |||
.veryLongPropertyName > someOtherVariable ? "ok" : "fail", |
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.
This formatting doesn't yet match Prettier's because Rome formats conditional expressions differently. Same for all other tests that involve conditional expressions.
MichaReiser
commented
Jun 20, 2022
this.dummy.type8.dummyPropertyFunction = () => { | ||
return "dummy"; | ||
}; | ||
this.dummy.type1.dummyPropertyFunction = this.dummy |
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.
Rome's assignment like expression formatting differs from Prettier's
ematipico
approved these changes
Jun 20, 2022
crates/rome_js_formatter/src/js/expressions/static_member_expression.rs
Outdated
Show resolved
Hide resolved
MichaReiser
force-pushed
the
feature/format-static-member-expression
branch
from
June 21, 2022 06:30
1d596c4
to
9cf4b36
Compare
MichaReiser
force-pushed
the
feature/format-static-member-expression
branch
from
June 23, 2022 11:44
9cf4b36
to
89f616e
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves the grouping of static member expressions (does not yet include computed members) by choosing the best layout for a given assignment.
Test Plan
cargo test
There's one failing test because of an instability in the comments formatting