Introduces importOrderBuiltinModulesToTop for Node Builtins #71#150
Closed
nickhudkins wants to merge 1 commit into
Closed
Introduces importOrderBuiltinModulesToTop for Node Builtins #71#150nickhudkins wants to merge 1 commit into
importOrderBuiltinModulesToTop for Node Builtins #71#150nickhudkins wants to merge 1 commit into
Conversation
vitomir-sae
approved these changes
May 11, 2022
IanVS
added a commit
to IanVS/prettier-plugin-sort-imports
that referenced
this pull request
May 12, 2022
This is a cherry-pick of a PR from @nickhudkins to the upstream project: trivago/prettier-plugin-sort-imports#150, adjusted slightly to work within the rule of this project to not sort beyond side-effect import groups. @blutorange what do you think of this? I'm reluctant to add another option, but if we changed this without an option it would be a breaking change. I don't have a strong opinion one way or the other, but personally I do like sorting builtins to the top, so it would be nice to have some way to do it. Co-authored-by: Nick Hudkins <nhudkins@amazon.com>
IanVS
reviewed
May 18, 2022
| * where the not matched imports should be placed | ||
| */ | ||
| export const THIRD_PARTY_MODULES_SPECIAL_WORD = '<THIRD_PARTY_MODULES>'; | ||
| export const BUILTIN_MODULES = builtinModules.join('|'); |
There was a problem hiding this comment.
Just a bit of warning, this regex needs to be a bit more strict, see IanVS/prettier-plugin-sort-imports#17 for the implementation in a fork.
|
Maybe it could be a |
Collaborator
|
Hey @nickhudkins! thank you for PR, it was implemented in #381 and merged to 6th version. It's about to release soon! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change introduces a new configuration option to sort Node builtins to the top of all imports 🎉