-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom import order separation (#12)
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]>
- Loading branch information
Showing
21 changed files
with
763 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.