LinuxCommandLibrary

markdownlint

TLDR

Lint Markdown file

$ markdownlint [file.md]
copy
Lint directory
$ markdownlint [docs/]
copy
Fix issues automatically
$ markdownlint --fix [file.md]
copy
Use config file
$ markdownlint --config [.markdownlint.json] [file.md]
copy
Ignore specific rules
$ markdownlint --disable [MD013] [MD033] -- [file.md]
copy
Output JSON format
$ markdownlint --json [file.md]
copy

SYNOPSIS

markdownlint [options] files...

DESCRIPTION

markdownlint is a style checker and linter for Markdown files. It enforces consistent Markdown formatting based on configurable rules.
The tool checks for issues like inconsistent heading styles, line length, trailing spaces, and proper list formatting.

PARAMETERS

-f, --fix

Fix issues automatically.
-c, --config file
Configuration file.
-d, --disable rules
Disable rules.
-e, --enable rules
Enable rules.
-i, --ignore pattern
Ignore files.
-o, --output file
Output file.
-j, --json
JSON output.

CONFIGURATION

$ // .markdownlint.json
{
  "MD013": { "line_length": 120 },
  "MD033": false,
  "MD041": false
}
copy

COMMON RULES

$ MD001 - Heading increment
MD013 - Line length
MD022 - Heading blank lines
MD033 - Inline HTML
copy

CAVEATS

CLI (markdownlint-cli) separate from library. Rules may conflict with some Markdown processors. Auto-fix limited to some rules.

HISTORY

markdownlint was created by David Anson as a Node.js library, with the CLI wrapper (markdownlint-cli) developed separately.

SEE ALSO

prettier(1), remark(1), markdown(1), vale(1)

Copied to clipboard