markdownlint 0.25.1 → 0.26.2
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 +2 -0
- package/README.md +126 -83
- package/demo/markdownlint-browser.js +1743 -1288
- package/doc/Rules.md +145 -16
- package/helpers/helpers.js +429 -192
- package/helpers/package.json +6 -2
- package/lib/cache.js +15 -25
- package/lib/constants.js +1 -1
- package/lib/markdownlint.d.ts +21 -17
- package/lib/markdownlint.js +237 -151
- package/lib/md004.js +4 -4
- package/lib/md005.js +4 -4
- package/lib/md006.js +4 -4
- package/lib/md007.js +4 -4
- package/lib/md009.js +20 -13
- package/lib/md010.js +15 -2
- package/lib/md011.js +2 -2
- package/lib/md013.js +4 -5
- package/lib/md014.js +4 -4
- package/lib/md021.js +3 -1
- package/lib/md026.js +1 -1
- package/lib/md027.js +2 -2
- package/lib/md028.js +2 -2
- package/lib/md029.js +5 -4
- package/lib/md030.js +4 -4
- package/lib/md031.js +2 -2
- package/lib/md032.js +7 -7
- package/lib/md033.js +3 -4
- package/lib/md034.js +2 -2
- package/lib/md035.js +7 -2
- package/lib/md036.js +2 -2
- package/lib/md037.js +23 -20
- package/lib/md038.js +7 -4
- package/lib/md039.js +6 -4
- package/lib/md042.js +17 -10
- package/lib/md043.js +2 -2
- package/lib/md044.js +20 -9
- package/lib/md046.js +14 -13
- package/lib/md048.js +13 -14
- package/lib/md049-md050.js +73 -0
- package/lib/md051.js +87 -0
- package/lib/md052.js +35 -0
- package/lib/md053.js +59 -0
- package/lib/rules.js +6 -4
- package/package.json +25 -18
- package/schema/.markdownlint.jsonc +19 -1
- package/schema/.markdownlint.yaml +18 -1
- package/schema/markdownlint-config-schema.json +126 -728
- package/lib/md049.js +0 -45
- package/lib/md050.js +0 -45
package/helpers/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdownlint-rule-helpers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"description": "A collection of markdownlint helper functions for custom rules",
|
|
5
|
-
"main": "helpers.js",
|
|
5
|
+
"main": "./helpers.js",
|
|
6
|
+
"exports": "./helpers.js",
|
|
6
7
|
"author": "David Anson (https://dlaa.me/)",
|
|
7
8
|
"license": "MIT",
|
|
8
9
|
"homepage": "https://github.com/DavidAnson/markdownlint",
|
|
@@ -11,6 +12,9 @@
|
|
|
11
12
|
"url": "https://github.com/DavidAnson/markdownlint.git"
|
|
12
13
|
},
|
|
13
14
|
"bugs": "https://github.com/DavidAnson/markdownlint/issues",
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=12"
|
|
17
|
+
},
|
|
14
18
|
"keywords": [
|
|
15
19
|
"markdownlint",
|
|
16
20
|
"markdownlint-rule"
|
package/lib/cache.js
CHANGED
|
@@ -2,32 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
"use strict";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
module.exports.codeBlockAndSpanRanges = (value) => {
|
|
7
|
-
if (value) {
|
|
8
|
-
codeBlockAndSpanRanges = value;
|
|
9
|
-
}
|
|
10
|
-
return codeBlockAndSpanRanges;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
let flattenedLists = null;
|
|
14
|
-
module.exports.flattenedLists = (value) => {
|
|
15
|
-
if (value) {
|
|
16
|
-
flattenedLists = value;
|
|
17
|
-
}
|
|
18
|
-
return flattenedLists;
|
|
19
|
-
};
|
|
5
|
+
const map = new Map();
|
|
20
6
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
lineMetadata = value;
|
|
7
|
+
module.exports.set = (keyValuePairs) => {
|
|
8
|
+
for (const [ key, value ] of Object.entries(keyValuePairs)) {
|
|
9
|
+
map.set(key, value);
|
|
25
10
|
}
|
|
26
|
-
return lineMetadata;
|
|
27
11
|
};
|
|
12
|
+
module.exports.clear = () => map.clear();
|
|
28
13
|
|
|
29
|
-
module.exports.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
module.exports.codeBlockAndSpanRanges =
|
|
15
|
+
() => map.get("codeBlockAndSpanRanges");
|
|
16
|
+
module.exports.flattenedLists =
|
|
17
|
+
() => map.get("flattenedLists");
|
|
18
|
+
module.exports.htmlElementRanges =
|
|
19
|
+
() => map.get("htmlElementRanges");
|
|
20
|
+
module.exports.lineMetadata =
|
|
21
|
+
() => map.get("lineMetadata");
|
|
22
|
+
module.exports.referenceLinkImageData =
|
|
23
|
+
() => map.get("referenceLinkImageData");
|
package/lib/constants.js
CHANGED
package/lib/markdownlint.d.ts
CHANGED
|
@@ -14,32 +14,38 @@ declare namespace markdownlint {
|
|
|
14
14
|
* Configuration options.
|
|
15
15
|
*/
|
|
16
16
|
type Options = {
|
|
17
|
-
/**
|
|
18
|
-
* Files to lint.
|
|
19
|
-
*/
|
|
20
|
-
files?: string[] | string;
|
|
21
|
-
/**
|
|
22
|
-
* Strings to lint.
|
|
23
|
-
*/
|
|
24
|
-
strings?: {
|
|
25
|
-
[x: string]: string;
|
|
26
|
-
};
|
|
27
17
|
/**
|
|
28
18
|
* Configuration object.
|
|
29
19
|
*/
|
|
30
20
|
config?: Configuration;
|
|
21
|
+
/**
|
|
22
|
+
* Configuration parsers.
|
|
23
|
+
*/
|
|
24
|
+
configParsers?: ConfigurationParser[];
|
|
31
25
|
/**
|
|
32
26
|
* Custom rules.
|
|
33
27
|
*/
|
|
34
28
|
customRules?: Rule[] | Rule;
|
|
29
|
+
/**
|
|
30
|
+
* Files to lint.
|
|
31
|
+
*/
|
|
32
|
+
files?: string[] | string;
|
|
35
33
|
/**
|
|
36
34
|
* Front matter pattern.
|
|
37
35
|
*/
|
|
38
36
|
frontMatter?: RegExp;
|
|
37
|
+
/**
|
|
38
|
+
* File system implementation.
|
|
39
|
+
*/
|
|
40
|
+
fs?: any;
|
|
39
41
|
/**
|
|
40
42
|
* True to catch exceptions.
|
|
41
43
|
*/
|
|
42
44
|
handleRuleFailures?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Additional plugins.
|
|
47
|
+
*/
|
|
48
|
+
markdownItPlugins?: Plugin[];
|
|
43
49
|
/**
|
|
44
50
|
* True to ignore HTML directives.
|
|
45
51
|
*/
|
|
@@ -49,13 +55,11 @@ type Options = {
|
|
|
49
55
|
*/
|
|
50
56
|
resultVersion?: number;
|
|
51
57
|
/**
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
54
|
-
markdownItPlugins?: Plugin[];
|
|
55
|
-
/**
|
|
56
|
-
* File system implementation.
|
|
58
|
+
* Strings to lint.
|
|
57
59
|
*/
|
|
58
|
-
|
|
60
|
+
strings?: {
|
|
61
|
+
[x: string]: string;
|
|
62
|
+
};
|
|
59
63
|
};
|
|
60
64
|
/**
|
|
61
65
|
* Called with the result of the lint function.
|
|
@@ -346,7 +350,7 @@ type FixInfo = {
|
|
|
346
350
|
};
|
|
347
351
|
/**
|
|
348
352
|
* Configuration object for linting rules. For a detailed schema, see
|
|
349
|
-
* {@link
|
|
353
|
+
* {@link ../schema/markdownlint-config-schema.json}.
|
|
350
354
|
*/
|
|
351
355
|
type Configuration = {
|
|
352
356
|
[x: string]: RuleConfiguration;
|