markdownlint 0.21.0 → 0.23.1
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 +1 -0
- package/LICENSE +1 -1
- package/README.md +106 -70
- package/demo/markdownlint-browser.js +1037 -1600
- package/doc/Rules.md +106 -76
- package/helpers/LICENSE +1 -1
- package/helpers/helpers.js +83 -33
- package/helpers/package.json +1 -1
- package/lib/markdownlint.d.ts +11 -5
- package/lib/markdownlint.js +102 -38
- package/lib/md002.js +1 -1
- package/lib/md004.js +46 -13
- package/lib/md006.js +1 -1
- package/lib/md009.js +25 -23
- package/lib/md011.js +10 -6
- package/lib/md018.js +1 -1
- package/lib/md019.js +1 -1
- package/lib/md020.js +1 -1
- package/lib/md021.js +1 -1
- package/lib/md023.js +1 -1
- package/lib/md025.js +1 -1
- package/lib/md026.js +7 -4
- package/lib/md028.js +1 -9
- package/lib/md031.js +6 -5
- package/lib/md032.js +2 -2
- package/lib/md037.js +22 -8
- package/lib/md039.js +2 -2
- package/lib/md041.js +14 -3
- package/lib/md043.js +22 -11
- package/lib/rules.js +2 -1
- package/package.json +32 -33
- package/schema/.markdownlint.jsonc +250 -0
- package/schema/.markdownlint.yaml +225 -0
- package/schema/markdownlint-config-schema.json +23 -20
- package/schema/build-config-schema.js +0 -410
package/CONTRIBUTING.md
CHANGED
|
@@ -43,6 +43,7 @@ Open pull requests against the `next` branch.
|
|
|
43
43
|
That's where the latest changes are staged for the next release.
|
|
44
44
|
Include the text "(fixes #??)" at the end of the commit message so the pull request will be associated with the relevant issue.
|
|
45
45
|
End commit messages with a period (`.`).
|
|
46
|
+
Do not include `package-lock.json` in the pull request.
|
|
46
47
|
Once accepted, the tag `fixed in next` will be added to the issue.
|
|
47
48
|
When the commit is merged to the main branch during the release process, the issue will be closed automatically.
|
|
48
49
|
(See [Closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/) for details.)
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -14,12 +14,13 @@ npm install markdownlint --save-dev
|
|
|
14
14
|
|
|
15
15
|
## Overview
|
|
16
16
|
|
|
17
|
-
The [Markdown](https://en.wikipedia.org/wiki/Markdown) markup language
|
|
18
|
-
designed to be easy to read, write, and understand. It succeeds -
|
|
19
|
-
flexibility is both a benefit and a drawback. Many styles are
|
|
20
|
-
formatting can be inconsistent. Some constructs don't
|
|
21
|
-
parsers and should be avoided. The
|
|
22
|
-
specification standardizes
|
|
17
|
+
The [Markdown](https://en.wikipedia.org/wiki/Markdown) markup language
|
|
18
|
+
is designed to be easy to read, write, and understand. It succeeds -
|
|
19
|
+
and its flexibility is both a benefit and a drawback. Many styles are
|
|
20
|
+
possible, so formatting can be inconsistent. Some constructs don't
|
|
21
|
+
work well in all parsers and should be avoided. The
|
|
22
|
+
[CommonMark](https://commonmark.org/) specification standardizes
|
|
23
|
+
parsers - but not authors.
|
|
23
24
|
|
|
24
25
|
`markdownlint` is a
|
|
25
26
|
[static analysis](https://en.wikipedia.org/wiki/Static_program_analysis)
|
|
@@ -39,7 +40,7 @@ and test cases came directly from that project.
|
|
|
39
40
|
* [GitHub Super-Linter Action](https://github.com/github/super-linter)
|
|
40
41
|
* [GitHub Actions problem matcher for markdownlint-cli](https://github.com/xt0rted/markdownlint-problem-matcher)
|
|
41
42
|
* Editor
|
|
42
|
-
* [vscode-markdownlint extension for VS Code](https://marketplace.visualstudio.com/items
|
|
43
|
+
* [vscode-markdownlint extension for VS Code](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
|
|
43
44
|
* [Sublime Text markdownlint for Sublime Text](https://packagecontrol.io/packages/SublimeLinter-contrib-markdownlint)
|
|
44
45
|
* [linter-node-markdownlint extension for Atom](https://atom.io/packages/linter-node-markdownlint)
|
|
45
46
|
* [coc-markdownlint extension for Vim/Neovim](https://github.com/fannheyward/coc-markdownlint)
|
|
@@ -56,8 +57,10 @@ playground for learning and exploring.
|
|
|
56
57
|
|
|
57
58
|
## Rules / Aliases
|
|
58
59
|
|
|
60
|
+
<!-- markdownlint-disable line-length -->
|
|
61
|
+
|
|
59
62
|
* **[MD001](doc/Rules.md#md001)** *heading-increment/header-increment* - Heading levels should only increment by one level at a time
|
|
60
|
-
* ~~**[MD002](doc/Rules.md#md002)** *first-heading-h1/first-header-h1* - First heading should be a top
|
|
63
|
+
* ~~**[MD002](doc/Rules.md#md002)** *first-heading-h1/first-header-h1* - First heading should be a top-level heading~~
|
|
61
64
|
* **[MD003](doc/Rules.md#md003)** *heading-style/header-style* - Heading style
|
|
62
65
|
* **[MD004](doc/Rules.md#md004)** *ul-style* - Unordered list style
|
|
63
66
|
* **[MD005](doc/Rules.md#md005)** *list-indent* - Inconsistent indentation for list items at the same level
|
|
@@ -76,7 +79,7 @@ playground for learning and exploring.
|
|
|
76
79
|
* **[MD022](doc/Rules.md#md022)** *blanks-around-headings/blanks-around-headers* - Headings should be surrounded by blank lines
|
|
77
80
|
* **[MD023](doc/Rules.md#md023)** *heading-start-left/header-start-left* - Headings must start at the beginning of the line
|
|
78
81
|
* **[MD024](doc/Rules.md#md024)** *no-duplicate-heading/no-duplicate-header* - Multiple headings with the same content
|
|
79
|
-
* **[MD025](doc/Rules.md#md025)** *single-title/single-h1* - Multiple top
|
|
82
|
+
* **[MD025](doc/Rules.md#md025)** *single-title/single-h1* - Multiple top-level headings in the same document
|
|
80
83
|
* **[MD026](doc/Rules.md#md026)** *no-trailing-punctuation* - Trailing punctuation in heading
|
|
81
84
|
* **[MD027](doc/Rules.md#md027)** *no-multiple-space-blockquote* - Multiple spaces after blockquote symbol
|
|
82
85
|
* **[MD028](doc/Rules.md#md028)** *no-blanks-blockquote* - Blank line inside blockquote
|
|
@@ -92,7 +95,7 @@ playground for learning and exploring.
|
|
|
92
95
|
* **[MD038](doc/Rules.md#md038)** *no-space-in-code* - Spaces inside code span elements
|
|
93
96
|
* **[MD039](doc/Rules.md#md039)** *no-space-in-links* - Spaces inside link text
|
|
94
97
|
* **[MD040](doc/Rules.md#md040)** *fenced-code-language* - Fenced code blocks should have a language specified
|
|
95
|
-
* **[MD041](doc/Rules.md#md041)** *first-line-heading/first-line-h1* - First line in file should be a top
|
|
98
|
+
* **[MD041](doc/Rules.md#md041)** *first-line-heading/first-line-h1* - First line in a file should be a top-level heading
|
|
96
99
|
* **[MD042](doc/Rules.md#md042)** *no-empty-links* - No empty links
|
|
97
100
|
* **[MD043](doc/Rules.md#md043)** *required-headings/required-headers* - Required heading structure
|
|
98
101
|
* **[MD044](doc/Rules.md#md044)** *proper-names* - Proper names should have the correct capitalization
|
|
@@ -101,17 +104,20 @@ playground for learning and exploring.
|
|
|
101
104
|
* **[MD047](doc/Rules.md#md047)** *single-trailing-newline* - Files should end with a single newline character
|
|
102
105
|
* **[MD048](doc/Rules.md#md048)** *code-fence-style* - Code fence style
|
|
103
106
|
|
|
107
|
+
<!-- markdownlint-restore -->
|
|
108
|
+
|
|
104
109
|
See [Rules.md](doc/Rules.md) for more details.
|
|
105
110
|
|
|
106
111
|
~~Struck through~~ rules are deprecated, and provided for backward-compatibility.
|
|
107
112
|
|
|
108
|
-
> All rules with `heading` as part of their name are also available as
|
|
109
|
-
> aliases (e.g. `heading-increment` is also available as `header-increment`).
|
|
113
|
+
> All rules with `heading` as part of their name are also available as
|
|
114
|
+
> `header` aliases (e.g. `heading-increment` is also available as `header-increment`).
|
|
110
115
|
> The use of `header` is deprecated and provided for backward-compatibility.
|
|
111
116
|
|
|
112
117
|
## Tags
|
|
113
118
|
|
|
114
|
-
Tags group related rules and can be used to enable/disable multiple
|
|
119
|
+
Tags group related rules and can be used to enable/disable multiple
|
|
120
|
+
rules at once.
|
|
115
121
|
|
|
116
122
|
* **accessibility** - MD045
|
|
117
123
|
* **atx** - MD018, MD019
|
|
@@ -122,10 +128,10 @@ Tags group related rules and can be used to enable/disable multiple rules at onc
|
|
|
122
128
|
* **code** - MD014, MD031, MD038, MD040, MD046, MD048
|
|
123
129
|
* **emphasis** - MD036, MD037
|
|
124
130
|
* **hard_tab** - MD010
|
|
125
|
-
* **headers** - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022,
|
|
126
|
-
MD024, MD025, MD026, MD036, MD041, MD043
|
|
127
|
-
* **headings** - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022,
|
|
128
|
-
MD024, MD025, MD026, MD036, MD041, MD043
|
|
131
|
+
* **headers** - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022,
|
|
132
|
+
MD023, MD024, MD025, MD026, MD036, MD041, MD043
|
|
133
|
+
* **headings** - MD001, MD002, MD003, MD018, MD019, MD020, MD021, MD022,
|
|
134
|
+
MD023, MD024, MD025, MD026, MD036, MD041, MD043
|
|
129
135
|
* **hr** - MD035
|
|
130
136
|
* **html** - MD033
|
|
131
137
|
* **images** - MD045
|
|
@@ -138,30 +144,42 @@ Tags group related rules and can be used to enable/disable multiple rules at onc
|
|
|
138
144
|
* **spelling** - MD044
|
|
139
145
|
* **ul** - MD004, MD005, MD006, MD007, MD030, MD032
|
|
140
146
|
* **url** - MD034
|
|
141
|
-
* **whitespace** - MD009, MD010, MD012, MD027, MD028, MD030, MD037,
|
|
147
|
+
* **whitespace** - MD009, MD010, MD012, MD027, MD028, MD030, MD037,
|
|
148
|
+
MD038, MD039
|
|
142
149
|
|
|
143
150
|
## Configuration
|
|
144
151
|
|
|
145
|
-
Text passed to `markdownlint` is parsed as Markdown, analyzed, and any
|
|
146
|
-
Two kinds of text are ignored:
|
|
152
|
+
Text passed to `markdownlint` is parsed as Markdown, analyzed, and any
|
|
153
|
+
issues reported. Two kinds of text are ignored:
|
|
147
154
|
|
|
148
155
|
* [HTML comments](https://www.w3.org/TR/html5/syntax.html#comments)
|
|
149
|
-
* [Front matter](https://jekyllrb.com/docs/frontmatter/) (see
|
|
156
|
+
* [Front matter](https://jekyllrb.com/docs/frontmatter/) (see
|
|
157
|
+
`options.frontMatter` below)
|
|
150
158
|
|
|
151
|
-
Rules can be enabled, disabled, and configured via `options.config`
|
|
152
|
-
below) to define the expected behavior for a set of inputs.
|
|
153
|
-
rules at a particular location within a file, add
|
|
154
|
-
appropriate place (HTML comments don't
|
|
159
|
+
Rules can be enabled, disabled, and configured via `options.config`
|
|
160
|
+
(described below) to define the expected behavior for a set of inputs.
|
|
161
|
+
To enable or disable rules at a particular location within a file, add
|
|
162
|
+
one of these markers to the appropriate place (HTML comments don't
|
|
163
|
+
appear in the final markup):
|
|
155
164
|
|
|
156
165
|
* Disable all rules: `<!-- markdownlint-disable -->`
|
|
157
166
|
* Enable all rules: `<!-- markdownlint-enable -->`
|
|
167
|
+
* Disable all rules for the next line only: `<!-- markdownlint-disable-next-line -->`
|
|
158
168
|
* Disable one or more rules by name: `<!-- markdownlint-disable MD001 MD005 -->`
|
|
159
169
|
* Enable one or more rules by name: `<!-- markdownlint-enable MD001 MD005 -->`
|
|
170
|
+
* Disable one or more rules by name for the next line only: `<!-- markdownlint-disable-next-line MD001 MD005 -->`
|
|
160
171
|
* Capture the current rule configuration: `<!-- markdownlint-capture -->`
|
|
161
172
|
* Restore the captured rule configuration: `<!-- markdownlint-restore -->`
|
|
162
173
|
|
|
163
174
|
For example:
|
|
164
175
|
|
|
176
|
+
```markdown
|
|
177
|
+
<!-- markdownlint-disable-next-line no-space-in-emphasis -->
|
|
178
|
+
deliberate space * in * emphasis
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Or:
|
|
182
|
+
|
|
165
183
|
```markdown
|
|
166
184
|
<!-- markdownlint-disable no-space-in-emphasis -->
|
|
167
185
|
deliberate space * in * emphasis
|
|
@@ -177,9 +195,9 @@ any violations you want
|
|
|
177
195
|
<!-- markdownlint-restore -->
|
|
178
196
|
```
|
|
179
197
|
|
|
180
|
-
The initial configuration is captured by default (as if every document
|
|
181
|
-
with `<!-- markdownlint-capture -->`), so the pattern above can
|
|
182
|
-
more simply:
|
|
198
|
+
The initial configuration is captured by default (as if every document
|
|
199
|
+
began with `<!-- markdownlint-capture -->`), so the pattern above can
|
|
200
|
+
be expressed more simply:
|
|
183
201
|
|
|
184
202
|
```markdown
|
|
185
203
|
<!-- markdownlint-disable -->
|
|
@@ -204,8 +222,8 @@ the following syntax is supported:
|
|
|
204
222
|
|
|
205
223
|
This can be used to "hide" `markdownlint` comments at the bottom of a file.
|
|
206
224
|
|
|
207
|
-
In cases where it is desirable to change the configuration of one or
|
|
208
|
-
for a file, the following more advanced syntax is supported:
|
|
225
|
+
In cases where it is desirable to change the configuration of one or
|
|
226
|
+
more rules for a file, the following more advanced syntax is supported:
|
|
209
227
|
|
|
210
228
|
* Configure: `<!-- markdownlint-configure-file { options.config JSON } -->`
|
|
211
229
|
|
|
@@ -228,8 +246,8 @@ or
|
|
|
228
246
|
-->
|
|
229
247
|
```
|
|
230
248
|
|
|
231
|
-
These changes apply to the entire file regardless of where the comment
|
|
232
|
-
located. Multiple such comments (if present) are applied top-to-bottom.
|
|
249
|
+
These changes apply to the entire file regardless of where the comment
|
|
250
|
+
is located. Multiple such comments (if present) are applied top-to-bottom.
|
|
233
251
|
|
|
234
252
|
## API
|
|
235
253
|
|
|
@@ -285,8 +303,9 @@ Type: `Array` of `Object`
|
|
|
285
303
|
|
|
286
304
|
List of custom rules to include with the default rule set for linting.
|
|
287
305
|
|
|
288
|
-
Each array element should define a rule. Rules are typically exported
|
|
289
|
-
package, but can be defined locally. Custom rules are
|
|
306
|
+
Each array element should define a rule. Rules are typically exported
|
|
307
|
+
by another package, but can be defined locally. Custom rules are
|
|
308
|
+
identified by the
|
|
290
309
|
[keyword `markdownlint-rule` on npm](https://www.npmjs.com/search?q=keywords:markdownlint-rule).
|
|
291
310
|
|
|
292
311
|
Example:
|
|
@@ -298,7 +317,8 @@ const options = {
|
|
|
298
317
|
};
|
|
299
318
|
```
|
|
300
319
|
|
|
301
|
-
See [CustomRules.md](doc/CustomRules.md) for details about authoring
|
|
320
|
+
See [CustomRules.md](doc/CustomRules.md) for details about authoring
|
|
321
|
+
custom rules.
|
|
302
322
|
|
|
303
323
|
##### options.files
|
|
304
324
|
|
|
@@ -307,8 +327,8 @@ Type: `Array` of `String`
|
|
|
307
327
|
List of files to lint.
|
|
308
328
|
|
|
309
329
|
Each array element should be a single file (via relative or absolute path);
|
|
310
|
-
[globbing](https://en.wikipedia.org/wiki/Glob_%28programming%29) is the
|
|
311
|
-
responsibility.
|
|
330
|
+
[globbing](https://en.wikipedia.org/wiki/Glob_%28programming%29) is the
|
|
331
|
+
caller's responsibility.
|
|
312
332
|
|
|
313
333
|
Example: `[ "one.md", "dir/two.md" ]`
|
|
314
334
|
|
|
@@ -318,9 +338,9 @@ Type: `Object` mapping `String` to `String`
|
|
|
318
338
|
|
|
319
339
|
Map of identifiers to strings for linting.
|
|
320
340
|
|
|
321
|
-
When Markdown content is not available as files, it can be passed as
|
|
322
|
-
The keys of the `strings` object are used to identify each
|
|
323
|
-
`result` summary.
|
|
341
|
+
When Markdown content is not available as files, it can be passed as
|
|
342
|
+
strings. The keys of the `strings` object are used to identify each
|
|
343
|
+
input value in the `result` summary.
|
|
324
344
|
|
|
325
345
|
Example:
|
|
326
346
|
|
|
@@ -340,12 +360,13 @@ Configures the rules to use.
|
|
|
340
360
|
Object keys are rule names or aliases and values are the rule's configuration.
|
|
341
361
|
The value `false` disables a rule, `true` enables its default configuration,
|
|
342
362
|
and passing an object customizes its settings. Setting the special `default`
|
|
343
|
-
rule to `true` or `false` includes/excludes all rules by default. Enabling
|
|
344
|
-
disabling a tag name (ex: `whitespace`) affects all rules having that
|
|
363
|
+
rule to `true` or `false` includes/excludes all rules by default. Enabling
|
|
364
|
+
or disabling a tag name (ex: `whitespace`) affects all rules having that
|
|
365
|
+
tag.
|
|
345
366
|
|
|
346
|
-
The `default` rule is applied first, then keys are processed in order
|
|
347
|
-
to bottom with later values overriding earlier ones. Keys
|
|
348
|
-
aliases, tags, and `default`) are not case-sensitive.
|
|
367
|
+
The `default` rule is applied first, then keys are processed in order
|
|
368
|
+
from top to bottom with later values overriding earlier ones. Keys
|
|
369
|
+
(including rule names, aliases, tags, and `default`) are not case-sensitive.
|
|
349
370
|
|
|
350
371
|
Example:
|
|
351
372
|
|
|
@@ -359,8 +380,12 @@ Example:
|
|
|
359
380
|
}
|
|
360
381
|
```
|
|
361
382
|
|
|
362
|
-
|
|
363
|
-
[
|
|
383
|
+
See [.markdownlint.jsonc](schema/.markdownlint.jsonc) and/or
|
|
384
|
+
[.markdownlint.yaml](schema/.markdownlint.yaml) for an example
|
|
385
|
+
configuration object with all properties set to the default value.
|
|
386
|
+
|
|
387
|
+
Sets of rules (known as a "style") can be stored separately and loaded
|
|
388
|
+
as [JSON](https://en.wikipedia.org/wiki/JSON).
|
|
364
389
|
|
|
365
390
|
Example:
|
|
366
391
|
|
|
@@ -374,10 +399,12 @@ const options = {
|
|
|
374
399
|
See the [style](style) directory for more samples.
|
|
375
400
|
|
|
376
401
|
See [markdownlint-config-schema.json](schema/markdownlint-config-schema.json)
|
|
377
|
-
for the [JSON Schema](https://json-schema.org/) of the `options.config`
|
|
402
|
+
for the [JSON Schema](https://json-schema.org/) of the `options.config`
|
|
403
|
+
object.
|
|
378
404
|
|
|
379
|
-
For more advanced scenarios, styles can reference and extend other styles.
|
|
380
|
-
`readConfig` and `readConfigSync` functions can be used to read such
|
|
405
|
+
For more advanced scenarios, styles can reference and extend other styles.
|
|
406
|
+
The `readConfig` and `readConfigSync` functions can be used to read such
|
|
407
|
+
styles.
|
|
381
408
|
|
|
382
409
|
For example, assuming a `base.json` configuration file:
|
|
383
410
|
|
|
@@ -419,21 +446,22 @@ const options = {
|
|
|
419
446
|
|
|
420
447
|
Type: `RegExp`
|
|
421
448
|
|
|
422
|
-
Matches any [front matter](https://jekyllrb.com/docs/frontmatter/)
|
|
423
|
-
beginning of a file.
|
|
449
|
+
Matches any [front matter](https://jekyllrb.com/docs/frontmatter/)
|
|
450
|
+
found at the beginning of a file.
|
|
424
451
|
|
|
425
|
-
Some Markdown content begins with metadata; the default `RegExp` for
|
|
426
|
-
ignores common forms of "front matter". To match differently,
|
|
427
|
-
`RegExp` or use the value `null` to disable the feature.
|
|
452
|
+
Some Markdown content begins with metadata; the default `RegExp` for
|
|
453
|
+
this option ignores common forms of "front matter". To match differently,
|
|
454
|
+
specify a custom `RegExp` or use the value `null` to disable the feature.
|
|
428
455
|
|
|
429
456
|
The default value:
|
|
430
457
|
|
|
431
458
|
```js
|
|
432
|
-
/((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$))(\r\n|\r|\n|$)/m
|
|
459
|
+
/((^---\s*$[^]*?^---\s*$)|(^\+\+\+\s*$[^]*?^(\+\+\+|\.\.\.)\s*$)|(^\{\s*$[^]*?^\}\s*$))(\r\n|\r|\n|$)/m
|
|
433
460
|
```
|
|
434
461
|
|
|
435
|
-
Ignores [YAML](https://en.wikipedia.org/wiki/YAML)
|
|
436
|
-
[TOML](https://en.wikipedia.org/wiki/TOML)
|
|
462
|
+
Ignores [YAML](https://en.wikipedia.org/wiki/YAML),
|
|
463
|
+
[TOML](https://en.wikipedia.org/wiki/TOML), and
|
|
464
|
+
[JSON](https://en.wikipedia.org/wiki/JSON) front matter such as:
|
|
437
465
|
|
|
438
466
|
```text
|
|
439
467
|
---
|
|
@@ -448,16 +476,16 @@ Note: Matches must occur at the start of the file.
|
|
|
448
476
|
|
|
449
477
|
Type: `Boolean`
|
|
450
478
|
|
|
451
|
-
Catches exceptions thrown during rule processing and reports the problem
|
|
452
|
-
rule violation.
|
|
479
|
+
Catches exceptions thrown during rule processing and reports the problem
|
|
480
|
+
as a rule violation.
|
|
453
481
|
|
|
454
482
|
By default, exceptions thrown by rules (or the library itself) are unhandled
|
|
455
483
|
and bubble up the stack to the caller in the conventional manner. By setting
|
|
456
|
-
`handleRuleFailures` to `true`, exceptions thrown by failing rules will
|
|
457
|
-
handled by the library and the exception message logged as a rule violation.
|
|
484
|
+
`handleRuleFailures` to `true`, exceptions thrown by failing rules will
|
|
485
|
+
be handled by the library and the exception message logged as a rule violation.
|
|
458
486
|
This setting can be useful in the presence of (custom) rules that encounter
|
|
459
|
-
unexpected syntax and fail. By enabling this option, the linting process
|
|
460
|
-
allowed to continue and report any violations that were found.
|
|
487
|
+
unexpected syntax and fail. By enabling this option, the linting process
|
|
488
|
+
is allowed to continue and report any violations that were found.
|
|
461
489
|
|
|
462
490
|
##### options.noInlineConfig
|
|
463
491
|
|
|
@@ -597,7 +625,7 @@ should come before flexible parsers.
|
|
|
597
625
|
For example:
|
|
598
626
|
|
|
599
627
|
```js
|
|
600
|
-
[ JSON.parse, require("toml").parse, require("js-yaml").
|
|
628
|
+
[ JSON.parse, require("toml").parse, require("js-yaml").load ]
|
|
601
629
|
```
|
|
602
630
|
|
|
603
631
|
#### callback
|
|
@@ -640,11 +668,11 @@ Output:
|
|
|
640
668
|
bad.string: 3: MD010/no-hard-tabs Hard tabs [Column: 19]
|
|
641
669
|
bad.string: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.string"]
|
|
642
670
|
bad.string: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This string fails some rules."]
|
|
643
|
-
bad.string: 1: MD041/first-line-heading/first-line-h1 First line in file should be a top
|
|
671
|
+
bad.string: 1: MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "#bad.string"]
|
|
644
672
|
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
|
|
645
673
|
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.md"]
|
|
646
674
|
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This file fails some rules."]
|
|
647
|
-
bad.md: 1: MD041/first-line-heading/first-line-h1 First line in file should be a top
|
|
675
|
+
bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "#bad.md"]
|
|
648
676
|
```
|
|
649
677
|
|
|
650
678
|
Or invoke `markdownlint.sync` for a synchronous call:
|
|
@@ -693,7 +721,7 @@ Output:
|
|
|
693
721
|
"errorRange": [ 1, 2 ] },
|
|
694
722
|
{ "lineNumber": 1,
|
|
695
723
|
"ruleNames": [ "MD041", "first-line-heading", "first-line-h1" ],
|
|
696
|
-
"ruleDescription": "First line in file should be a top
|
|
724
|
+
"ruleDescription": "First line in a file should be a top-level heading",
|
|
697
725
|
"ruleInformation": "https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md041",
|
|
698
726
|
"errorDetail": null,
|
|
699
727
|
"errorContext": "#bad.md",
|
|
@@ -732,7 +760,7 @@ Output:
|
|
|
732
760
|
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
|
|
733
761
|
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.md"]
|
|
734
762
|
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This file fails some rules."]
|
|
735
|
-
bad.md: 1: MD041/first-line-heading/first-line-h1 First line in file should be a top
|
|
763
|
+
bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "#bad.md"]
|
|
736
764
|
[00:00:00] Finished 'markdownlint' after 10 ms
|
|
737
765
|
```
|
|
738
766
|
|
|
@@ -773,7 +801,7 @@ Warning:
|
|
|
773
801
|
bad.md: 3: MD010/no-hard-tabs Hard tabs [Column: 17]
|
|
774
802
|
bad.md: 1: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#bad.md"]
|
|
775
803
|
bad.md: 3: MD018/no-missing-space-atx No space after hash on atx style heading [Context: "#This file fails some rules."]
|
|
776
|
-
bad.md: 1: MD041/first-line-heading/first-line-h1 First line in file should be a top
|
|
804
|
+
bad.md: 1: MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "#bad.md"]
|
|
777
805
|
Use --force to continue.
|
|
778
806
|
```
|
|
779
807
|
|
|
@@ -905,6 +933,14 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
|
|
905
933
|
update TypeScript declaration file, hide `toString` on `LintResults`, add ability
|
|
906
934
|
to fix in browser demo, allow custom rules in `.markdownlint.json` schema, improve
|
|
907
935
|
MD042/MD044, improve documentation, update dependencies.
|
|
936
|
+
* 0.21.1 - Improve MD011/MD031, export `getVersion` API.
|
|
937
|
+
* 0.22.0 - Allow `extends` in config to reference installed packages by name, add
|
|
938
|
+
`markdownlint-disable-next-line` inline comment, support JSON front matter, improve
|
|
939
|
+
MD009/MD026/MD028/MD043, update dependencies (including `markdown-it` to v12).
|
|
940
|
+
* 0.23.0 - Add comprehensive example `.markdownlint.jsonc`/`.markdownlint.yaml` files, add fix
|
|
941
|
+
information for MD004/ul-style, improve MD018/MD019/MD020/MD021/MD037/MD041, improve
|
|
942
|
+
HTML comment handling, update test runner and test suite, update dependencies.
|
|
943
|
+
* 0.23.1 - Work around lack of webpack support for dynamic calls to `require` (`.resolve`).
|
|
908
944
|
|
|
909
945
|
[npm-image]: https://img.shields.io/npm/v/markdownlint.svg
|
|
910
946
|
[npm-url]: https://www.npmjs.com/package/markdownlint
|