Registry / devops / prettier-plugin-slidev

prettier-plugin-slidev

JSON →
library1.0.5jsnpmunverified

A Prettier plugin that formats Slidev markdown slides (slides.md, pages/*.md). Current stable version is 1.0.5, released as part of the official Slidev ecosystem. It uses a custom 'slidev' parser to handle Slidev-specific frontmatter, slide separators (---), and code block annotations. The plugin is released with the Slidev ecosystem, following minor version bumps as Slidev evolves. Key differentiator: it is the only dedicated formatter for Slidev slide files, ensuring consistent formatting for Slidev's markdown syntax without breaking slide structure.

npm install prettier-plugin-slidev
INSTALL
IMPORT
SIG · PRETTIER-PLUGIN-SL
P
prettier-plugin-slidev
devopsjavascriptv1.0.5
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
// Prettier config overrides { "files": ["slides.md", "pages/*.md"], "options": { "parser": "slidev", "plugins": ["prettier-plugin-slidev"] } }
// Wrong: using require('prettier-plugin-slidev') in JS config module.exports = { plugins: [require('prettier-plugin-slidev')] }
Prettier plugins must be specified in the config file as plugin names (strings), not loaded via require. The plugin is activated only for .md files that use Slidev syntax.

Install the plugin, configure Prettier to use the slidev parser for Slidev markdown files, and format a slides.md file.

npm i -D prettier prettier-plugin-slidev # .prettierrc.json { "overrides": [ { "files": ["slides.md", "pages/*.md"], "options": { "parser": "slidev", "plugins": ["prettier-plugin-slidev"] } } ] } # Then run: npx prettier --write slides.md
Debug
Known issues
gotchaThe plugin only works with Prettier v3.2.4 or later.
fix
Upgrade Prettier to ^3.2.4
affects: >=1.0.0
gotchaOnly files named 'slides.md' or in 'pages/*.md' are recognized as Slidev files by default.
fix
Adjust the 'files' glob in the override if you use different file names.
affects: >=1.0.0
gotchaSimply adding the plugin to 'plugins' without specifying 'parser: "slidev"' will not work because .md files default to the markdown parser.
fix
Always include 'parser: "slidev"' in the override options.
affects: >=1.0.0
gotchaDo not use this plugin with other Prettier markdown plugins (e.g., prettier-plugin-md) as they may conflict.
fix
Remove other markdown-related Prettier plugins when using this one.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'prettier-plugin-slidev'
The plugin is not installed or not in the same node_modules as Prettier (global vs local).
fix
Install as a dev dependency: npm i -D prettier prettier-plugin-slidev
Unexpected token '-' in file slides.md
Prettier is using the 'markdown' parser instead of 'slidev' parser, causing it to choke on Slidev-specific syntax like frontmatter '---' or slide separators.
fix
Add the override with parser: 'slidev' as shown in the configuration.
Invalid configuration file: plugins must be a string or an array of strings
Using require() to load the plugin in the config file, but Prettier expects plugin names as strings.
fix
Set plugins to ["prettier-plugin-slidev"] in the config (JSON or YAML).
Upgrade
Version history
1.0.5latest on npm
Audit
Dependencies
prettierrequiredpeer dependency, required as the formatting engine
Agent activity
33 hits · last 30 days
node
32
Bingbot
1
Resources
prettier-plugin-slidev — npm install prettier-plugin-slidev · libregistry