Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoSign in
Socket

prettier-plugin-packagejson

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-packagejson

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

Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
1.3M
0.59%
Maintainers
1
Weekly downloads
 
Created
Source

npm-badge downloads-badge actions-badge renovate-badge codecov-badge

prettier-plugin-packagejson

A Prettier plugin to sort the keys of a package.json file using sort-package-json.

Installation

npm i -D prettier prettier-plugin-packagejson

For prettier v3+ you need to configure

module.exports = {
  // add this
  plugins: ['prettier-plugin-packagejson'],
}

Options

packageSortOrder

Custom ordering array for package.json fields. This option is passed to sort-package-json's sortOrder option.

Type: string[] Default: [] (uses default sort order from sort-package-json)

Example (.prettierrc):

{
  "packageSortOrder": ["name", "version", "description", "main"]
}

Keywords

package.json

FAQs

Package last updated on 20 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts