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

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

left a comment

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

@chrisvoll

This comment has been minimized.

Copy link
Contributor Author

commented Oct 7, 2017

@azz will do, thanks for reviewing!

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

left a comment

Thanks!

@azz azz merged commit 4a6b61a into prettier:master Oct 8, 2017
3 checks passed
3 checks passed
codecov/patch 100% of diff hit (target 80%)
Details
codecov/project 97.02% (+0.02%) compared to 6c8cde9
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@chrisvoll chrisvoll deleted the chrisvoll:cv-chain-function-2832 branch Oct 9, 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.