@mdsvex/prettier-plugin weekly downloads statistics
By mdsvex · npm · Prettier plugins
Prettier plugin that formats mdsvex documents
@mdsvex/prettier-plugin has 1,447 recorded weekly downloads on npm, an increase of 586% over the past 30 days, ranking #1977 of 3,247 tracked listings.
About @mdsvex/prettier-plugin
@mdsvex/prettier-plugin
A Prettier plugin for mdsvex documents (.svx, .pfm).
pnpm add --save-dev prettier @mdsvex/prettier-plugin
// .prettierrc
{
"plugins": ["@mdsvex/prettier-plugin"]
}
Prettier picks the plugin for .svx and .pfm files from their extension, no overrides are needed.
What it formats
The plugin formats the Svelte in a document as prettier-plugin-svelte formats a component, and the markdown around it:
- a tag that does not fit on a line puts its attributes one to a line, values go in double quotes, a lone expression is unquoted and
name={name}becomes{name} - the children of an element, a component and a block such as
{#if}or{#each}are indented, markdown included - markdown as Prettier formats it:
-bullets, ordered lists counted from their start,#headings,---breaks, backtick fences, tables padded and aligned, a blank line between blocks and one space between words - a list item lines up with its content, a nested list sits at the content column of its item, and every line of a quote starts with
> - frontmatter is formatted as yaml, imports,
<script>and<style>as code - expressions,
{@html},{@render},{@const}and{@debug}tags and the heads of blocks are formatted, an expression or a tag in prose stays on its line - the content of an element such as
<p>that does not fit on its line moves to lines of its own, as svelte breaks it, unless markdown would then read it as a paragraph, as it does in a<div> - scripts move to the top and styles to the end as
svelteSortOrdersays, frontmatter and imports stay first, and<script>and<style>inside an element such as<svelte:head>are formatted too - blank lines between blocks fold to one and lines lose the spaces at their ends
The formatting follows your Prettier options, useTabs, singleQuote, bracketSameLine, singleAttributePerLine, proseWrap and the rest, and the svelteSortOrder and svelteIndentScriptAndStyle options of prettier-plugin-svelte, which this plugin also declares so they work without it. With proseWrap set to always a paragraph fills the line and with never it takes one line, a line end that keeps text from reading as a link, a list or a directive stays. Emphasis stays as PFM writes it, _ for emphasis and * for strong. A table that merges cells with ||, |> or |^ is kept as written. A part that does not parse is left as it is, so is the content of a <pre>.
Frontmatter
Frontmatter is formatted as yaml, unless your project parses it itself with the frontmatter.parse option of mdsvex. The plugin finds that out from the manifest the mdsvex vite plugin writes to node_modules/.mdsvex/manifest.json, looking up from each document as the language server does.
A project that runs Prettier before vite has written the manifest, in CI say, can set it with mdsvexFrontmatter:
| value | frontmatter |
|---|---|
"auto" | formatted as yaml unless the manifest says otherwise, the default |
"yaml" | always formatted as yaml |
"keep" | kept as written |
Frontmatter that does not parse as yaml is kept as written either way.
Leaving parts alone
A <!-- prettier-ignore --> comment keeps the block after it as it is written, or the next node when the comment sits in a paragraph or a list item:
<!-- prettier-ignore -->
{items.map((item)=>item.name)}
text <!-- prettier-ignore --> {a+b} and more
Everything between <!-- prettier-ignore-start --> and <!-- prettier-ignore-end --> at the top level of a document is kept as it is written.
<!-- @format --> or <!-- @prettier --> at the top of a document, or straight after its frontmatter, marks it for --require-pragma, and --insert-pragma writes <!-- @format --> there. <!-- @noformat --> leaves a document alone with --check-ignore-pragma.
Code fences
Code fences are left exactly as they are, their line ranges, annotations and [!eval] groups count the lines of the code. Turn on mdsvexFormatFences to format a fence whose info string is a language Prettier knows and nothing else:
{
"plugins": ["@mdsvex/prettier-plugin"],
"mdsvexFormatFences": true
}
A fence with meta (```js {1-3}), an annotation ([!hl]) or a markdown language is still left as it is, and so is a fence inside a list or a quote.
Description from the npm listing.
- mdsvex
- prettier
- prettier-plugin
- svx
- markdown
- svelte
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
7/30/90-day growth
Ranking history
Listing placement
Listing placement
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 (135)Similar npm Prettier plugins plugins
All 20 @mdsvex/prettier-plugin alternativesData 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/@mdsvex/prettier-plugin. First seen Nov 20, 2026; last successful collection Dec 6, 2026. See the methodology.