feat: sort export/import paths#350
Open
GeorgeTaveras1231 wants to merge 17 commits intokeithamus:mainfrom
Open
feat: sort export/import paths#350GeorgeTaveras1231 wants to merge 17 commits intokeithamus:mainfrom
GeorgeTaveras1231 wants to merge 17 commits intokeithamus:mainfrom
Conversation
Force relative position of certain conditions, sort paths in alphabetically with exception of paths with wildcards.
Co-authored-by: Keith Cirkel <keithamus@users.noreply.github.com>
1. types before target environments 2. environments first 3. support module-sync
Additionally fix order of `module-sync` which goes after `require` and `import`
Adds known edge conditions and addition compilation targets from the WinterCG standard (Called out in the Node.js community conditions documentation. - https://nodejs.org/api/packages.html#community-conditions-definitions
Apply some alphabetical order
- move types to top - move browser under deno and bun since those can be used to bundle app for browsers
Contributor
Author
|
@fisker this only handles the path keys - I'll let you handle the conditions. |
fisker
added a commit
to fisker/sort-package-json
that referenced
this pull request
Mar 4, 2025
Collaborator
|
I just learned that conditions can be an array ... https://github.com/acornjs/acorn/blob/0d046aa11da7a8e545eda830037675f75d4d88bc/acorn/package.json#L9-L16 |
Owner
|
@GeorgeTaveras1231 would you kindly rebase this, and we can look to merge. |
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.
Subset of #336
Sorts path objects in
importsandexportsalphabetically, pushing wildcards to bottom.