@nice-move/prettier-plugin-package-json

0.8.0 • Public • Published

@nice-move/prettier-plugin-package-json

A prettier plugin to make package.json prettier.

npm github node

Read about npm-package.json.

Installation

npm install prettier @nice-move/prettier-plugin-package-json --save-dev

Usage

// .prettierrc.json
{
  "overrides": [
    {
      "files": "package.json",
      "options": {
        "parser": "package-json"
      }
    }
  ]
}
prettier --write **/package.json

Feature

  • Normalize by normalize-package-data and normalize-package-bin
  • Sort package.json fields in a preset order
  • Expand author and contributors fields into objects
  • Remove deprecated fields like preferGlobal, engineStrict
  • Merge bundleDependencies into bundledDependencies
  • Rename esnext / jsnext to module, rename typings to types
  • Differentiate UNLICENSED and Unlicense license by private
  • Remove leading ./ from main / files[n]
  • Normalize engines.* versions
  • Normalize repository fields
  • Set version when needed
  • More ...

Related

Package Sidebar

Install

npm i @nice-move/prettier-plugin-package-json

Weekly Downloads

1,697

Version

0.8.0

License

MIT

Unpacked Size

96.7 kB

Total Files

4

Last publish

Collaborators

  • airkro