markdownlint 0.26.1 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +81 -59
- package/README.md +424 -301
- package/demo/markdownlint-browser.js +445 -210
- package/doc/CustomRules.md +101 -50
- package/doc/Prettier.md +14 -10
- package/doc/ReleaseProcess.md +20 -0
- package/doc/Rules.md +464 -296
- package/doc/md001.md +37 -0
- package/doc/md002.md +37 -0
- package/doc/md003.md +59 -0
- package/doc/md004.md +49 -0
- package/doc/md005.md +53 -0
- package/doc/md006.md +46 -0
- package/doc/md007.md +55 -0
- package/doc/md009.md +51 -0
- package/doc/md010.md +56 -0
- package/doc/md011.md +30 -0
- package/doc/md012.md +38 -0
- package/doc/md013.md +60 -0
- package/doc/md014.md +54 -0
- package/doc/md018.md +27 -0
- package/doc/md019.md +28 -0
- package/doc/md020.md +29 -0
- package/doc/md021.md +31 -0
- package/doc/md022.md +46 -0
- package/doc/md023.md +26 -0
- package/doc/md024.md +47 -0
- package/doc/md025.md +49 -0
- package/doc/md026.md +41 -0
- package/doc/md027.md +24 -0
- package/doc/md028.md +40 -0
- package/doc/md029.md +98 -0
- package/doc/md030.md +82 -0
- package/doc/md031.md +50 -0
- package/doc/md032.md +38 -0
- package/doc/md033.md +27 -0
- package/doc/md034.md +44 -0
- package/doc/md035.md +42 -0
- package/doc/md036.md +45 -0
- package/doc/md037.md +37 -0
- package/doc/md038.md +40 -0
- package/doc/md039.md +21 -0
- package/doc/md040.md +52 -0
- package/doc/md041.md +49 -0
- package/doc/md042.md +32 -0
- package/doc/md043.md +72 -0
- package/doc/md044.md +35 -0
- package/doc/md045.md +34 -0
- package/doc/md046.md +40 -0
- package/doc/md047.md +34 -0
- package/doc/md048.md +41 -0
- package/doc/md049.md +32 -0
- package/doc/md050.md +32 -0
- package/doc/md051.md +50 -0
- package/doc/md052.md +33 -0
- package/doc/md053.md +38 -0
- package/helpers/README.md +35 -15
- package/helpers/helpers.js +234 -70
- package/helpers/package.json +2 -2
- package/lib/constants.js +8 -1
- package/lib/markdownlint.js +7 -12
- package/lib/md011.js +2 -2
- package/lib/md013.js +7 -6
- package/lib/md019.js +1 -1
- package/lib/md022.js +15 -3
- package/lib/md023.js +1 -1
- package/lib/md026.js +1 -1
- package/lib/md032.js +4 -5
- package/lib/md033.js +16 -5
- package/lib/md034.js +70 -45
- package/lib/md035.js +1 -1
- package/lib/md037.js +25 -22
- package/lib/md038.js +1 -1
- package/lib/md039.js +1 -1
- package/lib/md040.js +21 -2
- package/lib/md043.js +4 -2
- package/lib/md044.js +4 -3
- package/lib/md051.js +43 -11
- package/lib/md053.js +18 -11
- package/lib/rules.js +1 -1
- package/package.json +31 -21
- package/schema/.markdownlint.jsonc +16 -4
- package/schema/.markdownlint.yaml +13 -3
- package/schema/markdownlint-config-schema.json +45 -5
- package/style/prettier.json +26 -0
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
## Install
|
|
9
9
|
|
|
10
|
-
```
|
|
10
|
+
```bash
|
|
11
11
|
npm install markdownlint --save-dev
|
|
12
12
|
```
|
|
13
13
|
|
|
@@ -32,24 +32,43 @@ and test cases came directly from that project.
|
|
|
32
32
|
|
|
33
33
|
### Related
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
- CLI
|
|
36
|
+
- [markdownlint-cli][markdownlint-cli] command-line interface for Node.js
|
|
37
|
+
([works with pre-commit][markdownlint-cli-precommit])
|
|
38
|
+
- [markdownlint-cli2][markdownlint-cli2] command-line interface for Node.js
|
|
39
|
+
([works with pre-commit][markdownlint-cli2-precommit])
|
|
40
|
+
- GitHub
|
|
41
|
+
- [GitHub Action for markdownlint-cli2][markdownlint-cli2-action]
|
|
42
|
+
- [GitHub Super-Linter Action][super-linter]
|
|
43
|
+
- [GitHub Actions problem matcher for
|
|
44
|
+
markdownlint-cli][markdownlint-problem-matcher]
|
|
45
|
+
- Editor
|
|
46
|
+
- [vscode-markdownlint extension for VS Code][vscode-markdownlint]
|
|
47
|
+
- [Sublime Text markdownlint for Sublime Text][sublimelinter]
|
|
48
|
+
- [coc-markdownlint extension for Vim/Neovim][coc]
|
|
49
|
+
- Tooling
|
|
50
|
+
- [eslint-plugin-markdownlint for the ESLint analyzer][eslint-plugin]
|
|
51
|
+
- [grunt-markdownlint for the Grunt task runner][grunt-markdownlint]
|
|
52
|
+
- [Cake.Markdownlint addin for Cake build automation system][cake]
|
|
53
|
+
- [Lombiq Node.js Extensions for MSBuild (.NET builds)][nodejs-extensions]
|
|
54
|
+
- Ruby
|
|
55
|
+
- [markdownlint/mdl gem for Ruby][rubygems-mdl]
|
|
56
|
+
|
|
57
|
+
[cake]: https://github.com/cake-contrib/Cake.Markdownlint
|
|
58
|
+
[coc]: https://github.com/fannheyward/coc-markdownlint
|
|
59
|
+
[eslint-plugin]: https://github.com/paweldrozd/eslint-plugin-markdownlint
|
|
60
|
+
[grunt-markdownlint]: https://github.com/sagiegurari/grunt-markdownlint
|
|
61
|
+
[markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli
|
|
62
|
+
[markdownlint-cli-precommit]: https://github.com/igorshubovych/markdownlint-cli#use-with-pre-commit
|
|
63
|
+
[markdownlint-cli2]: https://github.com/DavidAnson/markdownlint-cli2
|
|
64
|
+
[markdownlint-cli2-action]: https://github.com/marketplace/actions/markdownlint-cli2-action
|
|
65
|
+
[markdownlint-cli2-precommit]: https://github.com/DavidAnson/markdownlint-cli2#pre-commit
|
|
66
|
+
[markdownlint-problem-matcher]: https://github.com/xt0rted/markdownlint-problem-matcher
|
|
67
|
+
[nodejs-extensions]: https://github.com/Lombiq/NodeJs-Extensions
|
|
68
|
+
[rubygems-mdl]: https://rubygems.org/gems/mdl
|
|
69
|
+
[sublimelinter]: https://packagecontrol.io/packages/SublimeLinter-contrib-markdownlint
|
|
70
|
+
[super-linter]: https://github.com/github/super-linter
|
|
71
|
+
[vscode-markdownlint]: https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint
|
|
53
72
|
|
|
54
73
|
## Demonstration
|
|
55
74
|
|
|
@@ -60,106 +79,116 @@ playground for learning and exploring.
|
|
|
60
79
|
|
|
61
80
|
<!-- markdownlint-disable line-length -->
|
|
62
81
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
82
|
+
- **[MD001](doc/md001.md)** *heading-increment/header-increment* - Heading levels should only increment by one level at a time
|
|
83
|
+
- ~~**[MD002](doc/md002.md)** *first-heading-h1/first-header-h1* - First heading should be a top-level heading~~
|
|
84
|
+
- **[MD003](doc/md003.md)** *heading-style/header-style* - Heading style
|
|
85
|
+
- **[MD004](doc/md004.md)** *ul-style* - Unordered list style
|
|
86
|
+
- **[MD005](doc/md005.md)** *list-indent* - Inconsistent indentation for list items at the same level
|
|
87
|
+
- ~~**[MD006](doc/md006.md)** *ul-start-left* - Consider starting bulleted lists at the beginning of the line~~
|
|
88
|
+
- **[MD007](doc/md007.md)** *ul-indent* - Unordered list indentation
|
|
89
|
+
- **[MD009](doc/md009.md)** *no-trailing-spaces* - Trailing spaces
|
|
90
|
+
- **[MD010](doc/md010.md)** *no-hard-tabs* - Hard tabs
|
|
91
|
+
- **[MD011](doc/md011.md)** *no-reversed-links* - Reversed link syntax
|
|
92
|
+
- **[MD012](doc/md012.md)** *no-multiple-blanks* - Multiple consecutive blank lines
|
|
93
|
+
- **[MD013](doc/md013.md)** *line-length* - Line length
|
|
94
|
+
- **[MD014](doc/md014.md)** *commands-show-output* - Dollar signs used before commands without showing output
|
|
95
|
+
- **[MD018](doc/md018.md)** *no-missing-space-atx* - No space after hash on atx style heading
|
|
96
|
+
- **[MD019](doc/md019.md)** *no-multiple-space-atx* - Multiple spaces after hash on atx style heading
|
|
97
|
+
- **[MD020](doc/md020.md)** *no-missing-space-closed-atx* - No space inside hashes on closed atx style heading
|
|
98
|
+
- **[MD021](doc/md021.md)** *no-multiple-space-closed-atx* - Multiple spaces inside hashes on closed atx style heading
|
|
99
|
+
- **[MD022](doc/md022.md)** *blanks-around-headings/blanks-around-headers* - Headings should be surrounded by blank lines
|
|
100
|
+
- **[MD023](doc/md023.md)** *heading-start-left/header-start-left* - Headings must start at the beginning of the line
|
|
101
|
+
- **[MD024](doc/md024.md)** *no-duplicate-heading/no-duplicate-header* - Multiple headings with the same content
|
|
102
|
+
- **[MD025](doc/md025.md)** *single-title/single-h1* - Multiple top-level headings in the same document
|
|
103
|
+
- **[MD026](doc/md026.md)** *no-trailing-punctuation* - Trailing punctuation in heading
|
|
104
|
+
- **[MD027](doc/md027.md)** *no-multiple-space-blockquote* - Multiple spaces after blockquote symbol
|
|
105
|
+
- **[MD028](doc/md028.md)** *no-blanks-blockquote* - Blank line inside blockquote
|
|
106
|
+
- **[MD029](doc/md029.md)** *ol-prefix* - Ordered list item prefix
|
|
107
|
+
- **[MD030](doc/md030.md)** *list-marker-space* - Spaces after list markers
|
|
108
|
+
- **[MD031](doc/md031.md)** *blanks-around-fences* - Fenced code blocks should be surrounded by blank lines
|
|
109
|
+
- **[MD032](doc/md032.md)** *blanks-around-lists* - Lists should be surrounded by blank lines
|
|
110
|
+
- **[MD033](doc/md033.md)** *no-inline-html* - Inline HTML
|
|
111
|
+
- **[MD034](doc/md034.md)** *no-bare-urls* - Bare URL used
|
|
112
|
+
- **[MD035](doc/md035.md)** *hr-style* - Horizontal rule style
|
|
113
|
+
- **[MD036](doc/md036.md)** *no-emphasis-as-heading/no-emphasis-as-header* - Emphasis used instead of a heading
|
|
114
|
+
- **[MD037](doc/md037.md)** *no-space-in-emphasis* - Spaces inside emphasis markers
|
|
115
|
+
- **[MD038](doc/md038.md)** *no-space-in-code* - Spaces inside code span elements
|
|
116
|
+
- **[MD039](doc/md039.md)** *no-space-in-links* - Spaces inside link text
|
|
117
|
+
- **[MD040](doc/md040.md)** *fenced-code-language* - Fenced code blocks should have a language specified
|
|
118
|
+
- **[MD041](doc/md041.md)** *first-line-heading/first-line-h1* - First line in a file should be a top-level heading
|
|
119
|
+
- **[MD042](doc/md042.md)** *no-empty-links* - No empty links
|
|
120
|
+
- **[MD043](doc/md043.md)** *required-headings/required-headers* - Required heading structure
|
|
121
|
+
- **[MD044](doc/md044.md)** *proper-names* - Proper names should have the correct capitalization
|
|
122
|
+
- **[MD045](doc/md045.md)** *no-alt-text* - Images should have alternate text (alt text)
|
|
123
|
+
- **[MD046](doc/md046.md)** *code-block-style* - Code block style
|
|
124
|
+
- **[MD047](doc/md047.md)** *single-trailing-newline* - Files should end with a single newline character
|
|
125
|
+
- **[MD048](doc/md048.md)** *code-fence-style* - Code fence style
|
|
126
|
+
- **[MD049](doc/md049.md)** *emphasis-style* - Emphasis style should be consistent
|
|
127
|
+
- **[MD050](doc/md050.md)** *strong-style* - Strong style should be consistent
|
|
128
|
+
- **[MD051](doc/md051.md)** *link-fragments* - Link fragments should be valid
|
|
129
|
+
- **[MD052](doc/md052.md)** *reference-links-images* - Reference links and images should use a label that is defined
|
|
130
|
+
- **[MD053](doc/md053.md)** *link-image-reference-definitions* - Link and image reference definitions should be needed
|
|
112
131
|
|
|
113
132
|
<!-- markdownlint-restore -->
|
|
114
133
|
|
|
115
134
|
See [Rules.md](doc/Rules.md) for more details.
|
|
116
135
|
|
|
117
|
-
~~Struck through~~ rules are deprecated
|
|
136
|
+
~~Struck through~~ rules are deprecated and provided for backward-compatibility.
|
|
118
137
|
|
|
119
|
-
> All rules with `heading` as part of their name are also available as
|
|
120
|
-
>
|
|
138
|
+
> All rules with `heading` as part of their name are also available as `header`
|
|
139
|
+
> aliases (e.g. `heading-increment` is also available as `header-increment`).
|
|
121
140
|
> The use of `header` is deprecated and provided for backward-compatibility.
|
|
122
141
|
|
|
142
|
+
### Custom Rules
|
|
143
|
+
|
|
144
|
+
In addition to built-in rules, custom rules can be used to address
|
|
145
|
+
project-specific requirements. To find community-developed rules use
|
|
146
|
+
[keyword `markdownlint-rule` on npm][markdownlint-rule].
|
|
147
|
+
To implement your own rules, refer to [CustomRules.md](doc/CustomRules.md).
|
|
148
|
+
|
|
149
|
+
[markdownlint-rule]: https://www.npmjs.com/search?q=keywords:markdownlint-rule
|
|
150
|
+
|
|
123
151
|
## Tags
|
|
124
152
|
|
|
125
153
|
Tags group related rules and can be used to enable/disable multiple
|
|
126
154
|
rules at once.
|
|
127
155
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
MD023
|
|
139
|
-
|
|
140
|
-
MD023
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
156
|
+
- **`accessibility`** - `MD045`
|
|
157
|
+
- **`atx`** - `MD018`, `MD019`
|
|
158
|
+
- **`atx_closed`** - `MD020`, `MD021`
|
|
159
|
+
- **`blank_lines`** - `MD012`, `MD022`, `MD031`, `MD032`, `MD047`
|
|
160
|
+
- **`blockquote`** - `MD027`, `MD028`
|
|
161
|
+
- **`bullet`** - `MD004`, `MD005`, `MD006`, `MD007`, `MD032`
|
|
162
|
+
- **`code`** - `MD014`, `MD031`, `MD038`, `MD040`, `MD046`, `MD048`
|
|
163
|
+
- **`emphasis`** - `MD036`, `MD037`, `MD049`, `MD050`
|
|
164
|
+
- **`hard_tab`** - `MD010`
|
|
165
|
+
- **`headers`** - `MD001`, `MD002`, `MD003`, `MD018`, `MD019`, `MD020`, `MD021`,
|
|
166
|
+
`MD022`, `MD023`, `MD024`, `MD025`, `MD026`, `MD036`, `MD041`, `MD043`
|
|
167
|
+
- **`headings`** - `MD001`, `MD002`, `MD003`, `MD018`, `MD019`, `MD020`,
|
|
168
|
+
`MD021`, `MD022`, `MD023`, `MD024`, `MD025`, `MD026`, `MD036`, `MD041`,
|
|
169
|
+
`MD043`
|
|
170
|
+
- **`hr`** - `MD035`
|
|
171
|
+
- **`html`** - `MD033`
|
|
172
|
+
- **`images`** - `MD045`, `MD052`, `MD053`
|
|
173
|
+
- **`indentation`** - `MD005`, `MD006`, `MD007`, `MD027`
|
|
174
|
+
- **`language`** - `MD040`
|
|
175
|
+
- **`line_length`** - `MD013`
|
|
176
|
+
- **`links`** - `MD011`, `MD034`, `MD039`, `MD042`, `MD051`, `MD052`, `MD053`
|
|
177
|
+
- **`ol`** - `MD029`, `MD030`, `MD032`
|
|
178
|
+
- **`spaces`** - `MD018`, `MD019`, `MD020`, `MD021`, `MD023`
|
|
179
|
+
- **`spelling`** - `MD044`
|
|
180
|
+
- **`ul`** - `MD004`, `MD005`, `MD006`, `MD007`, `MD030`, `MD032`
|
|
181
|
+
- **`url`** - `MD034`
|
|
182
|
+
- **`whitespace`** - `MD009`, `MD010`, `MD012`, `MD027`, `MD028`, `MD030`,
|
|
183
|
+
`MD037`, `MD038`, `MD039`
|
|
155
184
|
|
|
156
185
|
## Configuration
|
|
157
186
|
|
|
158
187
|
Text passed to `markdownlint` is parsed as Markdown, analyzed, and any
|
|
159
188
|
issues reported. Two kinds of text are ignored:
|
|
160
189
|
|
|
161
|
-
|
|
162
|
-
|
|
190
|
+
- [HTML comments](https://www.w3.org/TR/html5/syntax.html#comments)
|
|
191
|
+
- [Front matter](https://jekyllrb.com/docs/frontmatter/) (see
|
|
163
192
|
`options.frontMatter` below)
|
|
164
193
|
|
|
165
194
|
Rules can be enabled, disabled, and configured via `options.config`
|
|
@@ -168,37 +197,37 @@ To enable or disable rules at a particular location within a file, add
|
|
|
168
197
|
one of these markers to the appropriate place (HTML comments don't
|
|
169
198
|
appear in the final markup):
|
|
170
199
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
200
|
+
- Disable all rules: `<!-- markdownlint-disable -->`
|
|
201
|
+
- Enable all rules: `<!-- markdownlint-enable -->`
|
|
202
|
+
- Disable all rules for the current line: `<!-- markdownlint-disable-line -->`
|
|
203
|
+
- Disable all rules for the next line: `<!-- markdownlint-disable-next-line -->`
|
|
204
|
+
- Disable one or more rules by name: `<!-- markdownlint-disable MD001 MD005 -->`
|
|
205
|
+
- Enable one or more rules by name: `<!-- markdownlint-enable MD001 MD005 -->`
|
|
206
|
+
- Disable one or more rules by name for the current line:
|
|
178
207
|
`<!-- markdownlint-disable-line MD001 MD005 -->`
|
|
179
|
-
|
|
208
|
+
- Disable one or more rules by name for the next line:
|
|
180
209
|
`<!-- markdownlint-disable-next-line MD001 MD005 -->`
|
|
181
|
-
|
|
182
|
-
|
|
210
|
+
- Capture the current rule configuration: `<!-- markdownlint-capture -->`
|
|
211
|
+
- Restore the captured rule configuration: `<!-- markdownlint-restore -->`
|
|
183
212
|
|
|
184
213
|
For example:
|
|
185
214
|
|
|
186
215
|
```markdown
|
|
187
216
|
<!-- markdownlint-disable-next-line no-space-in-emphasis -->
|
|
188
|
-
|
|
217
|
+
space * in * emphasis
|
|
189
218
|
```
|
|
190
219
|
|
|
191
220
|
Or:
|
|
192
221
|
|
|
193
222
|
```markdown
|
|
194
|
-
|
|
223
|
+
space * in * emphasis <!-- markdownlint-disable-line no-space-in-emphasis -->
|
|
195
224
|
```
|
|
196
225
|
|
|
197
226
|
Or:
|
|
198
227
|
|
|
199
228
|
```markdown
|
|
200
229
|
<!-- markdownlint-disable no-space-in-emphasis -->
|
|
201
|
-
|
|
230
|
+
space * in * emphasis
|
|
202
231
|
<!-- markdownlint-enable no-space-in-emphasis -->
|
|
203
232
|
```
|
|
204
233
|
|
|
@@ -231,22 +260,22 @@ space * in * emphasis <!-- markdownlint-disable --> <!-- markdownlint-enable -->
|
|
|
231
260
|
To apply changes to an entire file regardless of where the comment is located,
|
|
232
261
|
the following syntax is supported:
|
|
233
262
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
263
|
+
- Disable all rules: `<!-- markdownlint-disable-file -->`
|
|
264
|
+
- Enable all rules: `<!-- markdownlint-enable-file -->`
|
|
265
|
+
- Disable one or more rules by name: `<!-- markdownlint-disable-file MD001 -->`
|
|
266
|
+
- Enable one or more rules by name: `<!-- markdownlint-enable-file MD001 -->`
|
|
238
267
|
|
|
239
268
|
This can be used to "hide" `markdownlint` comments at the bottom of a file.
|
|
240
269
|
|
|
241
270
|
In cases where it is desirable to change the configuration of one or
|
|
242
271
|
more rules for a file, the following more advanced syntax is supported:
|
|
243
272
|
|
|
244
|
-
|
|
273
|
+
- Configure: `<!-- markdownlint-configure-file { options.config JSON } -->`
|
|
245
274
|
|
|
246
275
|
For example:
|
|
247
276
|
|
|
248
277
|
```markdown
|
|
249
|
-
<!-- markdownlint-configure-file { "
|
|
278
|
+
<!-- markdownlint-configure-file { "hr-style": { "style": "---" } } -->
|
|
250
279
|
```
|
|
251
280
|
|
|
252
281
|
or
|
|
@@ -274,7 +303,7 @@ alternate formats.
|
|
|
274
303
|
|
|
275
304
|
Standard asynchronous API:
|
|
276
305
|
|
|
277
|
-
```
|
|
306
|
+
```javascript
|
|
278
307
|
/**
|
|
279
308
|
* Lint specified Markdown files.
|
|
280
309
|
*
|
|
@@ -287,7 +316,7 @@ function markdownlint(options, callback) { ... }
|
|
|
287
316
|
|
|
288
317
|
Synchronous API (for build scripts, etc.):
|
|
289
318
|
|
|
290
|
-
```
|
|
319
|
+
```javascript
|
|
291
320
|
/**
|
|
292
321
|
* Lint specified Markdown files synchronously.
|
|
293
322
|
*
|
|
@@ -300,7 +329,7 @@ function markdownlint.sync(options) { ... }
|
|
|
300
329
|
Promise API (in the `promises` namespace like Node.js's
|
|
301
330
|
[`fs` Promises API](https://nodejs.org/api/fs.html#fs_fs_promises_api)):
|
|
302
331
|
|
|
303
|
-
```
|
|
332
|
+
```javascript
|
|
304
333
|
/**
|
|
305
334
|
* Lint specified Markdown files.
|
|
306
335
|
*
|
|
@@ -353,15 +382,23 @@ configuration object with all properties set to the default value.
|
|
|
353
382
|
Sets of rules (known as a "style") can be stored separately and loaded
|
|
354
383
|
as [JSON](https://en.wikipedia.org/wiki/JSON).
|
|
355
384
|
|
|
356
|
-
Example:
|
|
385
|
+
Example of referencing a built-in style from JavaScript:
|
|
357
386
|
|
|
358
|
-
```
|
|
387
|
+
```javascript
|
|
359
388
|
const options = {
|
|
360
389
|
"files": [ "..." ],
|
|
361
390
|
"config": require("style/relaxed.json")
|
|
362
391
|
};
|
|
363
392
|
```
|
|
364
393
|
|
|
394
|
+
Example doing so from `.markdownlint.json` via `extends` (more on this below):
|
|
395
|
+
|
|
396
|
+
```json
|
|
397
|
+
{
|
|
398
|
+
"extends": "markdownlint/style/relaxed"
|
|
399
|
+
}
|
|
400
|
+
```
|
|
401
|
+
|
|
365
402
|
See the [style](style) directory for more samples.
|
|
366
403
|
|
|
367
404
|
See [markdownlint-config-schema.json](schema/markdownlint-config-schema.json)
|
|
@@ -391,7 +428,7 @@ And a `custom.json` configuration file:
|
|
|
391
428
|
|
|
392
429
|
Then code like the following:
|
|
393
430
|
|
|
394
|
-
```
|
|
431
|
+
```javascript
|
|
395
432
|
const options = {
|
|
396
433
|
"config": markdownlint.readConfigSync("./custom.json")
|
|
397
434
|
};
|
|
@@ -399,7 +436,7 @@ const options = {
|
|
|
399
436
|
|
|
400
437
|
Merges `custom.json` and `base.json` and is equivalent to:
|
|
401
438
|
|
|
402
|
-
```
|
|
439
|
+
```javascript
|
|
403
440
|
const options = {
|
|
404
441
|
"config": {
|
|
405
442
|
"default": true,
|
|
@@ -417,12 +454,13 @@ Array of functions to parse the content of `markdownlint-configure-file` blocks.
|
|
|
417
454
|
As shown in the [Configuration](#configuration) section, inline comments can be
|
|
418
455
|
used to customize the [configuration object](#optionsconfig) for a document. By
|
|
419
456
|
default, the `JSON.parse` built-in is used, but custom parsers can be specified.
|
|
420
|
-
Content is passed to each parser function until one returns a value (vs.
|
|
421
|
-
an exception). As such, strict parsers should come before flexible
|
|
457
|
+
Content is passed to each parser function until one returns a value (vs.
|
|
458
|
+
throwing an exception). As such, strict parsers should come before flexible
|
|
459
|
+
ones.
|
|
422
460
|
|
|
423
461
|
For example:
|
|
424
462
|
|
|
425
|
-
```
|
|
463
|
+
```javascript
|
|
426
464
|
[ JSON.parse, require("toml").parse, require("js-yaml").load ]
|
|
427
465
|
```
|
|
428
466
|
|
|
@@ -433,13 +471,11 @@ Type: `Array` of `Object`
|
|
|
433
471
|
List of custom rules to include with the default rule set for linting.
|
|
434
472
|
|
|
435
473
|
Each array element should define a rule. Rules are typically exported
|
|
436
|
-
by another package, but can be defined locally.
|
|
437
|
-
identified by the
|
|
438
|
-
[keyword `markdownlint-rule` on npm](https://www.npmjs.com/search?q=keywords:markdownlint-rule).
|
|
474
|
+
by another package, but can be defined locally.
|
|
439
475
|
|
|
440
476
|
Example:
|
|
441
477
|
|
|
442
|
-
```
|
|
478
|
+
```javascript
|
|
443
479
|
const extraRules = require("extraRules");
|
|
444
480
|
const options = {
|
|
445
481
|
"customRules": [ extraRules.one, extraRules.two ]
|
|
@@ -474,8 +510,8 @@ specify a custom `RegExp` or use the value `null` to disable the feature.
|
|
|
474
510
|
|
|
475
511
|
The default value:
|
|
476
512
|
|
|
477
|
-
```
|
|
478
|
-
/((^---\s*$[
|
|
513
|
+
```javascript
|
|
514
|
+
/((^---\s*$[\s\S]*?^---\s*)|(^\+\+\+\s*$[\s\S]*?^(\+\+\+|\.\.\.)\s*)|(^\{\s*$[\s\S]*?^\}\s*))(\r\n|\r|\n|$)/m
|
|
479
515
|
```
|
|
480
516
|
|
|
481
517
|
Ignores [YAML](https://en.wikipedia.org/wiki/YAML),
|
|
@@ -493,14 +529,16 @@ Note: Matches must occur at the start of the file.
|
|
|
493
529
|
|
|
494
530
|
##### options.fs
|
|
495
531
|
|
|
496
|
-
Type: `Object` implementing the [file system API]
|
|
532
|
+
Type: `Object` implementing the [file system API][node-fs-api]
|
|
497
533
|
|
|
498
|
-
In advanced scenarios, it may be desirable to bypass the default file system
|
|
499
|
-
If a custom file system implementation is provided, `markdownlint` will use
|
|
500
|
-
instead of invoking `require("fs")`.
|
|
534
|
+
In advanced scenarios, it may be desirable to bypass the default file system
|
|
535
|
+
API. If a custom file system implementation is provided, `markdownlint` will use
|
|
536
|
+
that instead of invoking `require("fs")`.
|
|
501
537
|
|
|
502
538
|
Note: The only methods called are `readFile` and `readFileSync`.
|
|
503
539
|
|
|
540
|
+
[node-fs-api]: https://nodejs.org/api/fs.html
|
|
541
|
+
|
|
504
542
|
##### options.handleRuleFailures
|
|
505
543
|
|
|
506
544
|
Type: `Boolean`
|
|
@@ -520,13 +558,15 @@ is allowed to continue and report any violations that were found.
|
|
|
520
558
|
|
|
521
559
|
Type: `Array` of `Array` of `Function` and plugin parameters
|
|
522
560
|
|
|
523
|
-
Specifies additional [markdown-it plugins]
|
|
524
|
-
|
|
525
|
-
|
|
561
|
+
Specifies additional [markdown-it plugins][markdown-it-plugin] to use when
|
|
562
|
+
parsing input. Plugins can be used to support additional syntax and features for
|
|
563
|
+
advanced scenarios.
|
|
564
|
+
|
|
565
|
+
[markdown-it-plugin]: https://www.npmjs.com/search?q=keywords:markdown-it-plugin
|
|
526
566
|
|
|
527
567
|
Each item in the top-level `Array` should be of the form:
|
|
528
568
|
|
|
529
|
-
```
|
|
569
|
+
```javascript
|
|
530
570
|
[ require("markdown-it-plugin"), plugin_param_0, plugin_param_1, ... ]
|
|
531
571
|
```
|
|
532
572
|
|
|
@@ -534,7 +574,7 @@ Each item in the top-level `Array` should be of the form:
|
|
|
534
574
|
|
|
535
575
|
Type: `Boolean`
|
|
536
576
|
|
|
537
|
-
Disables the use of HTML comments like `<!-- markdownlint-
|
|
577
|
+
Disables the use of HTML comments like `<!-- markdownlint-enable -->` to toggle
|
|
538
578
|
rules within the body of Markdown content.
|
|
539
579
|
|
|
540
580
|
By default, properly-formatted inline comments can be used to create exceptions
|
|
@@ -545,24 +585,27 @@ comments.
|
|
|
545
585
|
|
|
546
586
|
Type: `Number`
|
|
547
587
|
|
|
548
|
-
Specifies which version of the `result` object to return (see the "Usage"
|
|
549
|
-
below for examples).
|
|
588
|
+
Specifies which version of the `result` object to return (see the "Usage"
|
|
589
|
+
section below for examples).
|
|
550
590
|
|
|
551
|
-
Passing a `resultVersion` of `0` corresponds to the original, simple format
|
|
552
|
-
each error is identified by rule name and line number. *This is
|
|
591
|
+
Passing a `resultVersion` of `0` corresponds to the original, simple format
|
|
592
|
+
where each error is identified by rule name and line number. *This is
|
|
593
|
+
deprecated.*
|
|
553
594
|
|
|
554
|
-
Passing a `resultVersion` of `1` corresponds to a detailed format where each
|
|
555
|
-
includes information about the line number, rule name, alias, description,
|
|
556
|
-
as any additional detail or context that is available. *This is
|
|
595
|
+
Passing a `resultVersion` of `1` corresponds to a detailed format where each
|
|
596
|
+
error includes information about the line number, rule name, alias, description,
|
|
597
|
+
as well as any additional detail or context that is available. *This is
|
|
598
|
+
deprecated.*
|
|
557
599
|
|
|
558
|
-
Passing a `resultVersion` of `2` corresponds to a detailed format where each
|
|
559
|
-
includes information about the line number, rule names, description, as
|
|
560
|
-
additional detail or context that is available. *This is
|
|
600
|
+
Passing a `resultVersion` of `2` corresponds to a detailed format where each
|
|
601
|
+
error includes information about the line number, rule names, description, as
|
|
602
|
+
well as any additional detail or context that is available. *This is
|
|
603
|
+
deprecated.*
|
|
561
604
|
|
|
562
605
|
Passing a `resultVersion` of `3` corresponds to the detailed version `2` format
|
|
563
|
-
with additional information about how to fix automatically-fixable errors. In
|
|
564
|
-
mode, all errors that occur on each line are reported (other versions
|
|
565
|
-
the first error for each rule). *This is the default.*
|
|
606
|
+
with additional information about how to fix automatically-fixable errors. In
|
|
607
|
+
this mode, all errors that occur on each line are reported (other versions
|
|
608
|
+
report only the first error for each rule). *This is the default.*
|
|
566
609
|
|
|
567
610
|
##### options.strings
|
|
568
611
|
|
|
@@ -604,17 +647,18 @@ for readability and easy reuse. The `readConfig` and `readConfigSync` functions
|
|
|
604
647
|
load configuration settings and support the `extends` keyword for referencing
|
|
605
648
|
other files (see above).
|
|
606
649
|
|
|
607
|
-
By default, configuration files are parsed as JSON (and named
|
|
608
|
-
Custom parsers can be provided to handle other formats
|
|
650
|
+
By default, configuration files are parsed as JSON (and named
|
|
651
|
+
`.markdownlint.json`). Custom parsers can be provided to handle other formats
|
|
652
|
+
like JSONC, YAML, and TOML.
|
|
609
653
|
|
|
610
654
|
Asynchronous API:
|
|
611
655
|
|
|
612
|
-
```
|
|
656
|
+
```javascript
|
|
613
657
|
/**
|
|
614
658
|
* Read specified configuration file.
|
|
615
659
|
*
|
|
616
660
|
* @param {string} file Configuration file name.
|
|
617
|
-
* @param {ConfigurationParser[] | ReadConfigCallback} parsers Parsing function
|
|
661
|
+
* @param {ConfigurationParser[] | ReadConfigCallback} parsers Parsing function.
|
|
618
662
|
* @param {Object} [fs] File system implementation.
|
|
619
663
|
* @param {ReadConfigCallback} [callback] Callback (err, result) function.
|
|
620
664
|
* @returns {void}
|
|
@@ -624,7 +668,7 @@ function readConfig(file, parsers, fs, callback) { ... }
|
|
|
624
668
|
|
|
625
669
|
Synchronous API:
|
|
626
670
|
|
|
627
|
-
```
|
|
671
|
+
```javascript
|
|
628
672
|
/**
|
|
629
673
|
* Read specified configuration file synchronously.
|
|
630
674
|
*
|
|
@@ -639,7 +683,7 @@ function readConfigSync(file, parsers, fs) { ... }
|
|
|
639
683
|
Promise API (in the `promises` namespace like Node.js's
|
|
640
684
|
[`fs` Promises API](https://nodejs.org/api/fs.html#fs_promises_api)):
|
|
641
685
|
|
|
642
|
-
```
|
|
686
|
+
```javascript
|
|
643
687
|
/**
|
|
644
688
|
* Read specified configuration file.
|
|
645
689
|
*
|
|
@@ -657,12 +701,13 @@ Type: `String`
|
|
|
657
701
|
|
|
658
702
|
Location of configuration file to read.
|
|
659
703
|
|
|
660
|
-
The `file` is resolved relative to the current working directory. If an
|
|
661
|
-
key is present once read, its value will be resolved as a path
|
|
662
|
-
and loaded recursively. Settings from a file referenced by
|
|
663
|
-
first, then those of `file` are applied on top (overriding
|
|
664
|
-
appearing in the referenced file). If either the `file` or
|
|
665
|
-
with the `~` directory, it will act as a placeholder for
|
|
704
|
+
The `file` is resolved relative to the current working directory. If an
|
|
705
|
+
`extends` key is present once read, its value will be resolved as a path
|
|
706
|
+
relative to `file` and loaded recursively. Settings from a file referenced by
|
|
707
|
+
`extends` are applied first, then those of `file` are applied on top (overriding
|
|
708
|
+
any of the same keys appearing in the referenced file). If either the `file` or
|
|
709
|
+
`extends` path begins with the `~` directory, it will act as a placeholder for
|
|
710
|
+
the home directory.
|
|
666
711
|
|
|
667
712
|
#### parsers
|
|
668
713
|
|
|
@@ -670,25 +715,28 @@ Type: *Optional* `Array` of `Function` taking (`String`) and returning `Object`
|
|
|
670
715
|
|
|
671
716
|
Array of functions to parse configuration files.
|
|
672
717
|
|
|
673
|
-
The contents of a configuration file are passed to each parser function until
|
|
674
|
-
of them returns a value (vs. throwing an exception). Consequently, strict
|
|
675
|
-
should come before flexible parsers.
|
|
718
|
+
The contents of a configuration file are passed to each parser function until
|
|
719
|
+
one of them returns a value (vs. throwing an exception). Consequently, strict
|
|
720
|
+
parsers should come before flexible parsers.
|
|
676
721
|
|
|
677
722
|
For example:
|
|
678
723
|
|
|
679
|
-
```
|
|
724
|
+
```javascript
|
|
680
725
|
[ JSON.parse, require("toml").parse, require("js-yaml").load ]
|
|
681
726
|
```
|
|
682
727
|
|
|
683
728
|
#### fs
|
|
684
729
|
|
|
685
|
-
Type: *Optional* `Object` implementing the [file system API]
|
|
730
|
+
Type: *Optional* `Object` implementing the [file system API][file-system-api]
|
|
686
731
|
|
|
687
|
-
|
|
688
|
-
If a custom file system implementation is provided, `markdownlint` will use that
|
|
689
|
-
instead of invoking `require("fs")`.
|
|
732
|
+
[file-system-api]: https://nodejs.org/api/fs.html
|
|
690
733
|
|
|
691
|
-
|
|
734
|
+
In advanced scenarios, it may be desirable to bypass the default file system
|
|
735
|
+
API. If a custom file system implementation is provided, `markdownlint` will use
|
|
736
|
+
that instead of invoking `require("fs")`.
|
|
737
|
+
|
|
738
|
+
Note: The only methods called are `readFile`, `readFileSync`, `access`, and
|
|
739
|
+
`accessSync`.
|
|
692
740
|
|
|
693
741
|
#### callback
|
|
694
742
|
|
|
@@ -706,7 +754,7 @@ Configuration object.
|
|
|
706
754
|
|
|
707
755
|
Invoke `markdownlint` and use the `result` object's `toString` method:
|
|
708
756
|
|
|
709
|
-
```
|
|
757
|
+
```javascript
|
|
710
758
|
const markdownlint = require("markdownlint");
|
|
711
759
|
|
|
712
760
|
const options = {
|
|
@@ -739,14 +787,14 @@ bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be
|
|
|
739
787
|
|
|
740
788
|
Or invoke `markdownlint.sync` for a synchronous call:
|
|
741
789
|
|
|
742
|
-
```
|
|
790
|
+
```javascript
|
|
743
791
|
const result = markdownlint.sync(options);
|
|
744
792
|
console.log(result.toString());
|
|
745
793
|
```
|
|
746
794
|
|
|
747
795
|
To examine the `result` object directly:
|
|
748
796
|
|
|
749
|
-
```
|
|
797
|
+
```javascript
|
|
750
798
|
markdownlint(options, function callback(err, result) {
|
|
751
799
|
if (!err) {
|
|
752
800
|
console.dir(result, { "colors": true, "depth": null });
|
|
@@ -763,28 +811,28 @@ Output:
|
|
|
763
811
|
{ "lineNumber": 3,
|
|
764
812
|
"ruleNames": [ "MD010", "no-hard-tabs" ],
|
|
765
813
|
"ruleDescription": "Hard tabs",
|
|
766
|
-
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/
|
|
814
|
+
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md010.md",
|
|
767
815
|
"errorDetail": "Column: 17",
|
|
768
816
|
"errorContext": null,
|
|
769
817
|
"errorRange": [ 17, 1 ] },
|
|
770
818
|
{ "lineNumber": 1,
|
|
771
819
|
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
|
772
820
|
"ruleDescription": "No space after hash on atx style heading",
|
|
773
|
-
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/
|
|
821
|
+
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md",
|
|
774
822
|
"errorDetail": null,
|
|
775
823
|
"errorContext": "#bad.md",
|
|
776
824
|
"errorRange": [ 1, 2 ] },
|
|
777
825
|
{ "lineNumber": 3,
|
|
778
826
|
"ruleNames": [ "MD018", "no-missing-space-atx" ],
|
|
779
827
|
"ruleDescription": "No space after hash on atx style heading",
|
|
780
|
-
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/
|
|
828
|
+
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md018.md",
|
|
781
829
|
"errorDetail": null,
|
|
782
830
|
"errorContext": "#This file fails\tsome rules.",
|
|
783
831
|
"errorRange": [ 1, 2 ] },
|
|
784
832
|
{ "lineNumber": 1,
|
|
785
833
|
"ruleNames": [ "MD041", "first-line-heading", "first-line-h1" ],
|
|
786
834
|
"ruleDescription": "First line in a file should be a top-level heading",
|
|
787
|
-
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/
|
|
835
|
+
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md041.md",
|
|
788
836
|
"errorDetail": null,
|
|
789
837
|
"errorContext": "#bad.md",
|
|
790
838
|
"errorRange": null }
|
|
@@ -792,9 +840,10 @@ Output:
|
|
|
792
840
|
}
|
|
793
841
|
```
|
|
794
842
|
|
|
795
|
-
Integration with the [gulp](https://gulpjs.com/) build system is
|
|
843
|
+
Integration with the [gulp](https://gulpjs.com/) build system is
|
|
844
|
+
straightforward:
|
|
796
845
|
|
|
797
|
-
```
|
|
846
|
+
```javascript
|
|
798
847
|
const gulp = require("gulp");
|
|
799
848
|
const through2 = require("through2");
|
|
800
849
|
const markdownlint = require("markdownlint");
|
|
@@ -828,7 +877,7 @@ bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be
|
|
|
828
877
|
|
|
829
878
|
Integration with the [Grunt](https://gruntjs.com/) build system is similar:
|
|
830
879
|
|
|
831
|
-
```
|
|
880
|
+
```javascript
|
|
832
881
|
const markdownlint = require("markdownlint");
|
|
833
882
|
|
|
834
883
|
module.exports = function wrapper(grunt) {
|
|
@@ -867,13 +916,21 @@ bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be
|
|
|
867
916
|
Use --force to continue.
|
|
868
917
|
```
|
|
869
918
|
|
|
919
|
+
### Fixing
|
|
920
|
+
|
|
921
|
+
Rules that can be fixed automatically include a `fixInfo` property which is
|
|
922
|
+
outlined in the [documentation for custom rules](doc/CustomRules.md#authoring).
|
|
923
|
+
To apply those fixes more easily, the `applyFixes` method in
|
|
924
|
+
[markdownlint-rule-helpers](helpers/README.md#applying-recommended-fixes) may
|
|
925
|
+
be used.
|
|
926
|
+
|
|
870
927
|
## Browser
|
|
871
928
|
|
|
872
929
|
`markdownlint` also works in the browser.
|
|
873
930
|
|
|
874
931
|
Generate normal and minified scripts with:
|
|
875
932
|
|
|
876
|
-
```
|
|
933
|
+
```bash
|
|
877
934
|
npm run build-demo
|
|
878
935
|
```
|
|
879
936
|
|
|
@@ -886,7 +943,7 @@ Then reference `markdown-it` and `markdownlint`:
|
|
|
886
943
|
|
|
887
944
|
And call it like so:
|
|
888
945
|
|
|
889
|
-
```
|
|
946
|
+
```javascript
|
|
890
947
|
const options = {
|
|
891
948
|
"strings": {
|
|
892
949
|
"content": "Some Markdown to lint."
|
|
@@ -900,126 +957,192 @@ const results = window.markdownlint.sync(options).toString();
|
|
|
900
957
|
For ideas how to integrate `markdownlint` into your workflow, refer to the
|
|
901
958
|
following projects or one of the tools in the [Related section](#related):
|
|
902
959
|
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
960
|
+
- [.NET Documentation][dot-net-doc] ([Search repository][dot-net-doc-search])
|
|
961
|
+
- [ally.js][ally-js] ([Search repository][ally-js-search])
|
|
962
|
+
- [Apache Airflow][airflow] ([Search repository][airflow-search])
|
|
963
|
+
- [Boostnote][boostnote] ([Search repository][boostnote-search])
|
|
964
|
+
- [CodiMD][codimd] ([Search repository][codimd-search])
|
|
965
|
+
- [Electron][electron] ([Search repository][electron-search])
|
|
966
|
+
- [ESLint][eslint] ([Search repository][eslint-search])
|
|
967
|
+
- [Garden React Components][garden] ([Search repository][garden-search])
|
|
968
|
+
- [MDN Web Docs][mdn] ([Search repository][mdn-search])
|
|
969
|
+
- [MkDocs][mkdocs] ([Search repository][mkdocs-search])
|
|
970
|
+
- [Mocha][mocha] ([Search repository][mocha-search])
|
|
971
|
+
- [Pi-hole documentation][pi-hole] ([Search repository][pi-hole-search])
|
|
972
|
+
- [Reactable][reactable] ([Search repository][reactable-search])
|
|
973
|
+
- [V8][v8] ([Search repository][v8-search])
|
|
974
|
+
- [webhint][webhint] ([Search repository][webhint-search])
|
|
975
|
+
- [webpack][webpack] ([Search repository][webpack-search])
|
|
976
|
+
- [WordPress][wordpress] ([Search repository][wordpress-search])
|
|
977
|
+
|
|
978
|
+
[ally-js]: https://allyjs.io/
|
|
979
|
+
[ally-js-search]: https://github.com/medialize/ally.js/search?q=markdownlint
|
|
980
|
+
[airflow]: https://airflow.apache.org
|
|
981
|
+
[airflow-search]: https://github.com/apache/airflow/search?q=markdownlint
|
|
982
|
+
[boostnote]: https://boostnote.io/
|
|
983
|
+
[boostnote-search]: https://github.com/BoostIO/Boostnote/search?q=markdownlint
|
|
984
|
+
[codimd]: https://github.com/hackmdio/codimd
|
|
985
|
+
[codimd-search]: https://github.com/hackmdio/codimd/search?q=markdownlint
|
|
986
|
+
[dot-net-doc]: https://docs.microsoft.com/en-us/dotnet/
|
|
987
|
+
[dot-net-doc-search]: https://github.com/dotnet/docs/search?q=markdownlint
|
|
988
|
+
[electron]: https://www.electronjs.org
|
|
989
|
+
[electron-search]: https://github.com/electron/electron/search?q=markdownlint
|
|
990
|
+
[eslint]: https://eslint.org/
|
|
991
|
+
[eslint-search]: https://github.com/eslint/eslint/search?q=markdownlint
|
|
992
|
+
[garden]: https://zendeskgarden.github.io/react-components/
|
|
993
|
+
[garden-search]: https://github.com/zendeskgarden/react-components/search?q=markdownlint
|
|
994
|
+
[mdn]: https://developer.mozilla.org/
|
|
995
|
+
[mdn-search]: https://github.com/mdn/content/search?q=markdownlint
|
|
996
|
+
[mkdocs]: https://www.mkdocs.org/
|
|
997
|
+
[mkdocs-search]: https://github.com/mkdocs/mkdocs/search?q=markdownlint
|
|
998
|
+
[mocha]: https://mochajs.org/
|
|
999
|
+
[mocha-search]: https://github.com/mochajs/mocha/search?q=markdownlint
|
|
1000
|
+
[pi-hole]: https://docs.pi-hole.net
|
|
1001
|
+
[pi-hole-search]: https://github.com/pi-hole/docs/search?q=markdownlint
|
|
1002
|
+
[reactable]: https://glittershark.github.io/reactable/
|
|
1003
|
+
[reactable-search]: https://github.com/glittershark/reactable/search?q=markdownlint
|
|
1004
|
+
[v8]: https://v8.dev/
|
|
1005
|
+
[v8-search]: https://github.com/v8/v8.dev/search?q=markdownlint
|
|
1006
|
+
[webhint]: https://webhint.io/
|
|
1007
|
+
[webhint-search]: https://github.com/webhintio/hint/search?q=markdownlint
|
|
1008
|
+
[webpack]: https://webpack.js.org/
|
|
1009
|
+
[webpack-search]: https://github.com/webpack/webpack.js.org/search?q=markdownlint
|
|
1010
|
+
[wordpress]: https://wordpress.org/gutenberg/
|
|
1011
|
+
[wordpress-search]: https://github.com/WordPress/gutenberg/search?q=markdownlint
|
|
920
1012
|
|
|
921
1013
|
## Contributing
|
|
922
1014
|
|
|
923
1015
|
See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
924
1016
|
|
|
1017
|
+
## Releasing
|
|
1018
|
+
|
|
1019
|
+
See [ReleaseProcess.md](doc/ReleaseProcess.md) for more information.
|
|
1020
|
+
|
|
925
1021
|
## History
|
|
926
1022
|
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1023
|
+
- 0.0.1 - Initial release, includes tests MD001-MD032.
|
|
1024
|
+
- 0.0.2 - Improve documentation, tests, and code.
|
|
1025
|
+
- 0.0.3 - Add synchronous API, improve documentation and code.
|
|
1026
|
+
- 0.0.4 - Add tests MD033-MD040, update dependencies.
|
|
1027
|
+
- 0.0.5 - Add `strings` option to enable file-less scenarios, add in-browser
|
|
1028
|
+
demo.
|
|
1029
|
+
- 0.0.6 - Improve performance, simplify in-browser, update dependencies.
|
|
1030
|
+
- 0.0.7 - Add MD041, improve MD003, ignore front matter, update dependencies.
|
|
1031
|
+
- 0.0.8 - Support disabling/enabling rules inline, improve code fence,
|
|
1032
|
+
dependencies.
|
|
1033
|
+
- 0.1.0 - Add aliases, exceptions for MD033, exclusions for MD013, dependencies.
|
|
1034
|
+
- 0.1.1 - Fix bug handling HTML in tables, reference markdownlint-cli.
|
|
1035
|
+
- 0.2.0 - Add MD042/MD043, enhance MD002/MD003/MD004/MD007/MD011/MD025/MD041,
|
|
1036
|
+
dependencies.
|
|
1037
|
+
- 0.3.0 - More detailed error reporting with `resultVersion`, enhance
|
|
1038
|
+
MD010/MD012/MD036, fixes for MD027/MD029/MD030, include JSON schema,
|
|
1039
|
+
dependencies.
|
|
1040
|
+
- 0.3.1 - Fix regressions in MD032/MD038, update dependencies.
|
|
1041
|
+
- 0.4.0 - Add MD044, enhance MD013/MD032/MD041/MD042/MD043, fix for MD038,
|
|
1042
|
+
dependencies.
|
|
1043
|
+
- 0.4.1 - Fixes for MD038/front matter, improvements to MD044, update
|
|
1044
|
+
dependencies.
|
|
1045
|
+
- 0.5.0 - Add shareable configuration, `noInlineConfig` option, README links,
|
|
1046
|
+
fix MD030, improve MD009/MD041, update dependencies.
|
|
1047
|
+
- 0.6.0 - `resultVersion` defaults to 1 (breaking change), ignore HTML comments,
|
|
1048
|
+
TOML front matter, fixes for MD044, update dependencies.
|
|
1049
|
+
- 0.6.1 - Update `markdown-it` versioning, exclude demo/test from publishing.
|
|
1050
|
+
- 0.6.2 - Improve MD013/MD027/MD034/MD037/MD038/MD041/MD044, update
|
|
1051
|
+
dependencies.
|
|
1052
|
+
- 0.6.3 - Improve highlighting for MD020.
|
|
1053
|
+
- 0.6.4 - Improve MD029/MD042, update dependencies.
|
|
1054
|
+
- 0.7.0 - `resultVersion` defaults to 2 (breaking change), add MD045, improve
|
|
1055
|
+
MD029, remove trimLeft/trimRight, split rules, refactor, update
|
|
1056
|
+
dependencies.
|
|
1057
|
+
- 0.8.0 - Add support for using and authoring custom rules, improve
|
|
1058
|
+
MD004/MD007/MD013, add `engines` to `package.json`, refactor, update
|
|
1059
|
+
dependencies.
|
|
1060
|
+
- 0.8.1 - Update item loop to be iterative, improve MD014, update
|
|
1061
|
+
dependencies.
|
|
1062
|
+
- 0.9.0 - Remove support for end-of-life Node versions 0.10/0.12/4, change
|
|
1063
|
+
"header" to "heading" per spec (non-breaking), improve
|
|
1064
|
+
MD003/MD009/MD041, handle uncommon line-break characters, refactor for
|
|
1065
|
+
ES6, update dependencies.
|
|
1066
|
+
- 0.10.0 - Add support for non-JSON configuration files, pass file/string name
|
|
1067
|
+
to custom rules, update dependencies.
|
|
1068
|
+
- 0.11.0 - Improve MD005/MD024/MD029/MD038, improve custom rule example, add
|
|
1069
|
+
CONTRIBUTING.md, update dependencies.
|
|
1070
|
+
- 0.12.0 - Add `information` link for custom rules, `markdownItPlugins` for
|
|
1071
|
+
extensibility, improve MD023/MD032/MD038, update dependencies.
|
|
1072
|
+
- 0.13.0 - Improve MD013/MD022/MD025/MD029/MD031/MD032/MD037/MD041/, deprecate
|
|
1073
|
+
MD002, improve pandoc YAML support, update dependencies.
|
|
1074
|
+
- 0.14.0 - Remove support for end-of-life Node version 6, introduce
|
|
1075
|
+
`markdownlint-rule-helpers`, add MD046/MD047, improve
|
|
1076
|
+
MD033/MD034/MD039, improve custom rule validation and in-browser
|
|
1077
|
+
demo, update dependencies.
|
|
1078
|
+
- 0.14.1 - Improve MD033.
|
|
1079
|
+
- 0.14.2 - Improve MD047, add `handleRuleFailures` option.
|
|
1080
|
+
- 0.15.0 - Add `markdownlint-capture`/`markdownlint-restore` inline comments,
|
|
1081
|
+
improve MD009/MD013/MD026/MD033/MD036, update dependencies.
|
|
1082
|
+
- 0.16.0 - Add custom rule sample for linting code, improve
|
|
1083
|
+
MD026/MD031/MD033/MD038, update dependencies.
|
|
1084
|
+
- 0.17.0 - Add `resultVersion` 3 to support fix information for default and
|
|
1085
|
+
custom rules, add fix information for 24 rules, update newline
|
|
1086
|
+
handling to match latest CommonMark specification, improve
|
|
1087
|
+
MD014/MD037/MD039, update dependencies.
|
|
1088
|
+
- 0.17.1 - Fix handling of front matter by fix information.
|
|
1089
|
+
- 0.17.2 - Improve MD020/MD033/MD044.
|
|
1090
|
+
- 0.18.0 - Add MD048/code-fence-style, add fix information for MD007/ul-indent,
|
|
1091
|
+
add `markdownlint-disable-file`/`markdownlint-enable-file` inline
|
|
1092
|
+
comments, add type declaration file (.d.ts) for TypeScript
|
|
1093
|
+
dependents, update schema, improve MD006/MD007/MD009/MD013/MD030,
|
|
975
1094
|
update dependencies.
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
* 0.20.2 - Fix regression in MD037, improve MD038.
|
|
994
|
-
* 0.20.3 - Fix regression in MD037, improve MD044, add automatic regression testing.
|
|
995
|
-
* 0.20.4 - Fix regression in MD037, improve MD034/MD044, improve documentation.
|
|
996
|
-
* 0.21.0 - Lint concurrently for better performance (async only), add Promise-based APIs,
|
|
997
|
-
update TypeScript declaration file, hide `toString` on `LintResults`, add ability
|
|
998
|
-
to fix in browser demo, allow custom rules in `.markdownlint.json` schema, improve
|
|
1095
|
+
- 0.19.0 - Remove support for end-of-life Node version 8, add fix information
|
|
1096
|
+
for MD005/list-indent, improve MD007/MD013/MD014, deprecate
|
|
1097
|
+
MD006/ul-start-left, add rationale for every rule, update test runner
|
|
1098
|
+
and code coverage, add more JSDoc comments, update dependencies.
|
|
1099
|
+
- 0.20.0 - Add `markdownlint-configure-file` inline comment, reimplement MD037,
|
|
1100
|
+
improve MD005/MD007/MD013/MD018/MD029/MD031/MD034/MD038/MD039,
|
|
1101
|
+
improve HTML comment handling, update dependencies.
|
|
1102
|
+
- 0.20.1 - Fix regression in MD037.
|
|
1103
|
+
- 0.20.2 - Fix regression in MD037, improve MD038.
|
|
1104
|
+
- 0.20.3 - Fix regression in MD037, improve MD044, add automatic regression
|
|
1105
|
+
testing.
|
|
1106
|
+
- 0.20.4 - Fix regression in MD037, improve MD034/MD044, improve
|
|
1107
|
+
documentation.
|
|
1108
|
+
- 0.21.0 - Lint concurrently for better performance (async only), add
|
|
1109
|
+
Promise-based APIs, update TypeScript declaration file, hide
|
|
1110
|
+
`toString` on `LintResults`, add ability to fix in browser demo,
|
|
1111
|
+
allow custom rules in `.markdownlint.json` schema, improve
|
|
999
1112
|
MD042/MD044, improve documentation, update dependencies.
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
`markdownlint-disable-next-line` inline comment, support JSON
|
|
1003
|
-
MD009/MD026/MD028/MD043, update dependencies
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
improve
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1113
|
+
- 0.21.1 - Improve MD011/MD031, export `getVersion` API.
|
|
1114
|
+
- 0.22.0 - Allow `extends` in config to reference installed packages by name,
|
|
1115
|
+
add `markdownlint-disable-next-line` inline comment, support JSON
|
|
1116
|
+
front matter, improve MD009/MD026/MD028/MD043, update dependencies
|
|
1117
|
+
(including `markdown-it` to v12).
|
|
1118
|
+
- 0.23.0 - Add comprehensive example `.markdownlint.jsonc`/`.markdownlint.yaml`
|
|
1119
|
+
files, add fix information for MD004/ul-style, improve
|
|
1120
|
+
MD018/MD019/MD020/MD021/MD037/MD041, improve HTML comment handling,
|
|
1121
|
+
update test runner and test suite, update dependencies.
|
|
1122
|
+
- 0.23.1 - Work around lack of webpack support for dynamic calls to
|
|
1123
|
+
`require`(`.resolve`).
|
|
1124
|
+
- 0.24.0 - Remove support for end-of-life Node version 10, add support for
|
|
1125
|
+
custom file system module, improve MD010/MD011/MD037/MD043/MD044,
|
|
1126
|
+
improve TypeScript declaration file and JSON schema, update
|
|
1127
|
+
dependencies.
|
|
1128
|
+
- 0.25.0 - Add MD049/MD050 for consistent emphasis/strong style (both
|
|
1129
|
+
auto-fixable), improve MD007/MD010/MD032/MD033/MD035/MD037/MD039,
|
|
1130
|
+
support asynchronous custom rules, improve performance, improve CI
|
|
1131
|
+
process, reduce dependencies, update dependencies.
|
|
1132
|
+
- 0.25.1 - Update dependencies for CVE-2022-21670.
|
|
1133
|
+
- 0.26.0 - Add MD051/MD052/MD053 for validating link fragments & reference
|
|
1134
|
+
links/images & link/image reference definitions (MD053 auto-fixable),
|
|
1135
|
+
improve MD010/MD031/MD035/MD039/MD042/MD044/MD049/MD050, add
|
|
1136
|
+
`markdownlint-disable-line` inline comment, support `~` paths in
|
|
1137
|
+
`readConfig/Sync`, add `configParsers` option, remove support for
|
|
1138
|
+
end-of-life Node version 12, default `resultVersion` to 3, update
|
|
1139
|
+
browser script to use ES2015, simplify JSON schema, address remaining
|
|
1140
|
+
CodeQL issues, improve performance, update dependencies.
|
|
1141
|
+
- 0.26.1 - Improve MD051.
|
|
1142
|
+
- 0.26.2 - Improve MD037/MD051/MD053.
|
|
1143
|
+
- 0.27.0 - Improve MD011/MD013/MD022/MD031/MD032/MD033/MD034/MD040/MD043/MD051/
|
|
1144
|
+
MD053, generate/separate documentation, improve documentation, update
|
|
1145
|
+
dependencies.
|
|
1023
1146
|
|
|
1024
1147
|
[npm-image]: https://img.shields.io/npm/v/markdownlint.svg
|
|
1025
1148
|
[npm-url]: https://www.npmjs.com/package/markdownlint
|