markdownlint 0.32.0 → 0.33.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/CHANGELOG.md +14 -0
- package/README.md +6 -0
- package/demo/markdownlint-browser.js +2292 -3179
- package/doc/Rules.md +99 -5
- package/doc/md024.md +2 -5
- package/doc/md055.md +54 -0
- package/doc/md056.md +37 -0
- package/helpers/README.md +3 -3
- package/helpers/micromark.cjs +3 -2
- package/helpers/package.json +1 -1
- package/lib/configuration.d.ts +136 -110
- package/lib/constants.js +1 -1
- package/lib/markdownlint.js +0 -1
- package/lib/md005.js +3 -3
- package/lib/md007.js +3 -2
- package/lib/md024.js +8 -4
- package/lib/md026.js +2 -2
- package/lib/md038.js +17 -15
- package/lib/md054.js +8 -1
- package/lib/md055.js +72 -0
- package/lib/md056.js +44 -0
- package/lib/rules.js +5 -3
- package/package.json +23 -24
- package/schema/.markdownlint.jsonc +58 -51
- package/schema/.markdownlint.yaml +56 -50
- package/schema/ValidatingConfiguration.md +28 -0
- package/schema/markdownlint-config-schema.json +165 -113
package/doc/Rules.md
CHANGED
|
@@ -801,8 +801,6 @@ Aliases: `no-duplicate-heading`
|
|
|
801
801
|
|
|
802
802
|
Parameters:
|
|
803
803
|
|
|
804
|
-
- `allow_different_nesting`: Only check sibling headings (`boolean`, default
|
|
805
|
-
`false`)
|
|
806
804
|
- `siblings_only`: Only check sibling headings (`boolean`, default `false`)
|
|
807
805
|
|
|
808
806
|
This rule is triggered if there are multiple headings in the document that have
|
|
@@ -822,9 +820,8 @@ To fix this, ensure that the content of each heading is different:
|
|
|
822
820
|
## Some more text
|
|
823
821
|
```
|
|
824
822
|
|
|
825
|
-
If the parameter `siblings_only`
|
|
826
|
-
|
|
827
|
-
in changelogs):
|
|
823
|
+
If the parameter `siblings_only` is set to `true`, duplication is allowed for
|
|
824
|
+
headings with different parents (as is common in changelogs):
|
|
828
825
|
|
|
829
826
|
```markdown
|
|
830
827
|
# Change log
|
|
@@ -2326,6 +2323,103 @@ Inline links and images can include descriptive text, but take up more space in
|
|
|
2326
2323
|
Markdown form. Reference links and images can be easier to read and manipulate
|
|
2327
2324
|
in Markdown form, but require a separate link reference definition.
|
|
2328
2325
|
|
|
2326
|
+
<a name="md055"></a>
|
|
2327
|
+
|
|
2328
|
+
## `MD055` - Table pipe style
|
|
2329
|
+
|
|
2330
|
+
Tags: `table`
|
|
2331
|
+
|
|
2332
|
+
Aliases: `table-pipe-style`
|
|
2333
|
+
|
|
2334
|
+
Parameters:
|
|
2335
|
+
|
|
2336
|
+
- `style`: Table pipe style (`string`, default `consistent`, values
|
|
2337
|
+
`consistent` / `leading_and_trailing` / `leading_only` /
|
|
2338
|
+
`no_leading_or_trailing` / `trailing_only`)
|
|
2339
|
+
|
|
2340
|
+
This rule is triggered when a [GitHub Flavored Markdown table][gfm-table-055]
|
|
2341
|
+
is inconsistent about its use of leading and trailing pipe characters (`|`).
|
|
2342
|
+
|
|
2343
|
+
By default (`consistent` style), the header row of the first table in a document
|
|
2344
|
+
is used to determine the style that is enforced for all tables in that document.
|
|
2345
|
+
A specific style can be required by setting the `style` parameter accordingly.
|
|
2346
|
+
|
|
2347
|
+
This table's header row has leading and trailing pipes, but its delimiter row is
|
|
2348
|
+
missing the trailing pipe and its first row of cells is missing the leading
|
|
2349
|
+
pipe:
|
|
2350
|
+
|
|
2351
|
+
```markdown
|
|
2352
|
+
| Header | Header |
|
|
2353
|
+
| ------ | ------
|
|
2354
|
+
Cell | Cell |
|
|
2355
|
+
```
|
|
2356
|
+
|
|
2357
|
+
To fix these issues, make sure there is a pipe character at the beginning and
|
|
2358
|
+
end of every row:
|
|
2359
|
+
|
|
2360
|
+
```markdown
|
|
2361
|
+
| Header | Header |
|
|
2362
|
+
| ------ | ------ |
|
|
2363
|
+
| Cell | Cell |
|
|
2364
|
+
```
|
|
2365
|
+
|
|
2366
|
+
Note that text immediately following a table (i.e., not separated by an empty
|
|
2367
|
+
line) is treated as part of the table (per the specification) and may also
|
|
2368
|
+
trigger this rule:
|
|
2369
|
+
|
|
2370
|
+
```markdown
|
|
2371
|
+
| Header | Header |
|
|
2372
|
+
| ------ | ------ |
|
|
2373
|
+
| Cell | Cell |
|
|
2374
|
+
This text is part of the table
|
|
2375
|
+
```
|
|
2376
|
+
|
|
2377
|
+
Rationale: Some parsers have difficulty with tables that are missing their
|
|
2378
|
+
leading or trailing pipe characters. The use of leading/trailing pipes can also
|
|
2379
|
+
help provide visual clarity.
|
|
2380
|
+
|
|
2381
|
+
[gfm-table-055]: https://github.github.com/gfm/#tables-extension-
|
|
2382
|
+
|
|
2383
|
+
<a name="md056"></a>
|
|
2384
|
+
|
|
2385
|
+
## `MD056` - Table column count
|
|
2386
|
+
|
|
2387
|
+
Tags: `table`
|
|
2388
|
+
|
|
2389
|
+
Aliases: `table-column-count`
|
|
2390
|
+
|
|
2391
|
+
This rule is triggered when a [GitHub Flavored Markdown table][gfm-table-056]
|
|
2392
|
+
does not have the same number of cells in every row.
|
|
2393
|
+
|
|
2394
|
+
This table's second data row has too few cells and its third data row has too
|
|
2395
|
+
many cells:
|
|
2396
|
+
|
|
2397
|
+
```markdown
|
|
2398
|
+
| Header | Header |
|
|
2399
|
+
| ------ | ------ |
|
|
2400
|
+
| Cell | Cell |
|
|
2401
|
+
| Cell |
|
|
2402
|
+
| Cell | Cell | Cell |
|
|
2403
|
+
```
|
|
2404
|
+
|
|
2405
|
+
To fix these issues, ensure every row has the same number of cells:
|
|
2406
|
+
|
|
2407
|
+
```markdown
|
|
2408
|
+
| Header | Header |
|
|
2409
|
+
| ------ | ------ |
|
|
2410
|
+
| Cell | Cell |
|
|
2411
|
+
| Cell | Cell |
|
|
2412
|
+
| Cell | Cell |
|
|
2413
|
+
```
|
|
2414
|
+
|
|
2415
|
+
Note that a table's header row and its delimiter row must have the same number
|
|
2416
|
+
of cells or it will not be recognized as a table (per specification).
|
|
2417
|
+
|
|
2418
|
+
Rationale: Extra cells in a row are usually not shown, so their data is lost.
|
|
2419
|
+
Missing cells in a row create holes in the table and suggest an omission.
|
|
2420
|
+
|
|
2421
|
+
[gfm-table-056]: https://github.github.com/gfm/#tables-extension-
|
|
2422
|
+
|
|
2329
2423
|
<!-- markdownlint-configure-file {
|
|
2330
2424
|
"no-inline-html": {
|
|
2331
2425
|
"allowed_elements": [
|
package/doc/md024.md
CHANGED
|
@@ -6,8 +6,6 @@ Aliases: `no-duplicate-heading`
|
|
|
6
6
|
|
|
7
7
|
Parameters:
|
|
8
8
|
|
|
9
|
-
- `allow_different_nesting`: Only check sibling headings (`boolean`, default
|
|
10
|
-
`false`)
|
|
11
9
|
- `siblings_only`: Only check sibling headings (`boolean`, default `false`)
|
|
12
10
|
|
|
13
11
|
This rule is triggered if there are multiple headings in the document that have
|
|
@@ -27,9 +25,8 @@ To fix this, ensure that the content of each heading is different:
|
|
|
27
25
|
## Some more text
|
|
28
26
|
```
|
|
29
27
|
|
|
30
|
-
If the parameter `siblings_only`
|
|
31
|
-
|
|
32
|
-
in changelogs):
|
|
28
|
+
If the parameter `siblings_only` is set to `true`, duplication is allowed for
|
|
29
|
+
headings with different parents (as is common in changelogs):
|
|
33
30
|
|
|
34
31
|
```markdown
|
|
35
32
|
# Change log
|
package/doc/md055.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# `MD055` - Table pipe style
|
|
2
|
+
|
|
3
|
+
Tags: `table`
|
|
4
|
+
|
|
5
|
+
Aliases: `table-pipe-style`
|
|
6
|
+
|
|
7
|
+
Parameters:
|
|
8
|
+
|
|
9
|
+
- `style`: Table pipe style (`string`, default `consistent`, values
|
|
10
|
+
`consistent` / `leading_and_trailing` / `leading_only` /
|
|
11
|
+
`no_leading_or_trailing` / `trailing_only`)
|
|
12
|
+
|
|
13
|
+
This rule is triggered when a [GitHub Flavored Markdown table][gfm-table-055]
|
|
14
|
+
is inconsistent about its use of leading and trailing pipe characters (`|`).
|
|
15
|
+
|
|
16
|
+
By default (`consistent` style), the header row of the first table in a document
|
|
17
|
+
is used to determine the style that is enforced for all tables in that document.
|
|
18
|
+
A specific style can be required by setting the `style` parameter accordingly.
|
|
19
|
+
|
|
20
|
+
This table's header row has leading and trailing pipes, but its delimiter row is
|
|
21
|
+
missing the trailing pipe and its first row of cells is missing the leading
|
|
22
|
+
pipe:
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
| Header | Header |
|
|
26
|
+
| ------ | ------
|
|
27
|
+
Cell | Cell |
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
To fix these issues, make sure there is a pipe character at the beginning and
|
|
31
|
+
end of every row:
|
|
32
|
+
|
|
33
|
+
```markdown
|
|
34
|
+
| Header | Header |
|
|
35
|
+
| ------ | ------ |
|
|
36
|
+
| Cell | Cell |
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Note that text immediately following a table (i.e., not separated by an empty
|
|
40
|
+
line) is treated as part of the table (per the specification) and may also
|
|
41
|
+
trigger this rule:
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
| Header | Header |
|
|
45
|
+
| ------ | ------ |
|
|
46
|
+
| Cell | Cell |
|
|
47
|
+
This text is part of the table
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Rationale: Some parsers have difficulty with tables that are missing their
|
|
51
|
+
leading or trailing pipe characters. The use of leading/trailing pipes can also
|
|
52
|
+
help provide visual clarity.
|
|
53
|
+
|
|
54
|
+
[gfm-table-055]: https://github.github.com/gfm/#tables-extension-
|
package/doc/md056.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# `MD056` - Table column count
|
|
2
|
+
|
|
3
|
+
Tags: `table`
|
|
4
|
+
|
|
5
|
+
Aliases: `table-column-count`
|
|
6
|
+
|
|
7
|
+
This rule is triggered when a [GitHub Flavored Markdown table][gfm-table-056]
|
|
8
|
+
does not have the same number of cells in every row.
|
|
9
|
+
|
|
10
|
+
This table's second data row has too few cells and its third data row has too
|
|
11
|
+
many cells:
|
|
12
|
+
|
|
13
|
+
```markdown
|
|
14
|
+
| Header | Header |
|
|
15
|
+
| ------ | ------ |
|
|
16
|
+
| Cell | Cell |
|
|
17
|
+
| Cell |
|
|
18
|
+
| Cell | Cell | Cell |
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
To fix these issues, ensure every row has the same number of cells:
|
|
22
|
+
|
|
23
|
+
```markdown
|
|
24
|
+
| Header | Header |
|
|
25
|
+
| ------ | ------ |
|
|
26
|
+
| Cell | Cell |
|
|
27
|
+
| Cell | Cell |
|
|
28
|
+
| Cell | Cell |
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Note that a table's header row and its delimiter row must have the same number
|
|
32
|
+
of cells or it will not be recognized as a table (per specification).
|
|
33
|
+
|
|
34
|
+
Rationale: Extra cells in a row are usually not shown, so their data is lost.
|
|
35
|
+
Missing cells in a row create holes in the table and suggest an omission.
|
|
36
|
+
|
|
37
|
+
[gfm-table-056]: https://github.github.com/gfm/#tables-extension-
|
package/helpers/README.md
CHANGED
|
@@ -62,9 +62,9 @@ See also: [`markdownlint` built-in rule implementations][lib].
|
|
|
62
62
|
*None* - The entire body of code is tested to 100% coverage by the core
|
|
63
63
|
`markdownlint` project, so there are no additional tests here.
|
|
64
64
|
|
|
65
|
-
[custom-rules]: https://github.com/DavidAnson/markdownlint/blob/
|
|
65
|
+
[custom-rules]: https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/CustomRules.md
|
|
66
66
|
[jsdoc]: https://en.m.wikipedia.org/wiki/JSDoc
|
|
67
|
-
[lib]: https://github.com/DavidAnson/markdownlint/tree/
|
|
67
|
+
[lib]: https://github.com/DavidAnson/markdownlint/tree/v0.33.0/lib
|
|
68
68
|
[markdown]: https://en.wikipedia.org/wiki/Markdown
|
|
69
69
|
[markdownlint]: https://github.com/DavidAnson/markdownlint
|
|
70
|
-
[rules]: https://github.com/DavidAnson/markdownlint/blob/
|
|
70
|
+
[rules]: https://github.com/DavidAnson/markdownlint/blob/v0.33.0/doc/Rules.md
|
package/helpers/micromark.cjs
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
const {
|
|
7
|
-
gfmAutolinkLiteral, gfmFootnote, gfmTable, math, parse,
|
|
8
|
-
preprocess
|
|
7
|
+
directive, gfmAutolinkLiteral, gfmFootnote, gfmTable, math, parse,
|
|
8
|
+
postprocess, preprocess
|
|
9
9
|
// @ts-ignore
|
|
10
10
|
} = require("markdownlint-micromark");
|
|
11
11
|
const { newLineRe } = require("./shared.js");
|
|
@@ -72,6 +72,7 @@ function getMicromarkEvents(
|
|
|
72
72
|
// Customize options object to add useful extensions
|
|
73
73
|
micromarkOptions.extensions = micromarkOptions.extensions || [];
|
|
74
74
|
micromarkOptions.extensions.push(
|
|
75
|
+
directive(),
|
|
75
76
|
gfmAutolinkLiteral(),
|
|
76
77
|
gfmFootnote(),
|
|
77
78
|
gfmTable(),
|