Skip to content

Break closing paren of ConditionalExpression in member chains#2786

Merged
suchipi merged 4 commits intoprettier:masterfrom
duailibe:conditional-in-chain
Sep 10, 2017
Merged

Break closing paren of ConditionalExpression in member chains#2786
suchipi merged 4 commits intoprettier:masterfrom
duailibe:conditional-in-chain

Conversation

@duailibe
Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Member

@suchipi suchipi left a comment

Choose a reason for hiding this comment

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

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
Copy Markdown
Member

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
Copy Markdown
Collaborator Author

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 duailibe force-pushed the conditional-in-chain branch from 2d4fbd9 to 2ce3c0a Compare September 10, 2017 19:48
@duailibe
Copy link
Copy Markdown
Collaborator Author

@suchipi I forgot to update a snapshot 😅

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

Copy link
Copy Markdown
Member

@suchipi suchipi left a comment

Choose a reason for hiding this comment

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

Awesome 👍

@suchipi
Copy link
Copy Markdown
Member

suchipi commented Sep 10, 2017

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

@duailibe
Copy link
Copy Markdown
Collaborator Author

Oops so sorry about that.

Fixed!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants