Skip to content

πŸ› Bug: sort-collections resets indentation on scripts/etcΒ #1555

@Nick2bad4u

Description

@Nick2bad4u

Bug Report Checklist

Expected

Indentation shouldn't change when sorting things in package.json

Actual

When you run the:

        "package-json/scripts-name-casing": "warn",
            "package-json/sort-collections": [ "warn",
            [
                "config",
                "dependencies",
                "devDependencies",
                "exports",
                "optionalDependencies",
                // "overrides",
                "peerDependencies",
                "peerDependenciesMeta",
                "scripts"
            ],
        ],

(my config)

when it sorts the scripts, my indendation changes on the entire script block from:

Before:

        "lint:publint": "publint",

After:

    "lint:publint": "publint",

I use indentation of 4 spaces and it gets reset to 2 spaces pretty much

Version

eslint-plugin-package-json@0.88.2

ESLint Version

eslint@9.39.2

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: accepting prsPlease, send a pull request to resolve this! πŸ™type: bugSomething isn't working πŸ›

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions