A Prettier plugin providing additional YAML formatting options beyond Prettier's built-in support. Current stable version is 1.1.3. It adds options like yamlBlockStyle, yamlCollectionStyle, yamlQuoteKeys, and yamlQuoteValues. Released under MIT, it has a frequent release cadence with 6+ versions. Key differentiators: no dependencies beyond Prettier 3+, TypeScript types included, and addresses CVE-2026-33532 in the underlying yaml library. It is ESM-only and requires Node >=20.
npm install prettier-plugin-yamlVerified import paths — ran on the pinned version, not inferred.
Shows installation, configuration with yamlQuoteKeys option, and usage with npx.
Add `"type": "module"` to your package.json or use .mjs files when importing the plugin programmatically.
Upgrade to v1.1.2 or later: npm install prettier-plugin-yaml@latest
No action needed.
Ensure other YAML plugins appear before prettier-plugin-yaml in the plugins array.
If you need all strings quoted, consider using yamlQuoteValues with additional manual overrides.
Update to v1.1.2+: npm install prettier-plugin-yaml@1.1.2
Use import syntax or set type: module in package.json.
Run npm install --save-dev prettier-plugin-yaml and add 'prettier-plugin-yaml' to the plugins array in .prettierrc.