JSPM

  • Created
  • Published
  • Downloads 1067718
  • Score
    100M100P100Q195460F
  • License MIT

Prettier package.json plugin to make the order of properties nice.

Package Exports

  • prettier-plugin-packagejson

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (prettier-plugin-packagejson) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Prettier plugin for package.json

CircleCI Renovate

Installation

$ npm i -D prettier prettier-plugin-packagejson

overrides is required because native json parser takes precedence over this plugin.

{
  "semi": false,
  "singleQuote": true,
  "trailingComma": "all",

  "plugins": ["prettier-plugin-packagejson"],
  "overrides": [
    {
      "files": "package.json",
      "options": {
        "parser": "package-json"
      }
    }
  ]
}

Rules

  • Primary (ordered to top)
    1. name
    2. description
    3. version
    4. author
    5. license
  • Others
    • Sorted alphabetically
  • Sort children
    • dependencies
    • devDependencies
    • peerDependencies
    • optionalDependencies
    • keywords

ToDo: Add more tweaks