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

Doesn't work for <root>/package.json #226

Open
alumni opened this issue Jul 7, 2021 · 0 comments
Open

Doesn't work for <root>/package.json #226

alumni opened this issue Jul 7, 2021 · 0 comments

Comments

@alumni
Copy link

alumni commented Jul 7, 2021

I have a monorepo created with nx and it seems that the scripts in the root package.json does get sorted when using the CLI.

For example, running e.g. sort-package-json {.,apps/*}/{package.json,.eslintrc,.prettierrc} will work for any of the files (./.eslintrc or apps/xxx/package.json) except for ./package.json.

I checked by changing the order of two scripts (e.g. I put nx before lint). The file is parsed, but the order is not changed back.

Fun fact regarding related tools: eslint-plugin-json-files is sorting the scripts just fine, prettier-plugin-packagejson is not.

Also: it seems that compilerOptions inside any tsconfig.json or tsconfig.xxx.json are not sorted either.

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

1 participant