A Prettier plugin for formatting MDC (Markdown Components) syntax, as used in Nuxt Content. Current stable version is 0.2.1, released with bug fixes for extra newlines after frontmatter and fallback to mdast embed logic. Requires Prettier >=3.6.0. Ships TypeScript types. Differentiators: supports YAML front matter in components, nested components, GFM, and math syntax. Plugin must be added to Prettier config with the 'mdc' parser explicitly set via overrides. Works with .mdc and .md files.
npm install prettier-plugin-mdcVerified import paths — ran on the pinned version, not inferred.
Shows how to configure Prettier with the MDC plugin, including required overrides for parser, and example CLI usage.
Upgrade prettier to >=3.6.0
Add override: { files: ['*.md', '*.mdc'], options: { parser: 'mdc' } }Include desired file extensions in the files array of the override
Upgrade to v0.2.0+ for prettier 3.8 compatibility
Upgrade to v0.2.1+
npm install -D prettier-plugin-mdc
Add overrides with parser: 'mdc' in Prettier config
Use array: "overrides": [{ "files": ["*.md"], "options": { "parser": "mdc" } }]Set parser in config file, not CLI. Run prettier --write without --parser