Markdown Linting with VSCode markdownlint
This skill helps you configure, run and fix Markdown problems using the VSCode markdownlint extension only.
When to use this skill
- •You need a lightweight, editor-first Markdown linting workflow.
- •You want contributors to fix formatting inside VSCode before opening PRs.
- •You prefer to avoid adding CI/CLI dependencies for Markdown linting.
Setup (Using the plugin)
- •Install the VSCode extension:
markdownlintby David Anson. - •Add a workspace recommendation file
.vscode/extensions.jsonwith the extension id to encourage collaborators to install it.
Example .vscode/extensions.json:
json
{
"recommendations": [
"DavidAnson.vscode-markdownlint"
]
}
Configure rules
Place a repo-wide .markdownlint.json at the repository root so the plugin uses consistent rules across the team.
Example .markdownlint.json:
json
{
"default": true,
"MD013": { "line_length": 120 },
"MD029": false,
"MD041": false
}
Put editor-specific behavior in .vscode/settings.json:
json
{
"markdownlint.run": "onSave",
"markdownlint.config": {
"MD013": { "line_length": 120 },
"MD029": false
}
}
Running checks & fixing
- •The plugin runs in-editor; set
markdownlint.runtoonSaveoronType. - •To auto-fix supported problems, open the command palette and run
Markdownlint: Fix all. - •Document in CONTRIBUTING or PR template that contributors should run the plugin and fix all reported issues before opening PRs.
CI / Automation (limitations and guidance)
- •Limitation: VSCode extensions cannot run in standard CI runners—this skill intentionally avoids CLI tools.
- •Guidance: use a PR checklist or template to require local fixes.If strict CI blocking is later required,consider adding a lightweight CLI (e.g.,
markdownlint-cliorremark-lint) as a separate decision and job.
Best practices
- •Keep
.markdownlint.jsonin repo root for consistency. - •Recommend the extension via
.vscode/extensions.jsonso contributors get automatic prompts to install it. - •Use
onSaveto reduce noisy linting during typing. - •Prefer minimal rule overrides; document any relaxed rules in CONTRIBUTING.
Files you may add
- •
.vscode/extensions.json— recommendDavidAnson.vscode-markdownlint. - •
.vscode/settings.json— enablemarkdownlint.runand optional editor settings. - •
.markdownlint.json— repo ruleset.
Example PR template reminder
Add to PR template or CONTRIBUTING:
"I have run Markdownlint: Fix all in VSCode and verified there are no remaining lint errors."