mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Configure all rules that allow style=consistent (or similar) to require an explicit style for consistency across the project.
This commit is contained in:
parent
bb1c4d4ee6
commit
2e63bf7dd8
33 changed files with 149 additions and 117 deletions
|
@ -1,10 +1,36 @@
|
||||||
{
|
{
|
||||||
|
"code-block-style": {
|
||||||
|
"style": "fenced"
|
||||||
|
},
|
||||||
|
"code-fence-style": {
|
||||||
|
"style": "backtick"
|
||||||
|
},
|
||||||
|
"emphasis-style": {
|
||||||
|
"style": "asterisk"
|
||||||
|
},
|
||||||
|
"fenced-code-language": {
|
||||||
|
"allowed_languages": [
|
||||||
|
"javascript",
|
||||||
|
"json",
|
||||||
|
"markdown"
|
||||||
|
],
|
||||||
|
"language_only": true
|
||||||
|
},
|
||||||
|
"heading-style": {
|
||||||
|
"style": "atx"
|
||||||
|
},
|
||||||
|
"hr-style": {
|
||||||
|
"style": "---"
|
||||||
|
},
|
||||||
"line-length": {
|
"line-length": {
|
||||||
"strict": true
|
"strict": true
|
||||||
},
|
},
|
||||||
"no-duplicate-heading": {
|
"no-duplicate-heading": {
|
||||||
"siblings_only": true
|
"siblings_only": true
|
||||||
},
|
},
|
||||||
|
"ol-prefix": {
|
||||||
|
"style": "ordered"
|
||||||
|
},
|
||||||
"proper-names": {
|
"proper-names": {
|
||||||
"code_blocks": false,
|
"code_blocks": false,
|
||||||
"names": [
|
"names": [
|
||||||
|
@ -16,5 +42,11 @@
|
||||||
"markdownlint",
|
"markdownlint",
|
||||||
"Node.js"
|
"Node.js"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"strong-style": {
|
||||||
|
"style": "asterisk"
|
||||||
|
},
|
||||||
|
"ul-style": {
|
||||||
|
"style": "dash"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ for (const rule of rules) {
|
||||||
JSON.stringify(propData.default) :
|
JSON.stringify(propData.default) :
|
||||||
propData.default;
|
propData.default;
|
||||||
const allValues = propData.enum?.sort();
|
const allValues = propData.enum?.sort();
|
||||||
const listItem = `* \`${property}\`: ${propData.description} (` +
|
const listItem = `- \`${property}\`: ${propData.description} (` +
|
||||||
`\`${propType}\`, default \`${defaultValue}\`` +
|
`\`${propType}\`, default \`${defaultValue}\`` +
|
||||||
(propData.enum ?
|
(propData.enum ?
|
||||||
`, values ${allValues.map((value) => `\`${value}\``).join(" / ")}` :
|
`, values ${allValues.map((value) => `\`${value}\``).join(" / ")}` :
|
||||||
|
|
|
@ -9,7 +9,7 @@ unnecessary:
|
||||||
|
|
||||||
1. If a label is not referenced by any link or image in a document, that
|
1. If a label is not referenced by any link or image in a document, that
|
||||||
definition is unused and can be deleted.
|
definition is unused and can be deleted.
|
||||||
1. If a label is defined multiple times in a document, the first definition is
|
2. If a label is defined multiple times in a document, the first definition is
|
||||||
used and the others can be deleted.
|
used and the others can be deleted.
|
||||||
|
|
||||||
This rule considers a reference definition to be used if any link or image
|
This rule considers a reference definition to be used if any link or image
|
||||||
|
@ -21,6 +21,6 @@ be ignored by setting the `ignored_definitions` parameter. The default value of
|
||||||
this parameter ignores the following convention for adding non-HTML comments to
|
this parameter ignores the following convention for adding non-HTML comments to
|
||||||
Markdown:
|
Markdown:
|
||||||
|
|
||||||
```md
|
```markdown
|
||||||
[//]: # (This behaves like a comment)
|
[//]: # (This behaves like a comment)
|
||||||
```
|
```
|
||||||
|
|
|
@ -16,7 +16,7 @@ the parsed input and a function to log any violations.
|
||||||
|
|
||||||
A simple rule implementation looks like:
|
A simple rule implementation looks like:
|
||||||
|
|
||||||
```js
|
```javascript
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"names": [ "any-blockquote" ],
|
"names": [ "any-blockquote" ],
|
||||||
"description": "Rule that reports an error for any blockquote",
|
"description": "Rule that reports an error for any blockquote",
|
||||||
|
|
110
doc/Rules.md
110
doc/Rules.md
|
@ -57,7 +57,7 @@ Aliases: `first-header-h1`, `first-heading-h1`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `level`: Heading level (`integer`, default `1`)
|
- `level`: Heading level (`integer`, default `1`)
|
||||||
|
|
||||||
> Note: *MD002 has been deprecated and is disabled by default.*
|
> Note: *MD002 has been deprecated and is disabled by default.*
|
||||||
> [MD041/first-line-heading](md041.md) offers an improved implementation.
|
> [MD041/first-line-heading](md041.md) offers an improved implementation.
|
||||||
|
@ -95,7 +95,7 @@ Aliases: `header-style`, `heading-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: Heading style (`string`, default `consistent`, values `atx` /
|
- `style`: Heading style (`string`, default `consistent`, values `atx` /
|
||||||
`atx_closed` / `consistent` / `setext` / `setext_with_atx` /
|
`atx_closed` / `consistent` / `setext` / `setext_with_atx` /
|
||||||
`setext_with_atx_closed`)
|
`setext_with_atx_closed`)
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ Aliases: `ul-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: List style (`string`, default `consistent`, values `asterisk` /
|
- `style`: List style (`string`, default `consistent`, values `asterisk` /
|
||||||
`consistent` / `dash` / `plus` / `sublist`)
|
`consistent` / `dash` / `plus` / `sublist`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
@ -305,10 +305,10 @@ Aliases: `ul-indent`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `indent`: Spaces for indent (`integer`, default `2`)
|
- `indent`: Spaces for indent (`integer`, default `2`)
|
||||||
* `start_indent`: Spaces for first level indent (when start_indented is set)
|
- `start_indent`: Spaces for first level indent (when start_indented is set)
|
||||||
(`integer`, default `2`)
|
(`integer`, default `2`)
|
||||||
* `start_indented`: Whether to indent the first level of the list (`boolean`,
|
- `start_indented`: Whether to indent the first level of the list (`boolean`,
|
||||||
default `false`)
|
default `false`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
@ -363,10 +363,10 @@ Aliases: `no-trailing-spaces`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `br_spaces`: Spaces for line break (`integer`, default `2`)
|
- `br_spaces`: Spaces for line break (`integer`, default `2`)
|
||||||
* `list_item_empty_lines`: Allow spaces for empty lines in list items
|
- `list_item_empty_lines`: Allow spaces for empty lines in list items
|
||||||
(`boolean`, default `false`)
|
(`boolean`, default `false`)
|
||||||
* `strict`: Include unnecessary breaks (`boolean`, default `false`)
|
- `strict`: Include unnecessary breaks (`boolean`, default `false`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
@ -417,10 +417,10 @@ Aliases: `no-hard-tabs`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `code_blocks`: Include code blocks (`boolean`, default `true`)
|
- `code_blocks`: Include code blocks (`boolean`, default `true`)
|
||||||
* `ignore_code_languages`: Fenced code languages to ignore (`string[]`, default
|
- `ignore_code_languages`: Fenced code languages to ignore (`string[]`, default
|
||||||
`[]`)
|
`[]`)
|
||||||
* `spaces_per_tab`: Number of spaces for each hard tab (`integer`, default `1`)
|
- `spaces_per_tab`: Number of spaces for each hard tab (`integer`, default `1`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
@ -509,7 +509,7 @@ Aliases: `no-multiple-blanks`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `maximum`: Consecutive blank lines (`integer`, default `1`)
|
- `maximum`: Consecutive blank lines (`integer`, default `1`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
@ -550,17 +550,17 @@ Aliases: `line-length`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `code_block_line_length`: Number of characters for code blocks (`integer`,
|
- `code_block_line_length`: Number of characters for code blocks (`integer`,
|
||||||
default `80`)
|
default `80`)
|
||||||
* `code_blocks`: Include code blocks (`boolean`, default `true`)
|
- `code_blocks`: Include code blocks (`boolean`, default `true`)
|
||||||
* `headers`: Include headings (`boolean`, default `true`)
|
- `headers`: Include headings (`boolean`, default `true`)
|
||||||
* `heading_line_length`: Number of characters for headings (`integer`, default
|
- `heading_line_length`: Number of characters for headings (`integer`, default
|
||||||
`80`)
|
`80`)
|
||||||
* `headings`: Include headings (`boolean`, default `true`)
|
- `headings`: Include headings (`boolean`, default `true`)
|
||||||
* `line_length`: Number of characters (`integer`, default `80`)
|
- `line_length`: Number of characters (`integer`, default `80`)
|
||||||
* `stern`: Stern length checking (`boolean`, default `false`)
|
- `stern`: Stern length checking (`boolean`, default `false`)
|
||||||
* `strict`: Strict length checking (`boolean`, default `false`)
|
- `strict`: Strict length checking (`boolean`, default `false`)
|
||||||
* `tables`: Include tables (`boolean`, default `true`)
|
- `tables`: Include tables (`boolean`, default `true`)
|
||||||
|
|
||||||
> If `headings` is not provided, `headers` (deprecated) will be used.
|
> If `headings` is not provided, `headers` (deprecated) will be used.
|
||||||
|
|
||||||
|
@ -797,8 +797,8 @@ Aliases: `blanks-around-headers`, `blanks-around-headings`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `lines_above`: Blank lines above heading (`integer`, default `1`)
|
- `lines_above`: Blank lines above heading (`integer`, default `1`)
|
||||||
* `lines_below`: Blank lines below heading (`integer`, default `1`)
|
- `lines_below`: Blank lines below heading (`integer`, default `1`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
@ -875,9 +875,9 @@ Aliases: `no-duplicate-header`, `no-duplicate-heading`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `allow_different_nesting`: Only check sibling headings (`boolean`, default
|
- `allow_different_nesting`: Only check sibling headings (`boolean`, default
|
||||||
`false`)
|
`false`)
|
||||||
* `siblings_only`: Only check sibling headings (`boolean`, default `false`)
|
- `siblings_only`: Only check sibling headings (`boolean`, default `false`)
|
||||||
|
|
||||||
This rule is triggered if there are multiple headings in the document that have
|
This rule is triggered if there are multiple headings in the document that have
|
||||||
the same text:
|
the same text:
|
||||||
|
@ -925,9 +925,9 @@ Aliases: `single-h1`, `single-title`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `front_matter_title`: RegExp for matching title in front matter (`string`,
|
- `front_matter_title`: RegExp for matching title in front matter (`string`,
|
||||||
default `^\s*title\s*[:=]`)
|
default `^\s*title\s*[:=]`)
|
||||||
* `level`: Heading level (`integer`, default `1`)
|
- `level`: Heading level (`integer`, default `1`)
|
||||||
|
|
||||||
This rule is triggered when a top-level heading is in use (the first line of
|
This rule is triggered when a top-level heading is in use (the first line of
|
||||||
the file is an h1 heading), and more than one h1 heading is in use in the
|
the file is an h1 heading), and more than one h1 heading is in use in the
|
||||||
|
@ -977,7 +977,7 @@ Aliases: `no-trailing-punctuation`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `punctuation`: Punctuation characters not allowed at end of headings
|
- `punctuation`: Punctuation characters not allowed at end of headings
|
||||||
(`string`, default `.,;:!。,;:!`)
|
(`string`, default `.,;:!。,;:!`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
@ -1091,7 +1091,7 @@ Aliases: `ol-prefix`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: List style (`string`, default `one_or_ordered`, values `one` /
|
- `style`: List style (`string`, default `one_or_ordered`, values `one` /
|
||||||
`one_or_ordered` / `ordered` / `zero`)
|
`one_or_ordered` / `ordered` / `zero`)
|
||||||
|
|
||||||
This rule is triggered for ordered lists that do not either start with '1.' or
|
This rule is triggered for ordered lists that do not either start with '1.' or
|
||||||
|
@ -1192,12 +1192,12 @@ Aliases: `list-marker-space`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `ol_multi`: Spaces for multi-line ordered list items (`integer`, default `1`)
|
- `ol_multi`: Spaces for multi-line ordered list items (`integer`, default `1`)
|
||||||
* `ol_single`: Spaces for single-line ordered list items (`integer`, default
|
- `ol_single`: Spaces for single-line ordered list items (`integer`, default
|
||||||
`1`)
|
`1`)
|
||||||
* `ul_multi`: Spaces for multi-line unordered list items (`integer`, default
|
- `ul_multi`: Spaces for multi-line unordered list items (`integer`, default
|
||||||
`1`)
|
`1`)
|
||||||
* `ul_single`: Spaces for single-line unordered list items (`integer`, default
|
- `ul_single`: Spaces for single-line unordered list items (`integer`, default
|
||||||
`1`)
|
`1`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
@ -1277,7 +1277,7 @@ Aliases: `blanks-around-fences`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `list_items`: Include list items (`boolean`, default `true`)
|
- `list_items`: Include list items (`boolean`, default `true`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
@ -1371,7 +1371,7 @@ Aliases: `no-inline-html`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `allowed_elements`: Allowed elements (`string[]`, default `[]`)
|
- `allowed_elements`: Allowed elements (`string[]`, default `[]`)
|
||||||
|
|
||||||
This rule is triggered whenever raw HTML is used in a Markdown document:
|
This rule is triggered whenever raw HTML is used in a Markdown document:
|
||||||
|
|
||||||
|
@ -1448,7 +1448,7 @@ Aliases: `hr-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: Horizontal rule style (`string`, default `consistent`)
|
- `style`: Horizontal rule style (`string`, default `consistent`)
|
||||||
|
|
||||||
This rule is triggered when inconsistent styles of horizontal rules are used
|
This rule is triggered when inconsistent styles of horizontal rules are used
|
||||||
in the document:
|
in the document:
|
||||||
|
@ -1493,7 +1493,7 @@ Aliases: `no-emphasis-as-header`, `no-emphasis-as-heading`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `punctuation`: Punctuation characters (`string`, default `.,;:!?。,;:!?`)
|
- `punctuation`: Punctuation characters (`string`, default `.,;:!?。,;:!?`)
|
||||||
|
|
||||||
This check looks for instances where emphasized (i.e. bold or italic) text is
|
This check looks for instances where emphasized (i.e. bold or italic) text is
|
||||||
used to separate sections, where a heading should be used instead:
|
used to separate sections, where a heading should be used instead:
|
||||||
|
@ -1646,8 +1646,8 @@ Aliases: `fenced-code-language`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `allowed_languages`: List of languages (`string[]`, default `[]`)
|
- `allowed_languages`: List of languages (`string[]`, default `[]`)
|
||||||
* `language_only`: Require language only (`boolean`, default `false`)
|
- `language_only`: Require language only (`boolean`, default `false`)
|
||||||
|
|
||||||
This rule is triggered when fenced code blocks are used, but a language isn't
|
This rule is triggered when fenced code blocks are used, but a language isn't
|
||||||
specified:
|
specified:
|
||||||
|
@ -1701,9 +1701,9 @@ Aliases: `first-line-h1`, `first-line-heading`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `front_matter_title`: RegExp for matching title in front matter (`string`,
|
- `front_matter_title`: RegExp for matching title in front matter (`string`,
|
||||||
default `^\s*title\s*[:=]`)
|
default `^\s*title\s*[:=]`)
|
||||||
* `level`: Heading level (`integer`, default `1`)
|
- `level`: Heading level (`integer`, default `1`)
|
||||||
|
|
||||||
This rule is intended to ensure documents have a title and is triggered when
|
This rule is intended to ensure documents have a title and is triggered when
|
||||||
the first line in the file isn't a top-level (h1) heading:
|
the first line in the file isn't a top-level (h1) heading:
|
||||||
|
@ -1788,9 +1788,9 @@ Aliases: `required-headers`, `required-headings`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `headers`: List of headings (`string[]`, default `[]`)
|
- `headers`: List of headings (`string[]`, default `[]`)
|
||||||
* `headings`: List of headings (`string[]`, default `[]`)
|
- `headings`: List of headings (`string[]`, default `[]`)
|
||||||
* `match_case`: Match case of headings (`boolean`, default `false`)
|
- `match_case`: Match case of headings (`boolean`, default `false`)
|
||||||
|
|
||||||
> If `headings` is not provided, `headers` (deprecated) will be used.
|
> If `headings` is not provided, `headers` (deprecated) will be used.
|
||||||
|
|
||||||
|
@ -1863,9 +1863,9 @@ Aliases: `proper-names`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `code_blocks`: Include code blocks (`boolean`, default `true`)
|
- `code_blocks`: Include code blocks (`boolean`, default `true`)
|
||||||
* `html_elements`: Include HTML elements (`boolean`, default `true`)
|
- `html_elements`: Include HTML elements (`boolean`, default `true`)
|
||||||
* `names`: List of proper names (`string[]`, default `[]`)
|
- `names`: List of proper names (`string[]`, default `[]`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
@ -1938,7 +1938,7 @@ Aliases: `code-block-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: Block style (`string`, default `consistent`, values `consistent` /
|
- `style`: Block style (`string`, default `consistent`, values `consistent` /
|
||||||
`fenced` / `indented`)
|
`fenced` / `indented`)
|
||||||
|
|
||||||
This rule is triggered when unwanted or different code block styles are used in
|
This rule is triggered when unwanted or different code block styles are used in
|
||||||
|
@ -2018,7 +2018,7 @@ Aliases: `code-fence-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: Code fence style (`string`, default `consistent`, values `backtick`
|
- `style`: Code fence style (`string`, default `consistent`, values `backtick`
|
||||||
/ `consistent` / `tilde`)
|
/ `consistent` / `tilde`)
|
||||||
|
|
||||||
This rule is triggered when the symbols used in the document for fenced code
|
This rule is triggered when the symbols used in the document for fenced code
|
||||||
|
@ -2062,7 +2062,7 @@ Aliases: `emphasis-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: Emphasis style should be consistent (`string`, default `consistent`,
|
- `style`: Emphasis style should be consistent (`string`, default `consistent`,
|
||||||
values `asterisk` / `consistent` / `underscore`)
|
values `asterisk` / `consistent` / `underscore`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
@ -2097,7 +2097,7 @@ Aliases: `strong-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: Strong style should be consistent (`string`, default `consistent`,
|
- `style`: Strong style should be consistent (`string`, default `consistent`,
|
||||||
values `asterisk` / `consistent` / `underscore`)
|
values `asterisk` / `consistent` / `underscore`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
@ -2219,7 +2219,7 @@ Aliases: `link-image-reference-definitions`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `ignored_definitions`: Ignored definitions (`string[]`, default `["//"]`)
|
- `ignored_definitions`: Ignored definitions (`string[]`, default `["//"]`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
@ -2234,7 +2234,7 @@ unnecessary:
|
||||||
|
|
||||||
1. If a label is not referenced by any link or image in a document, that
|
1. If a label is not referenced by any link or image in a document, that
|
||||||
definition is unused and can be deleted.
|
definition is unused and can be deleted.
|
||||||
1. If a label is defined multiple times in a document, the first definition is
|
2. If a label is defined multiple times in a document, the first definition is
|
||||||
used and the others can be deleted.
|
used and the others can be deleted.
|
||||||
|
|
||||||
This rule considers a reference definition to be used if any link or image
|
This rule considers a reference definition to be used if any link or image
|
||||||
|
@ -2246,7 +2246,7 @@ be ignored by setting the `ignored_definitions` parameter. The default value of
|
||||||
this parameter ignores the following convention for adding non-HTML comments to
|
this parameter ignores the following convention for adding non-HTML comments to
|
||||||
Markdown:
|
Markdown:
|
||||||
|
|
||||||
```md
|
```markdown
|
||||||
[//]: # (This behaves like a comment)
|
[//]: # (This behaves like a comment)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ Aliases: `first-header-h1`, `first-heading-h1`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `level`: Heading level (`integer`, default `1`)
|
- `level`: Heading level (`integer`, default `1`)
|
||||||
|
|
||||||
> Note: *MD002 has been deprecated and is disabled by default.*
|
> Note: *MD002 has been deprecated and is disabled by default.*
|
||||||
> [MD041/first-line-heading](md041.md) offers an improved implementation.
|
> [MD041/first-line-heading](md041.md) offers an improved implementation.
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `header-style`, `heading-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: Heading style (`string`, default `consistent`, values `atx` /
|
- `style`: Heading style (`string`, default `consistent`, values `atx` /
|
||||||
`atx_closed` / `consistent` / `setext` / `setext_with_atx` /
|
`atx_closed` / `consistent` / `setext` / `setext_with_atx` /
|
||||||
`setext_with_atx_closed`)
|
`setext_with_atx_closed`)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `ul-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: List style (`string`, default `consistent`, values `asterisk` /
|
- `style`: List style (`string`, default `consistent`, values `asterisk` /
|
||||||
`consistent` / `dash` / `plus` / `sublist`)
|
`consistent` / `dash` / `plus` / `sublist`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
|
@ -6,10 +6,10 @@ Aliases: `ul-indent`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `indent`: Spaces for indent (`integer`, default `2`)
|
- `indent`: Spaces for indent (`integer`, default `2`)
|
||||||
* `start_indent`: Spaces for first level indent (when start_indented is set)
|
- `start_indent`: Spaces for first level indent (when start_indented is set)
|
||||||
(`integer`, default `2`)
|
(`integer`, default `2`)
|
||||||
* `start_indented`: Whether to indent the first level of the list (`boolean`,
|
- `start_indented`: Whether to indent the first level of the list (`boolean`,
|
||||||
default `false`)
|
default `false`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
|
@ -6,10 +6,10 @@ Aliases: `no-trailing-spaces`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `br_spaces`: Spaces for line break (`integer`, default `2`)
|
- `br_spaces`: Spaces for line break (`integer`, default `2`)
|
||||||
* `list_item_empty_lines`: Allow spaces for empty lines in list items
|
- `list_item_empty_lines`: Allow spaces for empty lines in list items
|
||||||
(`boolean`, default `false`)
|
(`boolean`, default `false`)
|
||||||
* `strict`: Include unnecessary breaks (`boolean`, default `false`)
|
- `strict`: Include unnecessary breaks (`boolean`, default `false`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,10 @@ Aliases: `no-hard-tabs`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `code_blocks`: Include code blocks (`boolean`, default `true`)
|
- `code_blocks`: Include code blocks (`boolean`, default `true`)
|
||||||
* `ignore_code_languages`: Fenced code languages to ignore (`string[]`, default
|
- `ignore_code_languages`: Fenced code languages to ignore (`string[]`, default
|
||||||
`[]`)
|
`[]`)
|
||||||
* `spaces_per_tab`: Number of spaces for each hard tab (`integer`, default `1`)
|
- `spaces_per_tab`: Number of spaces for each hard tab (`integer`, default `1`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `no-multiple-blanks`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `maximum`: Consecutive blank lines (`integer`, default `1`)
|
- `maximum`: Consecutive blank lines (`integer`, default `1`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
|
18
doc/md013.md
18
doc/md013.md
|
@ -6,17 +6,17 @@ Aliases: `line-length`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `code_block_line_length`: Number of characters for code blocks (`integer`,
|
- `code_block_line_length`: Number of characters for code blocks (`integer`,
|
||||||
default `80`)
|
default `80`)
|
||||||
* `code_blocks`: Include code blocks (`boolean`, default `true`)
|
- `code_blocks`: Include code blocks (`boolean`, default `true`)
|
||||||
* `headers`: Include headings (`boolean`, default `true`)
|
- `headers`: Include headings (`boolean`, default `true`)
|
||||||
* `heading_line_length`: Number of characters for headings (`integer`, default
|
- `heading_line_length`: Number of characters for headings (`integer`, default
|
||||||
`80`)
|
`80`)
|
||||||
* `headings`: Include headings (`boolean`, default `true`)
|
- `headings`: Include headings (`boolean`, default `true`)
|
||||||
* `line_length`: Number of characters (`integer`, default `80`)
|
- `line_length`: Number of characters (`integer`, default `80`)
|
||||||
* `stern`: Stern length checking (`boolean`, default `false`)
|
- `stern`: Stern length checking (`boolean`, default `false`)
|
||||||
* `strict`: Strict length checking (`boolean`, default `false`)
|
- `strict`: Strict length checking (`boolean`, default `false`)
|
||||||
* `tables`: Include tables (`boolean`, default `true`)
|
- `tables`: Include tables (`boolean`, default `true`)
|
||||||
|
|
||||||
> If `headings` is not provided, `headers` (deprecated) will be used.
|
> If `headings` is not provided, `headers` (deprecated) will be used.
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ Aliases: `blanks-around-headers`, `blanks-around-headings`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `lines_above`: Blank lines above heading (`integer`, default `1`)
|
- `lines_above`: Blank lines above heading (`integer`, default `1`)
|
||||||
* `lines_below`: Blank lines below heading (`integer`, default `1`)
|
- `lines_below`: Blank lines below heading (`integer`, default `1`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@ Aliases: `no-duplicate-header`, `no-duplicate-heading`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `allow_different_nesting`: Only check sibling headings (`boolean`, default
|
- `allow_different_nesting`: Only check sibling headings (`boolean`, default
|
||||||
`false`)
|
`false`)
|
||||||
* `siblings_only`: Only check sibling headings (`boolean`, default `false`)
|
- `siblings_only`: Only check sibling headings (`boolean`, default `false`)
|
||||||
|
|
||||||
This rule is triggered if there are multiple headings in the document that have
|
This rule is triggered if there are multiple headings in the document that have
|
||||||
the same text:
|
the same text:
|
||||||
|
|
|
@ -6,9 +6,9 @@ Aliases: `single-h1`, `single-title`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `front_matter_title`: RegExp for matching title in front matter (`string`,
|
- `front_matter_title`: RegExp for matching title in front matter (`string`,
|
||||||
default `^\s*title\s*[:=]`)
|
default `^\s*title\s*[:=]`)
|
||||||
* `level`: Heading level (`integer`, default `1`)
|
- `level`: Heading level (`integer`, default `1`)
|
||||||
|
|
||||||
This rule is triggered when a top-level heading is in use (the first line of
|
This rule is triggered when a top-level heading is in use (the first line of
|
||||||
the file is an h1 heading), and more than one h1 heading is in use in the
|
the file is an h1 heading), and more than one h1 heading is in use in the
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `no-trailing-punctuation`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `punctuation`: Punctuation characters not allowed at end of headings
|
- `punctuation`: Punctuation characters not allowed at end of headings
|
||||||
(`string`, default `.,;:!。,;:!`)
|
(`string`, default `.,;:!。,;:!`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `ol-prefix`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: List style (`string`, default `one_or_ordered`, values `one` /
|
- `style`: List style (`string`, default `one_or_ordered`, values `one` /
|
||||||
`one_or_ordered` / `ordered` / `zero`)
|
`one_or_ordered` / `ordered` / `zero`)
|
||||||
|
|
||||||
This rule is triggered for ordered lists that do not either start with '1.' or
|
This rule is triggered for ordered lists that do not either start with '1.' or
|
||||||
|
|
|
@ -6,12 +6,12 @@ Aliases: `list-marker-space`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `ol_multi`: Spaces for multi-line ordered list items (`integer`, default `1`)
|
- `ol_multi`: Spaces for multi-line ordered list items (`integer`, default `1`)
|
||||||
* `ol_single`: Spaces for single-line ordered list items (`integer`, default
|
- `ol_single`: Spaces for single-line ordered list items (`integer`, default
|
||||||
`1`)
|
`1`)
|
||||||
* `ul_multi`: Spaces for multi-line unordered list items (`integer`, default
|
- `ul_multi`: Spaces for multi-line unordered list items (`integer`, default
|
||||||
`1`)
|
`1`)
|
||||||
* `ul_single`: Spaces for single-line unordered list items (`integer`, default
|
- `ul_single`: Spaces for single-line unordered list items (`integer`, default
|
||||||
`1`)
|
`1`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `blanks-around-fences`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `list_items`: Include list items (`boolean`, default `true`)
|
- `list_items`: Include list items (`boolean`, default `true`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `no-inline-html`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `allowed_elements`: Allowed elements (`string[]`, default `[]`)
|
- `allowed_elements`: Allowed elements (`string[]`, default `[]`)
|
||||||
|
|
||||||
This rule is triggered whenever raw HTML is used in a Markdown document:
|
This rule is triggered whenever raw HTML is used in a Markdown document:
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `hr-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: Horizontal rule style (`string`, default `consistent`)
|
- `style`: Horizontal rule style (`string`, default `consistent`)
|
||||||
|
|
||||||
This rule is triggered when inconsistent styles of horizontal rules are used
|
This rule is triggered when inconsistent styles of horizontal rules are used
|
||||||
in the document:
|
in the document:
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `no-emphasis-as-header`, `no-emphasis-as-heading`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `punctuation`: Punctuation characters (`string`, default `.,;:!?。,;:!?`)
|
- `punctuation`: Punctuation characters (`string`, default `.,;:!?。,;:!?`)
|
||||||
|
|
||||||
This check looks for instances where emphasized (i.e. bold or italic) text is
|
This check looks for instances where emphasized (i.e. bold or italic) text is
|
||||||
used to separate sections, where a heading should be used instead:
|
used to separate sections, where a heading should be used instead:
|
||||||
|
|
|
@ -6,8 +6,8 @@ Aliases: `fenced-code-language`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `allowed_languages`: List of languages (`string[]`, default `[]`)
|
- `allowed_languages`: List of languages (`string[]`, default `[]`)
|
||||||
* `language_only`: Require language only (`boolean`, default `false`)
|
- `language_only`: Require language only (`boolean`, default `false`)
|
||||||
|
|
||||||
This rule is triggered when fenced code blocks are used, but a language isn't
|
This rule is triggered when fenced code blocks are used, but a language isn't
|
||||||
specified:
|
specified:
|
||||||
|
|
|
@ -6,9 +6,9 @@ Aliases: `first-line-h1`, `first-line-heading`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `front_matter_title`: RegExp for matching title in front matter (`string`,
|
- `front_matter_title`: RegExp for matching title in front matter (`string`,
|
||||||
default `^\s*title\s*[:=]`)
|
default `^\s*title\s*[:=]`)
|
||||||
* `level`: Heading level (`integer`, default `1`)
|
- `level`: Heading level (`integer`, default `1`)
|
||||||
|
|
||||||
This rule is intended to ensure documents have a title and is triggered when
|
This rule is intended to ensure documents have a title and is triggered when
|
||||||
the first line in the file isn't a top-level (h1) heading:
|
the first line in the file isn't a top-level (h1) heading:
|
||||||
|
|
|
@ -6,9 +6,9 @@ Aliases: `required-headers`, `required-headings`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `headers`: List of headings (`string[]`, default `[]`)
|
- `headers`: List of headings (`string[]`, default `[]`)
|
||||||
* `headings`: List of headings (`string[]`, default `[]`)
|
- `headings`: List of headings (`string[]`, default `[]`)
|
||||||
* `match_case`: Match case of headings (`boolean`, default `false`)
|
- `match_case`: Match case of headings (`boolean`, default `false`)
|
||||||
|
|
||||||
> If `headings` is not provided, `headers` (deprecated) will be used.
|
> If `headings` is not provided, `headers` (deprecated) will be used.
|
||||||
|
|
||||||
|
|
|
@ -6,9 +6,9 @@ Aliases: `proper-names`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `code_blocks`: Include code blocks (`boolean`, default `true`)
|
- `code_blocks`: Include code blocks (`boolean`, default `true`)
|
||||||
* `html_elements`: Include HTML elements (`boolean`, default `true`)
|
- `html_elements`: Include HTML elements (`boolean`, default `true`)
|
||||||
* `names`: List of proper names (`string[]`, default `[]`)
|
- `names`: List of proper names (`string[]`, default `[]`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `code-block-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: Block style (`string`, default `consistent`, values `consistent` /
|
- `style`: Block style (`string`, default `consistent`, values `consistent` /
|
||||||
`fenced` / `indented`)
|
`fenced` / `indented`)
|
||||||
|
|
||||||
This rule is triggered when unwanted or different code block styles are used in
|
This rule is triggered when unwanted or different code block styles are used in
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `code-fence-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: Code fence style (`string`, default `consistent`, values `backtick`
|
- `style`: Code fence style (`string`, default `consistent`, values `backtick`
|
||||||
/ `consistent` / `tilde`)
|
/ `consistent` / `tilde`)
|
||||||
|
|
||||||
This rule is triggered when the symbols used in the document for fenced code
|
This rule is triggered when the symbols used in the document for fenced code
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `emphasis-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: Emphasis style should be consistent (`string`, default `consistent`,
|
- `style`: Emphasis style should be consistent (`string`, default `consistent`,
|
||||||
values `asterisk` / `consistent` / `underscore`)
|
values `asterisk` / `consistent` / `underscore`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `strong-style`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `style`: Strong style should be consistent (`string`, default `consistent`,
|
- `style`: Strong style should be consistent (`string`, default `consistent`,
|
||||||
values `asterisk` / `consistent` / `underscore`)
|
values `asterisk` / `consistent` / `underscore`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
|
@ -6,7 +6,7 @@ Aliases: `link-image-reference-definitions`
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
* `ignored_definitions`: Ignored definitions (`string[]`, default `["//"]`)
|
- `ignored_definitions`: Ignored definitions (`string[]`, default `["//"]`)
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
Fixable: Most violations can be fixed by tooling
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ unnecessary:
|
||||||
|
|
||||||
1. If a label is not referenced by any link or image in a document, that
|
1. If a label is not referenced by any link or image in a document, that
|
||||||
definition is unused and can be deleted.
|
definition is unused and can be deleted.
|
||||||
1. If a label is defined multiple times in a document, the first definition is
|
2. If a label is defined multiple times in a document, the first definition is
|
||||||
used and the others can be deleted.
|
used and the others can be deleted.
|
||||||
|
|
||||||
This rule considers a reference definition to be used if any link or image
|
This rule considers a reference definition to be used if any link or image
|
||||||
|
@ -33,6 +33,6 @@ be ignored by setting the `ignored_definitions` parameter. The default value of
|
||||||
this parameter ignores the following convention for adding non-HTML comments to
|
this parameter ignores the following convention for adding non-HTML comments to
|
||||||
Markdown:
|
Markdown:
|
||||||
|
|
||||||
```md
|
```markdown
|
||||||
[//]: # (This behaves like a comment)
|
[//]: # (This behaves like a comment)
|
||||||
```
|
```
|
||||||
|
|
|
@ -11,7 +11,7 @@ package exposes those for reuse by custom rules.
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
_Undocumented_ - This package exports the internal functions as-is. The APIs
|
*Undocumented* - This package exports the internal functions as-is. The APIs
|
||||||
were not originally meant to be public, are not officially supported, and may
|
were not originally meant to be public, are not officially supported, and may
|
||||||
change from release to release. There are brief descriptive comments above each
|
change from release to release. There are brief descriptive comments above each
|
||||||
function, but no [JSDoc][jsdoc] annotations. That said, some of what's here will
|
function, but no [JSDoc][jsdoc] annotations. That said, some of what's here will
|
||||||
|
@ -19,7 +19,7 @@ be useful to custom rule authors and may avoid duplicating code.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
```js
|
```javascript
|
||||||
const { forEachLine, getLineMetadata } = require("markdownlint-rule-helpers");
|
const { forEachLine, getLineMetadata } = require("markdownlint-rule-helpers");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -45,7 +45,7 @@ See also: [`markdownlint` built-in rule implementations][lib].
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
_None_ - The entire body of code is tested to 100% coverage by the core
|
*None* - The entire body of code is tested to 100% coverage by the core
|
||||||
`markdownlint` project, so there are no additional tests here.
|
`markdownlint` project, so there are no additional tests here.
|
||||||
|
|
||||||
[custom-rules]: https://github.com/DavidAnson/markdownlint/blob/main/doc/CustomRules.md
|
[custom-rules]: https://github.com/DavidAnson/markdownlint/blob/main/doc/CustomRules.md
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue