-
Notifications
You must be signed in to change notification settings - Fork 25
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
[Feature] Allow manual configuration of line breaks #11
Comments
So if I understand this correctly, |
IanVS
added a commit
that referenced
this issue
May 17, 2022
Closes #11 This is an adaptation of trivago/prettier-plugin-sort-imports#42 from @atombrenner. I wasn't able to use most of the commits from the original branch, because our approach is different in this project, but I did pull in his commit with tests. The other change I needed to make here was to modify the cloned nodes in `adjustCommentsOnSortedNodes`, rather than mutating the original, which was leading to some strange bugs in the tests. * Add test for "local" groups, include newlines in tests `getSortedNodesByImportOrder` includes a check for `importOrderSeparation`, and adds newlines when it's true, so we should include that in our tests. * Add support for custom import group separators * add tests * Update snapshots But the last snapshot is wrong, will fix in next commit * Copy nodes when adjusting comments Mutating the original nodes causes strange effects, as seen in the snapshot * Avoid duplicate newlines * minor: Remove unused variables * Update README Co-authored-by: Christian Rodemeyer <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem?
See trivago/prettier-plugin-sort-imports#36
Describe the solution you'd like
I think the solution in trivago/prettier-plugin-sort-imports#42 is pretty smart. It does not require a new option, but gives some flexibility for folks who want to specify new lines between specific groups.
Describe alternatives you've considered
We could wait until the upstream project merges this, but it seems a little unlikely at this point.
@blutorange, what do you think of this approach?
The text was updated successfully, but these errors were encountered: