Skip to content

Register colinaaa/sort-package-json plugin - #80

Open
colinaaa wants to merge 1 commit into
dprint:mainfrom
colinaaa:codex/register-sort-package-json
Open

colinaaa wants to merge 1 commit into
dprint:mainfrom
colinaaa:codex/register-sort-package-json

Conversation

@colinaaa

@colinaaa colinaaa commented Sep 4, 2026

Copy link
Copy Markdown

Registers colinaaa/sort-package-json in the dprint plugin registry.

The plugin sorts package.json keys into a conventional order and can optionally sort script keys. This entry adds its npm package metadata, package.json file matching, search keywords, and a node_modules exclusion.

Release: https://github.com/colinaaa/dprint-plugin-sort-package-json/releases/tag/0.2.1
npm: https://www.npmjs.com/package/dprint-plugin-sort-package-json

Change-Id: I55a3f97eef5d9e1e859859508b06f8f028795b97
@colinaaa

colinaaa commented Sep 8, 2026

Copy link
Copy Markdown
Author

Hi @dsherret, could you please take a look at this PR and the corresponding docs PR dprint/dprint#1242 as well? Thanks!

@dsherret

dsherret commented Sep 10, 2026

Copy link
Copy Markdown
Member

There's an issue where if we merge this then it would be added to every project running dprint init and it might cause some confusion because the json formatting rules wouldn't be applied to package.json files anymore. I think that would be confusing to users and also mean most JS projects would by default have this extra plugin.

Instead of making this a separate plugin, would you be willing to contribute this to dprint-plugin-json? There's an open issue here: dprint/dprint-plugin-json#40

The one benefit to having it in a separate plugin could be to combine it with plugins other than dprint-plugin-json though. I think I might look into having a new concept of a plugin saying it's "additive" so it should always be run regardless. It could express this in its plugin info.

@dsherret

Copy link
Copy Markdown
Member

The one benefit to having it in a separate plugin could be to combine it with plugins other than dprint-plugin-json though. I think I might look into having a new concept of a plugin saying it's "additive" so it should always be run regardless. It could express this in its plugin info.

I'm working on a PR to dprint for this right now.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants