Prettier plugin to enforce consistent brace style for all control statements (for, if, while, etc.), adding curly braces around bodies. Current stable version is 0.4.1, released November 2025. It works alongside Prettier to enforce the equivalent of ESLint's curly 'all' rule, filling a gap where Prettier intentionally avoids modifying code structure. Requires Node >=18 and Prettier ^3. Version 0.4.0 introduced a complete rewrite using wrapped printers.estree. The plugin is actively maintained by JoshuaKGoldberg and the community.
npm install prettier-plugin-curlyVerified import paths — ran on the pinned version, not inferred.
Configures Prettier to use prettier-plugin-curly; shows transformation of single-line if to curly brace style.
Upgrade to Prettier 3 and use prettier-plugin-curly ^0.4.1
Ensure no custom printer overrides conflict with new internal architecture
Use ESM imports or upgrade to v0.4.1 which may have limited CJS support (check release notes)
If selective behavior is needed, consider ESLint's curly rule instead
Ensure plugin order in 'plugins' array places prettier-plugin-curly before any conflicting plugins
Run `npm install prettier-plugin-curly --save-dev`
In .prettierrc, use "plugins": ["prettier-plugin-curly"] (string name) not a path
Use import syntax or downgrade to v0.3.x (but note Prettier 3 support may be limited)
Use `import prettierPluginCurly from 'prettier-plugin-curly'` (default import) not `{ prettierPluginCurly }`