Visitar URL original
Releases · withastro/prettier-plugin-astro · GitHub
Skip to content

Releases: withastro/prettier-plugin-astro

v1.1.2

Choose a tag to compare

@github-actions github-actions released this 23 Oct 15:56
9819272

Patch Changes

  • 98d4164: Updates the Astro compiler to the latest release

v1.1.1

Choose a tag to compare

@github-actions github-actions released this 09 Oct 11:29
27ad3ef

Patch Changes

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

v1.1.0

Choose a tag to compare

@github-actions github-actions released this 24 Sep 20:33
12c5a89

Minor Changes

  • bfbb6c5: Adds support for three astroAllowShorthand formatting modes:

    • When unset / undefined, the attributes stay as written, i.e <Comp value={value} /> and <Comp {value} /> can co-exist in the same file.
    • When set to true, attributes that can be written in the shorthand form will automatically be transformed. <Comp value={value} /> will become <Comp {value} />
    • When set to false, attributes will always be expanded to their full form.

Patch Changes

  • 4b3547e: Fix non-idempotent indentation of multiline comments nested inside CSS rules.
  • edfb35f: Fixes raw elements being forcefully paired up when self-closed.

v1.0.1

Choose a tag to compare

@github-actions github-actions released this 17 Sep 02:05
9b339ef

Patch Changes

  • 5b5a735: Publish TypeScript declarations for Astro plugin options.
  • 6154471: 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.
  • fabb28f: Fix non-idempotent CSS <style> block formatting with astroCompressHTML set to 'html' or 'none'.

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 08 Sep 22:01
4632d1b

Major Changes

  • a8bf1a3: Raises the minimum supported Node version to 22.12.0.

  • 595d47f: 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.

v1.0.0-beta.2

v1.0.0-beta.2 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 04 Sep 15:38
2d7f419

Patch Changes

  • cc30d24: Fixes various formatting issues when using astroCompressHTML: 'html' or 'none':

    • Fixes a stray > being added after an empty or ignored element that is followed by a sibling.
    • Fixes closing tags being split from trailing void elements like <img>.
    • Fixes whitespace being added inside tables, lists, and captions under htmlWhitespaceSensitivity: 'strict'.
    • Fixes line breaks around inline elements being replaced by spaces.
    • Allows inline elements to wrap at the print width without adding rendered whitespace.
    • Keeps inline elements written on one line on that line.
    • Fixes components with dotted names like <Astro.self> losing their closing tags or failing to format.
    • Fixes whitespace around inline-block elements and reflowing markup written on one line.
    • Fixes quotes in style attribute values being written unescaped, corrupting the attribute and breaking the next format.
    • Fixes children hugging the closing bracket when an element's attributes span multiple lines.
    • Fixes whitespace being added around a lone <slot />, which stopped :empty from matching the container.
    • Fixes srcset values being mangled when a URL contains a comma, such as a data: URI or query string.
    • Lays out block-level elements like HTML.
    • Fixes whitespace being removed around a lone <slot />, which allowed :empty to start matching the container.
    • Fixes children hugging the closing bracket when an element's attributes wrap and allows a lone long attribute to wrap.
    • Formats style and srcset attributes.
    • Allows runs of adjacent inline elements to wrap at the print width without adding rendered whitespace.
    • Lays out graphical SVG contents one element per line.
    • Fixes nested markup being kept on one line.
    • Fixes spaces being removed from text directly inside <body>.
    • Fixes nested elements being collapsed onto a single line.
    • Fixes a blank line being left inside an opening tag whose attributes break.

v1.0.0-beta.1

v1.0.0-beta.1 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 18 Aug 10:35
6cff416

Major Changes

  • a8bf1a3: Raises the minimum supported Node version to 22.12.0.

Patch Changes

  • b0ec799: Fixes <script> tags being formatted as JavaScript instead of TypeScript
  • 04ecfe2: Fixes a crash on parenthesized types in template expressions

v1.0.0-beta.0

v1.0.0-beta.0 Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 14 Aug 16:26
badd37f

Major Changes

  • 595d47f: The plugin has been fully rewritten on top of Astro 7's new Rust compiler.

    Whitespace is now properly handled like Astro itself does, and a new astroCompressHTML option has been added to match Astro's compressHTML setting.

v0.14.1

Choose a tag to compare

@github-actions github-actions released this 16 Jul 16:01
1150195

Patch Changes

  • 7282bcb: Fixes an issue where style and script tags would sometimes get moved to other tags

v0.14.0

Choose a tag to compare

@github-actions github-actions released this 24 May 15:45
6d917b2

Minor Changes

  • bb756df: 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.