Prettier Plugin โ
The Slidev's syntax may be incompatible with the default Markdown parser of Prettier. To solve this, Slidev provides a Prettier plugin to format your slides. You can use it with your favorite editor that supports Prettier.
1. Install โ
bash
npm i -D prettier prettier-plugin-slidevbash
pnpm i -D prettier prettier-plugin-slidevbash
yarn add -D prettier prettier-plugin-slidevbash
bun add -D prettier prettier-plugin-slidevbash
deno add -D npm:prettier npm:prettier-plugin-slidev2. Activate the plugin โ
Create or modify your prettier configuration file to activate the plugin:
json
{
  "overrides": [
    {
      "files": ["slides.md", "pages/*.md"],
      "options": {
        "parser": "slidev",
        "plugins": ["prettier-plugin-slidev"]
      }
    }
  ]
}Note that only specifying plugins is not enough, because Slidev and common Markdown files share the same file extension .md.