{"id":20402,"library":"prettier-plugin-pkgjson","title":"Prettier Plugin PkgJson","description":"Prettier plugin for clean and meaningful formatting of package.json files. Version 0.3.0 is the latest stable release. It sorts keys in a logical order, formats JSON consistently, and integrates seamlessly with Prettier. No dependencies. Actively maintained as part of the tunnckoCore opensource monorepo.","status":"active","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/tunnckoCore/opensource","tags":["javascript","tunnckocorehq","tunnckocore-oss","hela","development","developer-experience","dx","prettier","prettier-plugin"],"install":[{"cmd":"npm install prettier-plugin-pkgjson","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-plugin-pkgjson","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-plugin-pkgjson","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Plugin is auto-loaded by Prettier when listed in plugins array. No explicit import in code.","wrong":"// No import needed; Prettier discovers it automatically","symbol":"default (plugin)","correct":"// In .prettierrc: { \"plugins\": [\"prettier-plugin-pkgjson\"] }"}],"quickstart":{"code":"{\n  \"semi\": false,\n  \"singleQuote\": true,\n  \"tabWidth\": 2,\n  \"trailingComma\": \"none\",\n  \"plugins\": [\"prettier-plugin-pkgjson\"]\n}","lang":"javascript","description":"Example .prettierrc configuration to enable the plugin and format package.json files."},"warnings":[{"fix":"Update Prettier to >=2.0.0.","message":"Plugin requires Prettier v2.x or later; not compatible with Prettier v1.x.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use only for package.json; for other JSON files use other plugins.","message":"Only works on package.json files; other JSON files are unaffected.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Add \"prettier-plugin-pkgjson\" to plugins array in Prettier config.","message":"Plugin must be explicitly added to Prettier's plugins array; not auto-detected.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run npm install prettier-plugin-pkgjson --save-dev","cause":"Plugin not installed or not in node_modules.","error":"Error: Cannot find module 'prettier-plugin-pkgjson'"},{"fix":"Ensure prettier-plugin-pkgjson is listed in .prettierrc plugins array, not in ESLint config.","cause":"Misconfiguring ESLint with prettier-plugin-pkgjson.","error":"Invalid option for rule 'prettier/prettier': Expected a string but received an object"},{"fix":"Use Node.js >=10.13; if issue persists, check that Prettier resolves the plugin correctly.","cause":"Using older Node.js (<12) or misconfigured imports.","error":"Error: Package subpath './package.json' is not defined by \"exports\" in .../prettier-plugin-pkgjson/package.json"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}