prettier-plugin-sort-package-json
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

prettier-plugin-sort-package-json

A Prettier plugin to sort the package.json file in a consistent and opinionated way, this ensures that your package.json file is always well-organized and easy to read.

  • 🌟 Set and forget
  • 🔌 Zero-dependency
  • 🔧 Zero-configuration
  • 🛠️ Auto-fix with Prettier
  • 🚀 No extra commands needed
  • 🧹 Lint together with Prettier

Usage

To install prettier-plugin-sort-package-json, run the following command:

pnpm add -D prettier-plugin-sort-package-json

To use prettier-plugin-sort-package-json with the CLI, use the --plugin parameter:

- prettier --write .
+ prettier --write . --plugin=prettier-plugin-sort-package-json

If you have a configuration file, you can also add this to the "plugins" list:

{
	"plugins": ["prettier-plugin-sort-package-json"]
}

You can then run Prettier as usual, and your package.json files will be sorted automatically.

Package Sidebar

Install

npm i prettier-plugin-sort-package-json

Weekly Downloads

12

Version

0.2.0

License

MIT

Unpacked Size

4.54 kB

Total Files

5

Last publish

Collaborators

  • ignatiusmb