home / dev-tools / markdownlint-cli2

markdownlint-cli2

719

Markdown linting and auto-fix CLI for CommonMark files, docs repos, and content pipelines.

$npm install markdownlint-cli2 --global
Language
JavaScript
Stars
719
Category
Dev Tools
Agent
Ready
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis

markdownlint-cli2 lints Markdown and CommonMark files across repos using directory-based configuration and the markdownlint rule set. It is built for docs checks, editor formatting flows, and CI runs where you want to find or automatically fix Markdown style issues.

What It Enables
  • Lint Markdown files across a repo with glob patterns, nested config files, ignore rules, and custom rule or parser configuration.
  • Auto-fix supported issues in place with --fix, or format Markdown from stdin to stdout with --format for editor and pipeline workflows.
  • Emit machine-readable findings through configured formatter packages such as JSON, JUnit, SARIF, GitLab Code Quality, or summary reports.
Agent Fit
  • Non-interactive runs and clear 0/1/2 exit codes make inspect-edit-rerun verification loops straightforward.
  • Repo-level config discovery and --fix support make it useful for documentation cleanup, pre-commit checks, and CI enforcement.
  • Structured output exists, but not as a one-off --json flag; unattended setups need an outputFormatters config entry such as markdownlint-cli2-formatter-json.
Caveats
  • JSON and other report formats are configured through formatter modules, so automation usually needs a checked-in config file instead of an ad hoc flag.
  • Auto-fix only covers rules that emit fix information, so some findings still need manual or agent-authored edits.