Skip to content
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

package.json keys sorting is deeply changed after running this tool #63

Open
NullVoxPopuli opened this issue Feb 1, 2024 · 3 comments

Comments

@NullVoxPopuli
Copy link
Contributor

NullVoxPopuli commented Feb 1, 2024

Normally 🤷 , but this has an impact on exports, since the order of those matters. (types must come before default, but alphabetically, types is after default)

@mansona
Copy link
Member

mansona commented Feb 6, 2024

This is because of sort-package-json, if it's an issue then we should probably open an issue up there https://github.com/keithamus/sort-package-json

@NullVoxPopuli
Copy link
Contributor Author

what if a repo doesn't use that specific package for sorting?

@bertdeblock
Copy link
Contributor

Maybe just sorting the dev dependencies would be less noisy?

Something like:

const { devDependencies: sortedDevDependencies } = sortPackageJson({
  devDependencies: pkg.devDependencies
});

pkg.devDependencies = sortedDevDependencies;

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

No branches or pull requests

3 participants