Static Analysis for Markdown

ankitg121 pts0 comments

markdownlint - npm

npm

Search<br>Sign UpSign In

markdownlint

0.41.0 • Public • Published 18 days ago<br>Readme<br>Code Beta<br>9 Dependencies<br>224 Dependents<br>79 Versions<br>markdownlint

A Node.js style checker and lint tool for Markdown/CommonMark files.

Install

npm install markdownlint --save-dev

Overview

The Markdown markup language is designed to be easy to read, write,<br>and understand. It succeeds - and its flexibility is both a benefit and a<br>drawback. Many styles are possible, so formatting can be inconsistent; some<br>constructs don't work well in all parsers and should be avoided.

markdownlint is a static analysis tool for<br>Node.js with a library of rules to enforce standards and consistency<br>for Markdown files. It was inspired by - and heavily influenced by - Mark<br>Harrison's markdownlint for Ruby. The initial rules, rule<br>documentation, and test cases came from that project.

markdownlint uses the micromark parser and honors the<br>CommonMark specification for Markdown. It additionally supports<br>popular GitHub Flavored Markdown (GFM) syntax like autolinks and tables<br>as well as directives, footnotes, and math syntax - all implemented by<br>micromark extensions. (Note that inline directives are<br>not supported to avoid confusion due to over-matching.)

Related

CLI

markdownlint-cli command-line interface for Node.js<br>(works with pre-commit)

markdownlint-cli2 command-line interface for Node.js<br>(works with pre-commit)

GitHub

GitHub Action for markdownlint-cli2

GitHub Super-Linter Action

GitHub Actions problem matcher for<br>markdownlint-cli

Editor

vscode-markdownlint extension for VS Code

Sublime Text markdownlint for Sublime Text

coc-markdownlint extension for Vim/Neovim

flymake-markdownlint-cli2 extension for Emacs

Tooling

eslint-plugin-markdownlint for the ESLint analyzer

grunt-markdownlint for the Grunt task runner

Cake.Markdownlint addin for Cake build automation system

Lombiq Node.js Extensions for MSBuild (.NET builds)

Ruby

markdownlint/mdl gem for Ruby

References

The following specifications are considered authoritative in cases of ambiguity:

CommonMark

GitHub Flavored Markdown Spec

Demonstration

markdownlint demo, an interactive, in-browser<br>playground for learning and exploring.

Rules / Aliases

MD001 heading-increment - Heading levels should only increment by one level at a time

MD003 heading-style - Heading style

MD004 ul-style - Unordered list style

MD005 list-indent - Inconsistent indentation for list items at the same level

MD007 ul-indent - Unordered list indentation

MD009 no-trailing-spaces - Trailing spaces

MD010 no-hard-tabs - Hard tabs

MD011 no-reversed-links - Reversed link syntax

MD012 no-multiple-blanks - Multiple consecutive blank lines

MD013 line-length - Line length

MD014 commands-show-output - Dollar signs used before commands without showing output

MD018 no-missing-space-atx - No space after hash on atx style heading

MD019 no-multiple-space-atx - Multiple spaces after hash on atx style heading

MD020 no-missing-space-closed-atx - No space inside hashes on closed atx style heading

MD021 no-multiple-space-closed-atx - Multiple spaces inside hashes on closed atx style heading

MD022 blanks-around-headings - Headings should be surrounded by blank lines

MD023 heading-start-left - Headings must start at the beginning of the line

MD024 no-duplicate-heading - Multiple headings with the same content

MD025 single-title/single-h1 - Multiple top-level headings in the same document

MD026 no-trailing-punctuation - Trailing punctuation in heading

MD027 no-multiple-space-blockquote - Multiple spaces after blockquote symbol

MD028 no-blanks-blockquote - Blank line inside blockquote

MD029 ol-prefix - Ordered list item prefix

MD030 list-marker-space - Spaces after list markers

MD031 blanks-around-fences - Fenced code blocks should be surrounded by blank lines

MD032 blanks-around-lists - Lists should be surrounded by blank lines

MD033 no-inline-html - Inline HTML

MD034 no-bare-urls - Bare URL used

MD035 hr-style - Horizontal rule style

MD036 no-emphasis-as-heading - Emphasis used instead of a heading

MD037 no-space-in-emphasis - Spaces inside emphasis markers

MD038 no-space-in-code - Spaces inside code span elements

MD039 no-space-in-links - Spaces inside link text

MD040 fenced-code-language - Fenced code blocks should have a language specified

MD041 first-line-heading/first-line-h1 - First line in a file should be a top-level heading

MD042 no-empty-links - No empty links

MD043 required-headings - Required heading structure

MD044 proper-names - Proper names should have the correct capitalization

MD045 no-alt-text - Images should have alternate text (alt text)

MD046 code-block-style - Code block style

MD047 single-trailing-newline - Files should end with a single newline character

MD048 code-fence-style - Code fence style

MD049 emphasis-style - Emphasis style

MD050 strong-style - Strong style

MD051 link-fragments - Link fragments should be valid

MD052...

markdownlint style heading code space multiple

Related Articles