When dozens of software engineers collaborate on open-source repositories or company documentation wikis, inconsistent formatting quickly creeps in: some developers use two spaces for lists, others use four; some leave blank lines around headings, others omit them; broken links and duplicate headings go unnoticed.
markdownlint and Prettier automate code style enforcement, catching errors before they reach production.
Click to Zoom
Markdown Documentation
1. What is markdownlint?
markdownlint is a static analysis tool that inspects Markdown files against a set of standardized quality rules. It is available as a VS Code extension, a Node.js CLI tool (markdownlint-cli), and a GitHub Action.
Top Common markdownlint Rules:
MD001 / heading-increment: Heading levels should only increment by one level at a time (e.g., cannot jump from # directly to ###).
MD009 / no-trailing-spaces: Disallows unintentional trailing whitespace at the ends of lines.
MD013 / line-length: Recommends wrapping lines at 80 or 120 characters for clean terminal viewing.
MD022 / blanks-around-headings: Headings must be surrounded by blank lines.
MD025 / single-title: A document should have only one top-level # H1 heading.
MD033 / no-inline-html: Flags raw HTML elements when strict pure-markdown compliance is desired.
2. Configuring markdownlint (.markdownlint.json)
You can customize or disable specific rules for your project by adding a .markdownlint.json configuration file in the project root: