8000 [prettier-plugin-pkg] add packageSortOrder option · Issue #467 · un-ts/prettier · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[prettier-plugin-pkg] add packageSortOrder option #467
Closed
@Shinigami92

Description

@Shinigami92

prettier-plugin-packagejson had a packageSortOrder option where you can specify your own sort order.

https://github.com/matzkoh/prettier-plugin-packagejson/blob/159c4bd840329160c18a3e66a1e8f34598412e92/lib/index.cjs#L28

Can we bring that back?

My current config is using "packageSortOrder": ["name", "version", "description", "scripts"] as I want these 4 at the top, and then everything else sorted normally.

It might be that prettier-plugin-pkg also has a different "normal" order than prettier-plugin-packagejson's default...
But maybe we could provide a constant and export it, so it can be used as

"packageSortOrder": ["name", "version", "description", "scripts", ...PACKAGEJSON_SORT_ORDER]

"packageSortOrder": ["name", "version", "description", "scripts", ...UNTS_SORT_ORDER]

or something like this 🤔

if a key occurs a second time, I would suggest that it will just be ignored the second time

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0