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

fix: support sequential CallExpressions in member chains #2990

Merged
merged 3 commits into from Oct 8, 2017

Conversation

chrisvoll
Copy link
Contributor

@chrisvoll chrisvoll commented Oct 7, 2017

fixes #2832

This PR fixes the formatting for this input:

Input:

wrapper.find('SomewhatLongNodeName').prop('longPropFunctionName')().then(function() {
  doSomething();
});

Before:

wrapper
  .find("SomewhatLongNodeName")
  .prop("longPropFunctionName")().then(function() {
  doSomething();
});

After:

wrapper
  .find("SomewhatLongNodeName")
  .prop("longPropFunctionName")()
  .then(function() {
    doSomething();
  });

This is my first PR for Prettier, so I'm more than happy to make any adjustments as needed. Thanks!

azz
azz approved these changes Oct 7, 2017
Copy link
Member

@azz azz left a comment

Looks great. Could we add one or two tests for when the second function call has arguments?

@chrisvoll
Copy link
Contributor Author

@chrisvoll chrisvoll commented Oct 7, 2017

@azz will do, thanks for reviewing!

azz
azz approved these changes Oct 8, 2017
Copy link
Member

@azz azz left a comment

Thanks!

@azz azz merged commit 4a6b61a into prettier:master Oct 8, 2017
3 checks passed
@chrisvoll chrisvoll deleted the cv-chain-function-2832 branch Oct 9, 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.

2 participants