Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ignatiusmb/prettier-plugin-sort-package-json
Prettier plugin to sort package.json
https://github.com/ignatiusmb/prettier-plugin-sort-package-json
Last synced: 25 days ago
JSON representation
Prettier plugin to sort package.json
- Host: GitHub
- URL: https://github.com/ignatiusmb/prettier-plugin-sort-package-json
- Owner: ignatiusmb
- License: mit
- Created: 2023-07-31T09:49:31.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-18T07:15:47.000Z (12 months ago)
- Last Synced: 2024-10-28T19:22:45.561Z (2 months ago)
- Language: TypeScript
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# prettier-plugin-sort-package-json
A [Prettier](https://prettier.io/) 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:
```bash
pnpm add -D prettier-plugin-sort-package-json
```To use `prettier-plugin-sort-package-json` with the CLI, use the `--plugin` parameter:
```diff
- 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:
```json
{
"plugins": ["prettier-plugin-sort-package-json"]
}
```You can then run Prettier as usual, and your `package.json` files will be sorted automatically.