npm / prettier-plugin-astro
prettier-plugin-astro
What changed in prettier-plugin-astro 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-25.
2 breaking2 new APIs and options1 behavior and defaults1 tooling6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initprettier-plugin-astro 112 changes
Breaking changes 2
The minimum supported Node version is now 22.12.0.
Whitespace formatting now matches Astro’s whitespace handling.
New APIs and options 2
Adds three formatting modes: preserve shorthand as written when unset, transform eligible attributes to shorthand when true, or expand them when false.
A Prettier option was added to match Astro’s compressHTML setting; set it to match if compressHTML is set in Astro config.
Behavior and default changes 1
Formatting more closely matches Prettier's built-in JSX and HTML formatting, reducing cosmetic differences between files.
Tooling 1
TypeScript declarations are now published for Astro plugin options, enabling TypeScript support when working with those options.
Fixes and other changes 6
Fixes a TypeError when a comment appears before a statement inside a template expression.
Fixes non-idempotent indentation of multiline comments nested inside CSS rules.
Fixes raw elements being forcefully paired up when self-closed.
Fixes non-idempotent CSS <style> block formatting when astroCompressHTML is set to 'html' or 'none'.
Fixes an error when a JavaScript comment appears before a raw or custom-printed element, such as a <script> in the alternate branch of a conditional expression.
The rewrite fixes issues with certain elements not being handled properly inside expressions.