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

Break closing paren of ConditionalExpression in member chains #2786

Merged
merged 4 commits into from Sep 10, 2017

Conversation

@duailibe
Copy link
Member

commented Sep 10, 2017

Still related to #2775, maybe a better way to print this case.

(a
  ? b
  : c
).prop;

(a
  ? b
  : c
).call();

(a
  ? b
  : c
)
  .call1()
  .call2();

If you guys think this is cool, let me know if I should do the same for LogicalExpression (I believe so) and we can do it in a single commit

Thanks!

Copy link
Member

left a comment

Thanks as always, you're rocking it this week 😃

What would it look like for logical expressions?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(valid
? helper.responseBody(this.currentUser)
: helper.responseBody(this.defaultUser)).prop;

This comment has been minimized.

Copy link
@suchipi

suchipi Sep 10, 2017

Member

I understand why it's happening, but this kinda feels like a regression on the changes in #2784. I think I'm okay with it, though.

This comment has been minimized.

Copy link
@duailibe

duailibe Sep 10, 2017

Author Member

Actually, that's my mistake I forgot to update this test 😳

@duailibe duailibe force-pushed the duailibe:conditional-in-chain branch from 2d4fbd9 to 2ce3c0a Sep 10, 2017
@duailibe

This comment has been minimized.

Copy link
Member Author

commented Sep 10, 2017

@suchipi I forgot to update a snapshot 😅

I updated it with what I think would work for logical expressions

Copy link
Member

left a comment

Awesome 👍

@suchipi

This comment has been minimized.

Copy link
Member

commented Sep 10, 2017

Looks like CI is failing due to a format violation; could you fix?

@duailibe

This comment has been minimized.

Copy link
Member Author

commented Sep 10, 2017

Oops so sorry about that.

Fixed!

@suchipi suchipi merged commit f51929e into prettier:master Sep 10, 2017
3 checks passed
3 checks passed
codecov/patch 100% of diff hit (target 80%)
Details
codecov/project 96.68% (+<.01%) compared to df54820
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@duailibe duailibe deleted the duailibe:conditional-in-chain branch Sep 10, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.