← 返回命令列表

Linux command

markdownlint 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Lint Markdown file

markdownlint [file.md]

Lint directory

markdownlint [docs/]

Fix issues automatically

markdownlint --fix [file.md]

Use config file

markdownlint --config [.markdownlint.json] [file.md]

Ignore specific rules

markdownlint --disable [MD013] [MD033] -- [file.md]

Output JSON format

markdownlint --json [file.md]

说明

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.

参数

-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.

FAQ

What is the markdownlint command used for?

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.

How do I run a basic markdownlint example?

Run `markdownlint [file.md]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f, --fix do in markdownlint?

Fix issues automatically.