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
Added chained "pipe" function formatting tests #6818
Added chained "pipe" function formatting tests #6818
Conversation
Adding a |
Like I said in the original PR, I’m here to help! Ping me if you come up with any ideas/need to understand some code related to call expression splitting. I don’t think the above issue is actionable in its current form but I’m very willing to accommodate requests for new heuristics. I don’t want to be the one to hold up 1.19. |
I agree with @brainkim. What’s your intention with this PR, @brodybits? |
in #6469 (comment) (I am adding the explicit link for the sake of some less experienced Prettier developers such as myself)
I have a feeling that the formatting behavior in this case should be explicitly tested in the test suite, visible if it changes in a minor release. I think the change from 1.18.2 to master that is demonstrated here should ideally be avoided in a minor release. I also wanted to demonstrate the trick of using comments to get cleaner formatting in some cases, since it was not obvious to me at first. I think it should be documented at some point. I am fine if you guys want to close this PR. |
These are good test cases, so I think we should merge. |
I think these tests should be placed in |
which was correct according to prettier@1.18.2 Co-authored-by: Simon Lydell <simon.lydell@gmail.com> Co-authored-by: Christopher J. Brody <chris@brody.consulting>
in order to avoid unwanted reformatting Co-authored-by: Simon Lydell <simon.lydell@gmail.com> Co-authored-by: Christopher J. Brody <chris@brody.consulting>
3bd9d10
to
cb4494d
Compare
I just moved the new tests into |
# Conflicts: # tests/functional_composition/__snapshots__/jsfmt.spec.js.snap # tests/js/functional-composition/pipe-function-calls-with-comments.js # tests/js/functional-composition/pipe-function-calls.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a rebase, should good to merge.
In response to #6469 (comment) by @lydell, here are a couple of tests that show how Prettier handles the formatting of "pipe" functions and chained "pipe" functions:
@lydell please feel free to correct and improve this explanation as you feel would be justified.
I would like to make the following points:
docs/
directory)CHANGELOG.unreleased.md
file following the template.✨Try the playground for this PR✨