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

@duailibe duailibe 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

@suchipi suchipi 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;
Copy link
Member

@suchipi suchipi Sep 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

@duailibe duailibe Sep 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@duailibe
Copy link
Member Author

@duailibe duailibe 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

@suchipi suchipi left a comment

Awesome 👍

@suchipi
Copy link
Member

@suchipi suchipi commented Sep 10, 2017

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

@duailibe
Copy link
Member Author

@duailibe duailibe commented Sep 10, 2017

Oops so sorry about that.

Fixed!

@suchipi suchipi merged commit f51929e into prettier:master Sep 10, 2017
3 checks passed
@duailibe duailibe deleted the conditional-in-chain branch Sep 10, 2017
@lock lock bot added the locked-due-to-inactivity label Jan 19, 2019
@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.
Labels
locked-due-to-inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants