Prettier plugin for formatting Marko template files. Current stable version is 4.0.9, released February 2026. This plugin is maintained by the Marko team and is the official formatter for Marko files. It supports both HTML-like and concise syntax, auto-detecting the syntax used. It integrates with Prettier's CLI and editor plugins. Breaking change in v4.0.0: text adjacent to tags now prints on the same line when possible. Requires prettier v3 or later; for prettier@2, use version 2.x. Ships TypeScript types and has active patch releases.
npm install prettier-plugin-markoVerified import paths — ran on the pinned version, not inferred.
Shows minimal setup: install packages, configure Prettier, create a Marko file, and format it.
If you rely on previous formatting with separate lines, update your code or consider using markoSyntax: 'concise' to avoid auto-detection.
Explicitly set markoSyntax option to 'html' or 'concise' in .prettierrc.
Use prettier@3+ with prettier-plugin-marko@4, or prettier@2 with prettier-plugin-marko@2.
Update to v4.0.5 or later to preserve $!{} placeholders.Update to v4.0.8+ to ensure static block positions are kept.
Run npm install --save-dev prettier-plugin-marko and ensure .prettierrc contains 'plugins': ['prettier-plugin-marko'].
Install locally: npm install --save-dev prettier-plugin-marko. If using global prettier, install plugin globally too: npm install -g prettier-plugin-marko.
Upgrade Prettier to v3+ or downgrade plugin to v2.
Update the plugin to the latest version: npm install prettier-plugin-marko@latest.