Registry /
devops / prettier-plugin-package-perfection
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default
✓ No explicit import needed; Prettier auto-loads plugins
✗ None
This is a Prettier plugin; you do not import it directly in your code. Install it and add to Prettier config.
options
✓ // .prettierrc
{ "plugins": ["prettier-plugin-package-perfection"] }
✗ {"plugins": ["prettier-plugin-package-perfection"] }
Ensure plugin is listed in the 'plugins' array of your Prettier configuration file.
types
✓ import type { PackagePerfectionOptions } from 'prettier-plugin-package-perfection'
✗ const { PackagePerfectionOptions } = require('prettier-plugin-package-perfection')
TypeScript types are bundled; import type for option interfaces.
Install the plugin, configure it in .prettierrc, and format your package.json with Prettier.
// Install dependencies
// npm install --save-dev prettier prettier-plugin-package-perfection
// .prettierrc (JSON)
{
"plugins": ["prettier-plugin-package-perfection"],
"packagePerfection": {
"sortAz": true,
"sortScripts": false
}
}
// Run Prettier on package.json
// npx prettier --write package.json
Errors
Common errors & fixes
Error: Cannot find module 'prettier-plugin-package-perfection'
Plugin not installed or not in node_modules.
fixRun 'npm install --save-dev prettier-plugin-package-perfection' and ensure it's in devDependencies.
Error: Invalid plugin configuration: 'packagePerfection' option not recognized
Plugin not added to Prettier's plugins array.
fixAdd '"plugins": ["prettier-plugin-package-perfection"]' to your .prettierrc file.
Error: Unknown option 'packagePerfection.sortAz'
Option name typo or not supported in this version.
fixCheck the plugin's README for supported options; correct spelling.
Audit
Dependencies
prettierrequiredPeer dependency required for the plugin to function.
prettier-package-jsonrequiredCore library used to format the package.json content.