# What changed in prettier-plugin-astro

> 12 changes in prettier-plugin-astro 1 from its official release notes, upgrade guides and advisories: 2 breaking, 2 new APIs and options. Each one cited. Sources checked 2026-10-25. HTML: https://unstale.sh/npm/prettier-plugin-astro/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## prettier-plugin-astro 1

### Breaking changes

- The minimum supported Node version is now 22.12.0. (1.0.0) — [release notes](https://github.com/withastro/prettier-plugin-astro/releases/tag/v1.0.0)
- Whitespace formatting now matches Astro’s whitespace handling. (1.0.0) — [release notes](https://github.com/withastro/prettier-plugin-astro/releases/tag/v1.0.0)

### New APIs and options

- Adds three formatting modes: preserve shorthand as written when unset, transform eligible attributes to shorthand when true, or expand them when false. (1.1.0) — [release notes](https://github.com/withastro/prettier-plugin-astro/releases/tag/v1.1.0)
- A Prettier option was added to match Astro’s compressHTML setting; set it to match if compressHTML is set in Astro config. (1.0.0) — [release notes](https://github.com/withastro/prettier-plugin-astro/releases/tag/v1.0.0)

### Behavior and default changes

- Formatting more closely matches Prettier's built-in JSX and HTML formatting, reducing cosmetic differences between files. (1.0.0) — [release notes](https://github.com/withastro/prettier-plugin-astro/releases/tag/v1.0.0)

### Tooling

- TypeScript declarations are now published for Astro plugin options, enabling TypeScript support when working with those options. (1.0.1) — [release notes](https://github.com/withastro/prettier-plugin-astro/releases/tag/v1.0.1)

### Fixes and other changes

- Fixes a TypeError when a comment appears before a statement inside a template expression. (1.1.1) — [release notes](https://github.com/withastro/prettier-plugin-astro/releases/tag/v1.1.1)
- Fixes non-idempotent indentation of multiline comments nested inside CSS rules. (1.1.0) — [release notes](https://github.com/withastro/prettier-plugin-astro/releases/tag/v1.1.0)
- Fixes raw elements being forcefully paired up when self-closed. (1.1.0) — [release notes](https://github.com/withastro/prettier-plugin-astro/releases/tag/v1.1.0)
- Fixes non-idempotent CSS <style> block formatting when astroCompressHTML is set to 'html' or 'none'. (1.0.1) — [release notes](https://github.com/withastro/prettier-plugin-astro/releases/tag/v1.0.1)
- 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. (1.0.1) — [release notes](https://github.com/withastro/prettier-plugin-astro/releases/tag/v1.0.1)
- The rewrite fixes issues with certain elements not being handled properly inside expressions. (1.0.0) — [release notes](https://github.com/withastro/prettier-plugin-astro/releases/tag/v1.0.0)
