A prettier plugin to make package.json
prettier.
Read about npm-package.json.
npm install prettier @nice-move/prettier-plugin-package-json --save-dev
// .prettierrc.json
{
"overrides": [
{
"files": "package.json",
"options": {
"parser": "package-json"
}
}
]
}
prettier --write **/package.json
- Normalize by normalize-package-data and normalize-package-bin
- Sort
package.json
fields in a preset order - Expand
author
andcontributors
fields into objects - Remove deprecated fields like
preferGlobal
,engineStrict
- Merge
bundleDependencies
intobundledDependencies
- Rename
esnext
/jsnext
tomodule
, renametypings
totypes
- Differentiate
UNLICENSED
andUnlicense
license byprivate
- Remove leading
./
frommain
/files[n]
- Normalize
engines.*
versions - Normalize
repository
fields - Set
version
when needed - More ...