prettier-plugin-astro
1.1.2 · 23 Oct 2026MIT1.7M / weekRepositoryHomepagenpmAtom feed
45 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 1.x · latest line
1.1.2
23 Oct 2026Updates the Astro compiler to the latest release
1.1.1
9 Oct 2026Fixes a
TypeError("Cannot read properties of undefined (reading 'semi')") when a comment appears before a statement inside a template expression.
1.1.0
24 Sep 2026Adds support for three
astroAllowShorthandformatting modes:Fix non-idempotent indentation of multiline comments nested inside CSS rules.
Fixes raw elements being forcefully paired up when self-closed.
1.0.1
17 Sep 2026Publish TypeScript declarations for Astro plugin options.
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.Fix non-idempotent CSS
<style>block formatting withastroCompressHTMLset to'html'or'none'.
1.0.0
8 Sep 2026- Breaking
Raises the minimum supported Node version to 22.12.0.
- Breaking
The plugin has been fully rewritten on top of Astro 7's new Rust compiler. This rewrite fixes many long-standing issues, such as certain elements not being handled properly inside expressions.
Whitespace formatting now matches Astro’s whitespace handling, and a new
astroCompressHTMLoption has been added to match Astro'scompressHTMLsetting. If you setcompressHTMLin your Astro config, also setastroCompressHTMLin your Prettier config to match.In addition, this rewrite has allowed us to more closely match Prettier's built-in JSX and HTML formatting, leading to less cosmetic differences between the different files in your repo.
- 0.14.x
0.14.1
16 Jul 2024Fixes an issue where style and script tags would sometimes get moved to other tags
0.14.0
24 May 2024Adds a new option called
astroSkipFrontmatterto disable formatting the frontmatter. This can be useful when using other tools to format the frontmatter, such as Biome or dprint.
- 0.13.x
0.13.0
19 Jan 2024Fix plugin sometimes including significant whitespace inside components, fragments and custom elements
- 0.12.x
0.12.3
27 Dec 2023Fix
<br />tags sometimes causing additional spaces to appearFix not being able to format expressions with more than 2 roots
0.12.2
13 Nov 2023Fix attributes using optional chaining not formatting correctly
0.12.1
25 Oct 2023Fix attributes with multiple invalid JSX characters in their key inside expressions causing the plugin to throw an error
0.12.0
22 Aug 2023Do not delete line breaks and indentation of lines in class attribute
Format doctype as lowercase to match Prettier 3.0
- 0.11.x
0.11.1
15 Aug 2023Removes pnpm from engines
0.11.0
12 Jul 2023Migrated the plugin to Prettier 3's new APIs. It's unfortunately not possible for a plugin to support both version 2 and 3 of Prettier. As such, from this version on, only Prettier 3 is supported.
- 0.10.x
0.10.0
1 Jun 2023Use the sync entrypoint of the Astro compiler instead of
synckit, improving performance and reducing the dependency count of the plugin
- 0.9.x
0.9.1
26 May 2023Prevent parsing empty script tags
0.9.0
19 May 2023Use the babel-ts parser to parse the frontmatter. This parser was already used for expressions inside the template, so the experience should now be more homogenous all throughout the file.
Add support for formatting script tags containing JSON, Markdown and other content
- 0.8.x
0.8.1
11 May 2023Add compatibility for other plugins parsing top-level returns in Astro frontmatter
Correctly pass options to embedded parsers
Fix style tags using Stylus being truncated under certain circumstances
0.8.0
26 Jan 2023Add support for LESS style tags, fixed crash on style tags with unknown languages
Add support for formatting spread attributes
- 0.7.x
0.7.2
4 Jan 2023Fix packaging error causing the plugin to only be installable using pnpm
0.7.1
3 Jan 2023Upgrade
@astrojs/compilerFix inline tags not hugging the end of their content if the last child was a tag
0.7.0
28 Oct 2022Fixed custom-elements being allowed to self close despite the HTML spec saying otherwise
Add support for formatting expressions with multiple root elements
Add support for prettier-ignore comments
- 0.6.x
0.6.0
17 Oct 2022Allow elements with set:* directives to self-close
Fix
jsxSingleQuotenot considering if there was any incompatible characters inside the attribute valueFix style tags getting moved inside body tags
Fix fragments with expressions inside being moved to before the expressions in certain cases
- 0.5.x
0.5.5
29 Sep 2022Fix missing newline after attributes on inline elements when using singleAttributePerLine
Fix expressions not hugging the end of the tag in cases where they should
Fix newlines being added to style tags even if they were empty
0.5.4
31 Aug 2022Support formatting expressions with elements with attributes not compatible with JSX
0.5.3
23 Aug 2022Update to latest version of the compiler
0.5.2
23 Aug 2022End tag hugs text nodes not ending in whitespace
Correctly break self-closing tags
0.5.1
22 Aug 2022Fix TypeScript not working inside expressions
0.5.0
10 Aug 2022Properly format multi-lines expressions, fixes expression with leading comments not being formatted properly
- 0.4.x
0.4.1
8 Aug 2022Properly trim the class attribute on HTML elements
0.4.0
8 Aug 2022Fix loading workers not working when parser is used from an external module
Fixed error when trying to format custom elements
Properly handle errors inside style tags
- 0.3.x
0.3.0
4 Aug 2022Update error handling to give better error messages when we fail to parse an expression, fixed shorthands props not working inside expressions
Improve error handling for frontmatter and script tags
- 0.2.x
0.2.0
29 Jul 2022- Removed
Remove support for the Markdown component
- 0.1.x
0.1.3
29 Jul 2022Use Prettier option: 'singleAttributePerLine'
0.1.2
21 Jul 20220.1.1
24 Jun 2022Fix for jsx empty expression
0.1.0
24 Jun 2022Migrate to new compiler. This took months of work, and some things might be broken for the time being. However, it should be a major improvement in most cases over the previous version. We hope you'll like it!
- 0.0.x
0.0.12
23 Jan 2022Fix a bug in "allow shorthand" option
Fix comment error when nested
Format html using only the plugin itself
Patch Changes
Fix a bug in "allow shorthand" option
Fix comment error when nested
Format html using only the plugin itself
0.0.11
24 Nov 2021Bump ava
Format spread operator
Format markdown component content
Patch Changes
Bump ava
Format spread operator
Format markdown component content
0.0.10
9 Nov 2021Format nested style tag content
Add Astro option: 'allow shorthand'
Typescript refactor
Patch Changes
Format nested style tag content
Add Astro option: 'allow shorthand'
Typescript refactor
Add support for prettier options
0.0.9
13 Oct 2021Fix test macro 'PrettierMarkdown'
Add formatting for <Markdown> components
Support arbitrary attributes in style tags
Patch Changes
Fix test macro 'PrettierMarkdown'
Add formatting for <Markdown> components
Support arbitrary attributes in style tags
Add basic support for indented sass
Add new line at the end of the file
Add support for .sass formatting
Add support for prettier-ignore comments
0.0.8
4 Oct 2021Reading the note…
0.0.7
23 Sep 2021Upgrade prettier to ^2.4.1
0.0.6
22 Sep 2021Only updates a dependency:@astrojs/parser 0.15.0
0.0.1
22 Sep 2021Add @types/prettier for type support
prettier-plugin-astro
Patch Changes
Add @types/prettier for type support
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.