Prettier plugin that expands all JSON arrays and objects into multi-line format, ensuring consistent formatting for JSON and JSONC files. Current stable version 1.0.4, released with no dependencies. Engine requires Node >=20. Unlike default Prettier behavior which may collapse short objects, this plugin always forces multi-line output. Works with special files like package.json and composer.json, and can be combined with other JSON plugins (must be listed last).
npm install prettier-plugin-expand-jsonVerified import paths — ran on the pinned version, not inferred.
Install plugin, configure Prettier, and format a JSON file to always expand arrays/objects to multi-line.
Ensure 'prettier-plugin-expand-json' is the last element in the 'plugins' array in your Prettier config.
Upgrade to Node 20 or later.
No workaround; designed to always expand.
Run `npm install --save-dev prettier-plugin-expand-json` and ensure your working directory contains node_modules.
Upgrade Prettier to version 3 or later: `npm install --save-dev prettier@3`.
Ensure Prettier config includes `"plugins": ["prettier-plugin-expand-json"]` and that the plugin is listed last if multiple plugins are used.