Skip to content
PluginStats

prettier-plugin-astro weekly downloads statistics

By withastro · npm · Prettier plugins

A Prettier Plugin for formatting Astro files

View on npm Fresh · Oct 18, 2026

prettier-plugin-astro has 772,320 recorded weekly downloads on npm, a decrease of 21.5% over the past 30 days, ranking #214 of 2,322 tracked listings.

Weekly downloads
772,320
Official API · Oct 18, 2026
7-day growth
-40.0%
-513.9K weekly downloads
30-day growth
-21.5%
-211.8K weekly downloads
90-day growth
-2.5%
-19.5K weekly downloads
Rank
#214
Among tracked npm listings

About prettier-plugin-astro

Prettier Plugin for Astro

Official Prettier plugin adding support for formatting .astro files.

Installation

First install Prettier and the plugin:

npm i --save-dev prettier prettier-plugin-astro
<details> <summary>Installation with pnpm</summary>
pnpm add --save-dev prettier prettier-plugin-astro
</details>

Then add the plugin to your Prettier configuration:

// .prettierrc.mjs
/** @type {import("prettier").Config} */
export default {
  plugins: ['prettier-plugin-astro'],
};
Recommended configuration

For optimal compatibility with the different package managers and Prettier plugins, we recommend manually specifying the parser to use for Astro files in your Prettier config as shown in the example below:

// .prettierrc.mjs
/** @type {import("prettier").Config} */
export default {
  plugins: ['prettier-plugin-astro'],
  overrides: [
    {
      files: '*.astro',
      options: {
        parser: 'astro',
      },
    },
  ],
};

To customize formatting behavior, see the Configuration section below.

Formatting with the VS Code Prettier extension directly

Note > The Astro VS Code extension uses Prettier and this plugin (prettier-plugin-astro) to format your code. You will only need to install this plugin separately for formatting if:

  • You are not using Astro's VS Code extension.
  • You want to use features of the Prettier extension that not supported by Astro's own VS Code extension, such as the toolbar panel showing Prettier's status.

Install the VS Code Prettier extension and add the following settings to your VS Code configuration:

{
  "prettier.documentSelectors": ["**/*.astro"],
  "[astro]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
}

The settings above ensure that VS Code is aware that Prettier can be used for Astro files, and sets Prettier as the default formatter for Astro files.

Reporting issues

When submitting issues about formatting your .astro files in VS Code, please specify which extension you are using to format your files: Astro's own extension or the Prettier extension.

Configuration

Most options from Prettier will work with the plugin and can be set in a configuration file or through CLI flags.

Astro Allow Shorthand

Controls formatting of matching identifier attributes (for example, <element name={name} /> and <element {name} />). When unset, the formatter preserves the input form. When true, it uses shorthand; when false, it uses the explicit form where possible.

DefaultCLI OverrideAPI Override
unset--astro-allow-shorthand <bool>astroAllowShorthand: <bool>
Astro Skip Frontmatter

If you are using another tool to format your JavaScript code, like Biome for example, it is possible to skip formatting the frontmatter.

DefaultCLI OverrideAPI Override
false--astro-skip-frontmatter <bool>astroSkipFrontmatter: <bool>
Astro Compress HTML

Mirror of compressHTML in astro.config.mjs. It tells the formatter which whitespace the compiler will collapse, so that reformatting a file never changes what it renders.

Astro's own default is 'jsx' (since Astro 7.0.0), where a whitespace run containing a newline is dropped and a same-line space is content. Set this to match your project if you have changed compressHTML; true and false are accepted as aliases for 'html' and 'none' so the value can be copied across verbatim.

DefaultCLI OverrideAPI Override
'jsx'--astro-compress-html <html|jsx|none>astroCompressHTML: "html" | "jsx" | "none"
Example .prettierrc.cjs
{
  astroAllowShorthand: false;
  astroSkipFrontmatter: false;
  astroCompressHTML: 'jsx';
}

Contributing

Pull requests of any size and any skill level are welcome, no contribution is too small. Changes to the Astro Prettier Plugin are subject to Astro Governance and should adhere to the Astro Style Guide.

See CONTRIBUTING.md for instructions on how to set up your development environment.

Sponsors

Astro is free, open source software made possible by these wonderful sponsors.

❤️ Sponsor Astro! ❤️

<p align="center"> <a target="_blank" href="https://github.com/sponsors/withastro"> <img alt="sponsors" src="https://astro.build/sponsors.png"> </a> </p>

Description from the npm listing.

  • prettier-plugin
  • prettier
  • astro
  • formatter

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

prettier-plugin-astro weekly downloads on npm, last 90 days: 772,320 weekly downloads as of Oct 18, 2026, -2.5% over 90 days.prettier-plugin-astroWeekly downloads on npm · Last 90 days772,320downloads / week-2.5% over 90 days0200K400K600K800K1M1.2M1.4M1.6MJul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekobservedarchived (Internet Archive)no observationsJul 22, 2026 – Oct 18, 2026 · 89 observations · Updated Oc…pluginstats.com
prettier-plugin-astro weekly downloads on npm, last 90 days: 772,320 weekly downloads as of Oct 18, 2026, -2.5% over 90 days.

7/30/90-day growth

prettier-plugin-astro weekly downloads growth on npm: -40.0% over 7 days, -21.5% over 30 days, -2.5% over 90 days.prettier-plugin-astroWeekly downloads growth on npm772,320downloads / week now7-day growth-513,882 weekly downloads-40.0%30-day growth-211,781 weekly downloads-21.5%90-day growth-19,534 weekly downloads-2.5%Growth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
prettier-plugin-astro weekly downloads growth on npm: -40.0% over 7 days, -21.5% over 30 days, -2.5% over 90 days.

Ranking history

prettier-plugin-astro npm ranking history: currently #214 (by weekly downloads).prettier-plugin-astronpm ranking · by weekly downloads · Last 90 days#214current rank#212#214#216#218#220#222#224#226#228#230Jul 22Aug 6Aug 21Sep 5Sep 20Oct 5Oct 20rankOct 18, 2026 – Oct 20, 2026 · 3 observations · Updated Oct 18, 2026pluginstats.com
prettier-plugin-astro npm ranking history: currently #214 (by weekly downloads).

Listing placement

All npm2,320 listings · 116 pages · 1,162 shown · page 11, #14 (overall #214)
All npm: every listing in weekly downloads order

Listing placement

Prettier plugins244 listings · 13 pages · page 1, #2 (overall #2)
Prettier plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (122)
Recent weekly downloads observations for prettier-plugin-astro
Date (UTC)Weekly downloadsChange vs. previous
772,320+162.9K
609,428-153.6K
763,068+7.1K
756,006-251.9K
1,007,954-252.9K
1,260,8310
1,260,831-25.4K
1,286,202-6.2K
1,292,400-2.4K
1,294,803+3.8K
1,290,974+3.9K
1,287,046-15.8K
1,302,869-249K
1,551,886—

Similar npm Prettier plugins plugins

All 20 prettier-plugin-astro alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/prettier-plugin-astro. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.