Comparison With markdownlint Rules
eslint-plugin-markdown-preferences
does not aim for compatibility with markdownlint, but comparing rules is useful to check the strengths of each.
Also, by combining markdownlint and using each rule, you may be able to achieve the optimal Markdown style for you.eslint-plugin-markdown-preferences
is designed to provide useful features when used together with @eslint/markdown, so rules from @eslint/markdown are also compared.
Please note that each OSS is constantly evolving, so this list is not exhaustive.
Rules Related to Headings
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
Heading levels should only increment by one | MD001 heading-increment Heading levels should only increment by one level at a time | markdown/heading-increment Enforce heading levels increment by one | -- |
Level 1 Heading notation style | MD003 heading-style Heading style | -- | -- markdown-preferences/level1-heading-style enforce consistent style for level 1 headings |
Level 2 Heading notation style | MD003 heading-style Heading style | -- | markdown-preferences/level2-heading-style enforce consistent style for level 2 headings |
ATX heading closing # presence | MD003 heading-style Heading style | -- | markdown-preferences/atx-heading-closing-sequence enforce consistent use of closing sequence in ATX headings. |
ATX heading closing # length | markdown-preferences/atx-heading-closing-sequence-length enforce consistent length for the closing sequence (trailing #s) in ATX headings. | ||
Require space after ATX heading # | MD018 no-missing-space-atx No space after hash on atx style heading | markdown/no-missing-atx-heading-space Disallow headings without a space after the hash characters | -- |
Disallow multiple spaces after ATX heading # | MD019 no-multiple-space-atx Multiple spaces after hash on atx style heading | -- | markdown-preferences/no-multi-spaces disallow multiple spaces |
Require space before closing ATX heading # | MD020 no-missing-space-closed-atx No space inside hashes on closed atx style heading | -- | -- |
Disallow multiple spaces before closing ATX heading # | MD021 no-multiple-space-closed-atx Multiple spaces inside hashes on closed atx style heading | -- | markdown-preferences/no-multi-spaces disallow multiple spaces |
Require empty lines around headings | MD022 blanks-around-headings Headings should be surrounded by blank lines | -- | markdown-preferences/padding-line-between-blocks require or disallow padding lines between block elements |
Heading indentation | MD023 heading-start-left Headings must start at the beginning of the line | -- | -- |
Disallow duplicate headings | MD024 no-duplicate-heading Multiple headings with the same content | markdown/no-duplicate-headings Disallow duplicate headings in the same document | -- |
Limit to one <h1> heading | MD025 single-title/single-h1 Multiple top-level headings in the same document | markdown/no-multiple-h1 Disallow multiple H1 headings in the same document | -- |
Disallow trailing punctuation in headings | MD026 no-trailing-punctuation Trailing punctuation in heading | -- | -- |
Require emphasis-like headings to be real headings | MD036 no-emphasis-as-heading Emphasis used instead of a heading | -- | -- |
Require heading at the start of document | MD041 first-line-heading/first-line-h1 First line in a file should be a top-level heading | -- | -- |
Enforce preferred heading structure | MD043 required-headings Required heading structure | -- | -- |
Headings casing | -- | -- | markdown-preferences/heading-casing enforce consistent casing in headings |
Setext heading underline length | -- | -- | markdown-preferences/setext-heading-underline-length enforce consistent underline length. |
Rules Related to Lists
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
<ul> notation style | MD004 ul-style Unordered list style | -- | markdown-preferences/bullet-list-marker-style enforce consistent bullet list (unordered list) marker style |
List indentation | MD005 list-indent Inconsistent indentation for list items at the same level | -- | markdown-preferences/list-marker-alignment enforce consistent alignment of list markers |
<ul> indentation | MD007 ul-indent Unordered list indentation | -- | -- |
Enforce <ol> marker sequence | MD029 ol-prefix Ordered list item prefix | -- | markdown-preferences/ordered-list-marker-sequence enforce that ordered list markers use sequential numbers |
Enforce <ol> marker start | MD029 ol-prefix Ordered list item prefix | -- | markdown-preferences/ordered-list-marker-start enforce that ordered list markers start with 1 or 0 |
Enforce <ol> marker style | -- | markdown-preferences/ordered-list-marker-style enforce consistent ordered list marker style | |
Consistent spaces after list marker | MD030 list-marker-space Spaces after list markers | -- | -- |
Require empty lines around lists | MD032 blanks-around-lists Lists should be surrounded by blank lines | -- | markdown-preferences/padding-line-between-blocks require or disallow padding lines between block elements |
Rules Related to Links and Images
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
Disallow bare URLs | MD034 no-bare-urls Bare URL used | markdown/no-bare-urls Disallow bare URLs | markdown-preferences/prefer-autolinks enforce the use of autolinks for URLs |
Spaces around the text in links | MD039 no-space-in-links Spaces inside link text | -- | markdown-preferences/link-bracket-spacing enforce consistent spacing inside link brackets |
Disallow empty links | MD042 no-empty-links No empty links | markdown/no-empty-links Disallow empty links | -- |
Disallow empty images | -- | markdown/no-empty-images Disallow empty images | -- |
Enforce alt text for images | MD045 no-alt-text Images should have alternate text (alt text) | markdown/require-alt-text Require alternative text for images | -- |
Disallow missing reference for link fragments | MD051 link-fragments Link fragments should be valid | markdown/no-missing-link-fragments Disallow link fragments that do not reference valid headings | -- |
Disallow missing reference for links/images | MD052 reference-links-images Reference links and images should use a label that is defined | markdown/no-missing-label-refs Disallow missing label references | -- |
Link and image notation style | MD054 link-image-style Link and image style | -- | -- |
Require descriptive link text | MD059 descriptive-link-text Link text should be descriptive | -- | -- |
Enforce specific words to be links | -- | -- | markdown-preferences/prefer-linked-words enforce the specified word to be a link |
Spaces around the brackets in links/images | -- | -- | markdown-preferences/link-bracket-spacing enforce consistent spacing inside link brackets |
Newlines around the brackets in links/images | -- | -- | markdown-preferences/link-bracket-newline enforce linebreaks after opening and before closing link brackets |
Rules Related to Link Definitions and Footnote Definitions
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
Disallow unused link/image definitions | MD053 link-image-reference-definitions Link and image reference definitions should be needed | markdown/no-unused-definitions Disallow unused definitions | -- |
Enforce using link reference definitions | MD054 link-image-style Link and image style | -- | markdown-preferences/prefer-link-reference-definitions enforce using link reference definitions instead of inline links |
Disallow unused footnote definitions | -- | markdown/no-unused-definitions Disallow unused definitions | -- |
Disallow duplicate definitions | -- | markdown/no-duplicate-definitions Disallow duplicate definitions | -- |
Disallow empty definitions | -- | markdown/no-empty-definitions Disallow empty definitions | -- |
Require link/footnote definitions at end | -- | -- | markdown-preferences/definitions-last require link definitions and footnote definitions to be placed at the end of the document |
Enforce order of link/footnote definitions | -- | -- | markdown-preferences/sort-definitions enforce a specific order for link definitions and footnote definitions |
Spaces around the brackets in link definitions | -- | -- | markdown-preferences/link-bracket-spacing enforce consistent spacing inside link brackets |
Newlines around the brackets in link definitions | -- | -- | markdown-preferences/link-bracket-newline enforce linebreaks after opening and before closing link brackets |
Rules Related to Code & Fences
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
Disallow $ signs in shell code | MD014 commands-show-output Dollar signs used before commands without showing output | -- | -- |
Require empty lines around fenced code blocks | MD031 blanks-around-fences Fenced code blocks should be surrounded by blank lines | -- | markdown-preferences/padding-line-between-blocks require or disallow padding lines between block elements |
Spaces around the text in inline codes | MD038 no-space-in-code Spaces inside code span elements | -- | -- |
Fenced code blocks should have a language | MD040 fenced-code-language Fenced code blocks should have a language specified | markdown/fenced-code-language Require languages for fenced code blocks | -- |
Fenced code block style | MD046 code-block-style Code block style | -- | markdown-preferences/prefer-fenced-code-blocks enforce the use of fenced code blocks over indented code blocks |
Code fence style | MD048 code-fence-style Code fence style | -- | markdown-preferences/code-fence-style enforce a consistent code fence style (backtick or tilde) in Markdown fenced code blocks. |
Canonical code block language names | -- | -- | markdown-preferences/canonical-code-block-language enforce canonical language names in code blocks |
Code fence length | -- | -- | markdown-preferences/code-fence-length enforce consistent length for code fences in Markdown fenced code blocks |
Enforce specific words to be inline codes | -- | -- | markdown-preferences/prefer-inline-code-words enforce the use of inline code for specific words |
Rules Related to Blockquotes
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
Disallow multiple spaces after blockquote symbol | MD027 no-multiple-space-blockquote Multiple spaces after blockquote symbol | -- | -- |
Require empty lines around blockquotes | MD028 no-blanks-blockquote Blank line inside blockquote | -- | markdown-preferences/no-laziness-blockquotes disallow laziness in blockquotes |
Disallow laziness in blockquotes | -- | -- | markdown-preferences/no-laziness-blockquotes disallow laziness in blockquotes |
Blockquote marker alignment | -- | -- | markdown-preferences/blockquote-marker-alignment enforce consistent alignment of blockquote markers |
Rules Related to Tables
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
Table pipe style | MD055 table-pipe-style Table pipe style | -- | -- |
Table column count | MD056 table-column-count Table column count | markdown/table-column-count Disallow data rows in a table from having more cells than the header row | -- |
Require empty lines around tables | MD058 blanks-around-tables Tables should be surrounded by blank lines | -- | markdown-preferences/padding-line-between-blocks require or disallow padding lines between block elements |
Table header casing | -- | -- | markdown-preferences/table-header-casing enforce consistent casing in table header cells |
Rules Related to Emphasis and Strong Emphasis
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
Spaces around the text in emphasis | MD037 no-space-in-emphasis Spaces inside emphasis markers | markdown/no-space-in-emphasis Disallow spaces around emphasis markers | -- |
Emphasis notation style | MD049 emphasis-style Emphasis style | -- | markdown-preferences/emphasis-delimiters-style enforce a consistent delimiter style for emphasis and strong emphasis |
Strong emphasis notation style | MD050 strong-style Strong style | -- | markdown-preferences/emphasis-delimiters-style enforce a consistent delimiter style for emphasis and strong emphasis |
Strikethrough notation style | -- | -- | markdown-preferences/strikethrough-delimiters-style enforce a consistent delimiter style for strikethrough |
Rules Related to Thematic Breaks
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
<hr> notation style | MD035 hr-style Horizontal rule style | -- | markdown-preferences/thematic-break-character-style enforce a consistent character style for thematic breaks (horizontal rules) in Markdown |
<hr> length | -- | -- | markdown-preferences/thematic-break-length enforce consistent length for thematic breaks (horizontal rules) in Markdown |
<hr> sequence pattern | -- | -- | markdown-preferences/thematic-break-sequence-pattern enforce consistent sequence pattern for thematic breaks (horizontal rules) in Markdown |
Rules Related to HTML
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
Disallow inline HTML | MD033 no-inline-html Inline HTML | markdown/no-html Disallow HTML tags | -- |
Rules Related to Emoji
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
Emoji notation style | -- | -- | markdown-preferences/emoji-notation enforce consistent emoji notation style in Markdown files |
Rules Related to Whitespaces
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
Disallow trailing spaces | MD009 no-trailing-spaces Trailing spaces | -- | markdown-preferences/no-trailing-spaces disallow trailing whitespace at the end of lines in Markdown files |
Disallow hard tabs | MD010 no-hard-tabs Hard tabs | -- | -- |
Disallow multiple empty lines | MD012 no-multiple-blanks Multiple consecutive blank lines | -- | markdown-preferences/no-multiple-empty-lines disallow multiple empty lines in Markdown files |
Require linebreak at the end of files | MD047 single-trailing-newline Files should end with a single newline character | -- | -- |
Disallow multiple spaces | -- | -- | markdown-preferences/no-multi-spaces disallow multiple spaces |
Disallow trailing backslash linebreak | -- | -- | markdown-preferences/no-text-backslash-linebreak disallow text backslash at the end of a line |
Enforce hard linebreak style | -- | -- | markdown-preferences/hard-linebreak-style enforce consistent hard linebreak style |
Require or disallow padding lines between blocks | -- | -- | markdown-preferences/padding-line-between-blocks require or disallow padding lines between block elements |
Rules Related to Documents
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
Enforce a maximum line length | MD013 line-length Line length | -- | -- |
Proper names | MD044 proper-names Proper names should have the correct capitalization | -- | -- |
Rules Related to Syntax
Description | markdownlint Rules | @eslint/markdown Rules | eslint-plugin-markdown-preferences Rules |
---|---|---|---|
Disallow reversed link/image syntax | MD011 no-reversed-links Reversed link syntax | markdown/no-reversed-media-syntax Disallow reversed link and image syntax | -- |
Disallow invalid link label references | -- | markdown/no-invalid-label-refs Disallow invalid label references | -- |