Skip to content

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

@alumni

Description

@alumni

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions