Enforce Markdown standards automatically: markdownlint catches rule violations, Prettier fixes formatting, and a CI step or pre-commit hook keeps every .md file consistent. Includes YAML frontmatter basics.
Commit the config at the repo root so editors, CI and teammates share one source of truth.
| Rule | Meaning |
|---|---|
| MD001 | Heading levels increase by one at a time |
| MD003 / MD018 | Consistent ATX headings, space after # |
| MD004 / MD007 | Consistent list markers and indentation |
| MD009 / MD012 | No trailing spaces, no multiple blank lines |
| MD013 | Line length |
| MD022 / MD031 / MD032 | Blank lines around headings, code blocks and lists |
| MD025 / MD041 | Single H1, first line is the H1 |
| MD034 | No bare URLs |
| MD040 | Code blocks have a language |
| MD045 | Images have alt text |
| MD047 | File ends with a single newline |
Docs sites and static-site generators (Docusaurus, Hugo, Jekyll, Astro) read optional YAML frontmatter at the very top of the file, between --- lines. GitHub renders it as a small table.
markdownlint-cli2 and prettier --check on every pull request.editorconfig with insert_final_newline = true and trim_trailing_whitespace = true (except for *.md lines that use two-space breaks)