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

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!

Copy link
Member

@azz azz left a comment

Choose a reason for hiding this comment

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

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

@chrisvoll
Copy link
Contributor Author

@azz will do, thanks for reviewing!

Copy link
Member

@azz azz left a comment

Choose a reason for hiding this comment

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

Thanks!

@azz azz merged commit 4a6b61a into prettier:master Oct 8, 2017
@chrisvoll chrisvoll deleted the cv-chain-function-2832 branch October 9, 2017 21:08
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. 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 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.

Function call in chained calls results in unexpected indentation
2 participants