0.2.0 โข Published 8 months ago
prettier-plugin-sort-package-json v0.2.0
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.