Packages

prettier-plugin-astro

1.1.2 · 23 Oct 2026MIT1.7M / weekRepositoryHomepagenpmAtom feed

Your version

45 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 1.x · latest line
  2. 1.1.2

    23 Oct 2026
    • Updates the Astro compiler to the latest release

  3. 1.1.1

    9 Oct 2026
    • Fixes a TypeError ("Cannot read properties of undefined (reading 'semi')") when a comment appears before a statement inside a template expression.

  4. 1.1.0

    24 Sep 2026
    • Adds support for three astroAllowShorthand formatting modes:

    • Fix non-idempotent indentation of multiline comments nested inside CSS rules.

    • Fixes raw elements being forcefully paired up when self-closed.

  5. 1.0.1

    17 Sep 2026
    • Publish 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 with astroCompressHTML set to 'html' or 'none'.

  6. 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 astroCompressHTML option has been added to match Astro's compressHTML setting. If you set compressHTML in your Astro config, also set astroCompressHTML in 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.

  7. 0.14.x
  8. 0.14.1

    16 Jul 2024
    • Fixes an issue where style and script tags would sometimes get moved to other tags

  9. 0.14.0

    24 May 2024
    • Adds a new option called astroSkipFrontmatter to disable formatting the frontmatter. This can be useful when using other tools to format the frontmatter, such as Biome or dprint.

  10. 0.13.x
  11. 0.13.0

    19 Jan 2024
    • Fix plugin sometimes including significant whitespace inside components, fragments and custom elements

  12. 0.12.x
  13. 0.12.3

    27 Dec 2023
    • Fix <br /> tags sometimes causing additional spaces to appear

    • Fix not being able to format expressions with more than 2 roots

  14. 0.12.2

    13 Nov 2023
    • Fix attributes using optional chaining not formatting correctly

  15. 0.12.1

    25 Oct 2023
    • Fix attributes with multiple invalid JSX characters in their key inside expressions causing the plugin to throw an error

  16. 0.12.0

    22 Aug 2023
    • Do not delete line breaks and indentation of lines in class attribute

    • Format doctype as lowercase to match Prettier 3.0

  17. 0.11.x
  18. 0.11.1

    15 Aug 2023
    • Removes pnpm from engines

  19. 0.11.0

    12 Jul 2023
    • Migrated 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.

  20. 0.10.x
  21. 0.10.0

    1 Jun 2023
    • Use the sync entrypoint of the Astro compiler instead of synckit, improving performance and reducing the dependency count of the plugin

  22. 0.9.x
  23. 0.9.1

    26 May 2023
    • Prevent parsing empty script tags

  24. 0.9.0

    19 May 2023
    • Use 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

  25. 0.8.x
  26. 0.8.1

    11 May 2023
    • Add 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

  27. 0.8.0

    26 Jan 2023
    • Add support for LESS style tags, fixed crash on style tags with unknown languages

    • Add support for formatting spread attributes

  28. 0.7.x
  29. 0.7.2

    4 Jan 2023
    • Fix packaging error causing the plugin to only be installable using pnpm

  30. 0.7.1

    3 Jan 2023
    • Fix inline tags not hugging the end of their content if the last child was a tag

  31. 0.7.0

    28 Oct 2022
    • Fixed 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

  32. 0.6.x
  33. 0.6.0

    17 Oct 2022
    • Allow elements with set:* directives to self-close

    • Fix jsxSingleQuote not considering if there was any incompatible characters inside the attribute value

    • Fix style tags getting moved inside body tags
      Fix fragments with expressions inside being moved to before the expressions in certain cases

  34. 0.5.x
  35. 0.5.5

    29 Sep 2022
    • Fix 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

  36. 0.5.4

    31 Aug 2022
    • Support formatting expressions with elements with attributes not compatible with JSX

  37. 0.5.3

    23 Aug 2022
    • Update to latest version of the compiler

  38. 0.5.2

    23 Aug 2022
    • End tag hugs text nodes not ending in whitespace

    • Correctly break self-closing tags

  39. 0.5.1

    22 Aug 2022
    • Fix TypeScript not working inside expressions

  40. 0.5.0

    10 Aug 2022
    • Properly format multi-lines expressions, fixes expression with leading comments not being formatted properly

  41. 0.4.x
  42. 0.4.1

    8 Aug 2022
    • Properly trim the class attribute on HTML elements

  43. 0.4.0

    8 Aug 2022
    • Fix 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

  44. 0.3.x
  45. 0.3.0

    4 Aug 2022
    • Update 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

  46. 0.2.x
  47. 0.2.0

    29 Jul 2022
    • Removed

      Remove support for the Markdown component

  48. 0.1.x
  49. 0.1.3

    29 Jul 2022
    • Use Prettier option: 'singleAttributePerLine'

  50. 0.1.2

    21 Jul 2022
    • 9eddad9: Use prettier option 'semi' for jsx semi colons

    • 0cf8f08: HTML attribute quotes now depend on jsxSingleQuote option

    • 9ae7efa: Self-close slots

  51. 0.1.1

    24 Jun 2022
    • Fix for jsx empty expression

  52. 0.1.0

    24 Jun 2022
    • Migrate 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!

  53. 0.0.x
  54. 0.0.12

    23 Jan 2022
    • Fix a bug in "allow shorthand" option

    • Fix comment error when nested

    • Format html using only the plugin itself

  55. 0.0.11

    24 Nov 2021
    • Bump ava

    • Format spread operator

    • Format markdown component content

  56. 0.0.10

    9 Nov 2021
    • Format nested style tag content

    • Add Astro option: 'allow shorthand'

    • Typescript refactor

  57. 0.0.9

    13 Oct 2021
    • Fix test macro 'PrettierMarkdown'

    • Add formatting for <Markdown> components

    • Support arbitrary attributes in style tags

  58. 0.0.8

    4 Oct 2021

    Reading the note…

  59. 0.0.7

    23 Sep 2021
    • Upgrade prettier to ^2.4.1

  60. 0.0.6

    22 Sep 2021

    Only updates a dependency:@astrojs/parser 0.15.0

  61. 0.0.1

    22 Sep 2021
    • 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.