markdownlint 0.25.0 → 0.26.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 +2 -0
- package/LICENSE +1 -1
- package/README.md +125 -83
- package/demo/markdownlint-browser.js +1719 -1269
- package/doc/Rules.md +133 -15
- package/helpers/LICENSE +1 -1
- package/helpers/helpers.js +427 -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 -146
- 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 +3 -2
- package/lib/md033.js +2 -3
- package/lib/md034.js +2 -2
- package/lib/md035.js +7 -2
- package/lib/md036.js +2 -2
- 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 +52 -0
- package/lib/rules.js +6 -4
- package/package.json +36 -29
- package/schema/.markdownlint.jsonc +15 -2
- package/schema/.markdownlint.yaml +14 -1
- package/schema/markdownlint-config-schema.json +119 -737
- package/lib/md049.js +0 -45
- package/lib/md050.js +0 -45
package/lib/md044.js
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
"use strict";
|
|
4
4
|
|
|
5
5
|
const { addErrorDetailIf, bareUrlRe, escapeForRegExp, forEachLine,
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
forEachLink, withinAnyRange, linkReferenceDefinitionRe } =
|
|
7
|
+
require("../helpers");
|
|
8
|
+
const { codeBlockAndSpanRanges, htmlElementRanges, lineMetadata } =
|
|
9
|
+
require("./cache");
|
|
8
10
|
|
|
9
11
|
module.exports = {
|
|
10
12
|
"names": [ "MD044", "proper-names" ],
|
|
@@ -15,29 +17,35 @@ module.exports = {
|
|
|
15
17
|
names = Array.isArray(names) ? names : [];
|
|
16
18
|
names.sort((a, b) => (b.length - a.length) || a.localeCompare(b));
|
|
17
19
|
const codeBlocks = params.config.code_blocks;
|
|
18
|
-
const includeCodeBlocks =
|
|
20
|
+
const includeCodeBlocks =
|
|
21
|
+
(codeBlocks === undefined) ? true : !!codeBlocks;
|
|
22
|
+
const htmlElements = params.config.html_elements;
|
|
23
|
+
const includeHtmlElements =
|
|
24
|
+
(htmlElements === undefined) ? true : !!htmlElements;
|
|
19
25
|
const exclusions = [];
|
|
20
26
|
forEachLine(lineMetadata(), (line, lineIndex) => {
|
|
21
|
-
if (
|
|
27
|
+
if (linkReferenceDefinitionRe.test(line)) {
|
|
22
28
|
exclusions.push([ lineIndex, 0, line.length ]);
|
|
23
29
|
} else {
|
|
24
30
|
let match = null;
|
|
25
31
|
while ((match = bareUrlRe.exec(line)) !== null) {
|
|
26
32
|
exclusions.push([ lineIndex, match.index, match[0].length ]);
|
|
27
33
|
}
|
|
28
|
-
|
|
29
|
-
const [ , text, destination ] = match;
|
|
34
|
+
forEachLink(line, (index, _, text, destination) => {
|
|
30
35
|
if (destination) {
|
|
31
36
|
exclusions.push(
|
|
32
|
-
[ lineIndex,
|
|
37
|
+
[ lineIndex, index + text.length, destination.length ]
|
|
33
38
|
);
|
|
34
39
|
}
|
|
35
|
-
}
|
|
40
|
+
});
|
|
36
41
|
}
|
|
37
42
|
});
|
|
38
43
|
if (!includeCodeBlocks) {
|
|
39
44
|
exclusions.push(...codeBlockAndSpanRanges());
|
|
40
45
|
}
|
|
46
|
+
if (!includeHtmlElements) {
|
|
47
|
+
exclusions.push(...htmlElementRanges());
|
|
48
|
+
}
|
|
41
49
|
for (const name of names) {
|
|
42
50
|
const escapedName = escapeForRegExp(name);
|
|
43
51
|
const startNamePattern = /^\W/.test(name) ? "" : "\\b_*";
|
|
@@ -52,7 +60,10 @@ module.exports = {
|
|
|
52
60
|
const [ , leftMatch, nameMatch ] = match;
|
|
53
61
|
const index = match.index + leftMatch.length;
|
|
54
62
|
const length = nameMatch.length;
|
|
55
|
-
if (
|
|
63
|
+
if (
|
|
64
|
+
!withinAnyRange(exclusions, lineIndex, index, length) &&
|
|
65
|
+
!names.includes(nameMatch)
|
|
66
|
+
) {
|
|
56
67
|
addErrorDetailIf(
|
|
57
68
|
onError,
|
|
58
69
|
lineIndex + 1,
|
package/lib/md046.js
CHANGED
|
@@ -15,18 +15,19 @@ module.exports = {
|
|
|
15
15
|
"tags": [ "code" ],
|
|
16
16
|
"function": function MD046(params, onError) {
|
|
17
17
|
let expectedStyle = String(params.config.style || "consistent");
|
|
18
|
-
params.tokens
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
const codeBlocksAndFences = params.tokens.filter(
|
|
19
|
+
(token) => (token.type === "code_block") || (token.type === "fence")
|
|
20
|
+
);
|
|
21
|
+
for (const token of codeBlocksAndFences) {
|
|
22
|
+
const { lineNumber, type } = token;
|
|
23
|
+
if (expectedStyle === "consistent") {
|
|
24
|
+
expectedStyle = tokenTypeToStyle[type];
|
|
25
|
+
}
|
|
26
|
+
addErrorDetailIf(
|
|
27
|
+
onError,
|
|
28
|
+
lineNumber,
|
|
29
|
+
expectedStyle,
|
|
30
|
+
tokenTypeToStyle[type]);
|
|
31
|
+
}
|
|
31
32
|
}
|
|
32
33
|
};
|
package/lib/md048.js
CHANGED
|
@@ -11,19 +11,18 @@ module.exports = {
|
|
|
11
11
|
"function": function MD048(params, onError) {
|
|
12
12
|
const style = String(params.config.style || "consistent");
|
|
13
13
|
let expectedStyle = style;
|
|
14
|
-
params.tokens
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
14
|
+
const fenceTokens = params.tokens.filter((token) => token.type === "fence");
|
|
15
|
+
for (const fenceToken of fenceTokens) {
|
|
16
|
+
const { lineNumber, markup } = fenceToken;
|
|
17
|
+
if (expectedStyle === "consistent") {
|
|
18
|
+
expectedStyle = fencedCodeBlockStyleFor(markup);
|
|
19
|
+
}
|
|
20
|
+
addErrorDetailIf(
|
|
21
|
+
onError,
|
|
22
|
+
lineNumber,
|
|
23
|
+
expectedStyle,
|
|
24
|
+
fencedCodeBlockStyleFor(markup)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
28
27
|
}
|
|
29
28
|
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, emphasisOrStrongStyleFor, forEachInlineChild,
|
|
6
|
+
getNextChildToken, getRangeAndFixInfoIfFound } = require("../helpers");
|
|
7
|
+
|
|
8
|
+
const impl = (params, onError, tagPrefix, asterisk, underline, style) => {
|
|
9
|
+
let lastLineNumber = -1;
|
|
10
|
+
const instances = new Map();
|
|
11
|
+
forEachInlineChild(params, `${tagPrefix}_open`, (token, parent) => {
|
|
12
|
+
const { lineNumber, markup } = token;
|
|
13
|
+
const markupStyle = emphasisOrStrongStyleFor(markup);
|
|
14
|
+
if (style === "consistent") {
|
|
15
|
+
style = markupStyle;
|
|
16
|
+
}
|
|
17
|
+
if (style !== markupStyle) {
|
|
18
|
+
let rangeAndFixInfo = {};
|
|
19
|
+
const contentToken = getNextChildToken(
|
|
20
|
+
parent, token, "text", `${tagPrefix}_close`
|
|
21
|
+
);
|
|
22
|
+
if (contentToken) {
|
|
23
|
+
const { content } = contentToken;
|
|
24
|
+
const actual = `${markup}${content}${markup}`;
|
|
25
|
+
const expectedMarkup =
|
|
26
|
+
(style === "asterisk") ? asterisk : underline;
|
|
27
|
+
const expected = `${expectedMarkup}${content}${expectedMarkup}`;
|
|
28
|
+
if (lastLineNumber !== lineNumber) {
|
|
29
|
+
lastLineNumber = lineNumber;
|
|
30
|
+
instances.clear();
|
|
31
|
+
}
|
|
32
|
+
const instance = (instances.get(expected) || 0) + 1;
|
|
33
|
+
instances.set(expected, instance);
|
|
34
|
+
rangeAndFixInfo = getRangeAndFixInfoIfFound(
|
|
35
|
+
params.lines,
|
|
36
|
+
lineNumber - 1,
|
|
37
|
+
actual,
|
|
38
|
+
expected,
|
|
39
|
+
instance
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
addError(
|
|
43
|
+
onError,
|
|
44
|
+
lineNumber,
|
|
45
|
+
`Expected: ${style}; Actual: ${markupStyle}`,
|
|
46
|
+
null,
|
|
47
|
+
rangeAndFixInfo.range,
|
|
48
|
+
rangeAndFixInfo.fixInfo
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
module.exports = [
|
|
55
|
+
{
|
|
56
|
+
"names": [ "MD049", "emphasis-style" ],
|
|
57
|
+
"description": "Emphasis style should be consistent",
|
|
58
|
+
"tags": [ "emphasis" ],
|
|
59
|
+
"function": function MD049(params, onError) {
|
|
60
|
+
const style = String(params.config.style || "consistent");
|
|
61
|
+
return impl(params, onError, "em", "*", "_", style);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"names": [ "MD050", "strong-style" ],
|
|
66
|
+
"description": "Strong style should be consistent",
|
|
67
|
+
"tags": [ "emphasis" ],
|
|
68
|
+
"function": function MD050(params, onError) {
|
|
69
|
+
const style = String(params.config.style || "consistent");
|
|
70
|
+
return impl(params, onError, "strong", "**", "__", style);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
];
|
package/lib/md051.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, escapeForRegExp, filterTokens, forEachInlineChild,
|
|
6
|
+
forEachHeading, htmlElementRe } = require("../helpers");
|
|
7
|
+
|
|
8
|
+
// Regular expression for identifying HTML anchor names
|
|
9
|
+
const identifierRe = /(?:id|name)\s*=\s*['"]?([^'"\s>]+)/iu;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Converts a Markdown heading into an HTML fragment according to the rules
|
|
13
|
+
* used by GitHub.
|
|
14
|
+
*
|
|
15
|
+
* @param {Object} inline Inline token for heading.
|
|
16
|
+
* @returns {string} Fragment string for heading.
|
|
17
|
+
*/
|
|
18
|
+
function convertHeadingToHTMLFragment(inline) {
|
|
19
|
+
const inlineText = inline.children
|
|
20
|
+
.filter((token) => token.type !== "html_inline")
|
|
21
|
+
.map((token) => token.content)
|
|
22
|
+
.join("");
|
|
23
|
+
return "#" + encodeURIComponent(
|
|
24
|
+
inlineText
|
|
25
|
+
.toLowerCase()
|
|
26
|
+
// RegExp source with Ruby's \p{Word} expanded into its General Categories
|
|
27
|
+
// eslint-disable-next-line max-len
|
|
28
|
+
// https://github.com/gjtorikian/html-pipeline/blob/main/lib/html/pipeline/toc_filter.rb
|
|
29
|
+
// https://ruby-doc.org/core-3.0.2/Regexp.html
|
|
30
|
+
.replace(
|
|
31
|
+
/[^\p{Letter}\p{Mark}\p{Number}\p{Connector_Punctuation}\- ]/gu,
|
|
32
|
+
""
|
|
33
|
+
)
|
|
34
|
+
.replace(/ /gu, "-")
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
module.exports = {
|
|
39
|
+
"names": [ "MD051", "link-fragments" ],
|
|
40
|
+
"description": "Link fragments should be valid",
|
|
41
|
+
"tags": [ "links" ],
|
|
42
|
+
"function": function MD051(params, onError) {
|
|
43
|
+
const fragments = new Map();
|
|
44
|
+
// Process headings
|
|
45
|
+
forEachHeading(params, (heading, content, inline) => {
|
|
46
|
+
const fragment = convertHeadingToHTMLFragment(inline);
|
|
47
|
+
const count = fragments.get(fragment) || 0;
|
|
48
|
+
if (count) {
|
|
49
|
+
fragments.set(`${fragment}-${count}`, 0);
|
|
50
|
+
}
|
|
51
|
+
fragments.set(fragment, count + 1);
|
|
52
|
+
});
|
|
53
|
+
// Process HTML anchors
|
|
54
|
+
const processHtmlToken = (token) => {
|
|
55
|
+
let match = null;
|
|
56
|
+
while ((match = htmlElementRe.exec(token.content)) !== null) {
|
|
57
|
+
const [ tag, , element ] = match;
|
|
58
|
+
if (element.toLowerCase() === "a") {
|
|
59
|
+
const idMatch = identifierRe.exec(tag);
|
|
60
|
+
if (idMatch) {
|
|
61
|
+
fragments.set(`#${idMatch[1]}`, 0);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
filterTokens(params, "html_block", processHtmlToken);
|
|
67
|
+
forEachInlineChild(params, "html_inline", processHtmlToken);
|
|
68
|
+
// Process link fragments
|
|
69
|
+
forEachInlineChild(params, "link_open", (token) => {
|
|
70
|
+
const { attrs, lineNumber, line } = token;
|
|
71
|
+
const href = attrs.find((attr) => attr[0] === "href");
|
|
72
|
+
const id = href && href[1];
|
|
73
|
+
if (id && (id.length > 1) && (id[0] === "#") && !fragments.has(id)) {
|
|
74
|
+
let context = id;
|
|
75
|
+
let range = null;
|
|
76
|
+
const match = line.match(
|
|
77
|
+
new RegExp(`\\[.*?\\]\\(${escapeForRegExp(context)}\\)`)
|
|
78
|
+
);
|
|
79
|
+
if (match) {
|
|
80
|
+
context = match[0];
|
|
81
|
+
range = [ match.index + 1, match[0].length ];
|
|
82
|
+
}
|
|
83
|
+
addError(onError, lineNumber, undefined, context, range);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
};
|
package/lib/md052.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError } = require("../helpers");
|
|
6
|
+
const { referenceLinkImageData } = require("./cache");
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
"names": [ "MD052", "reference-links-images" ],
|
|
10
|
+
"description":
|
|
11
|
+
"Reference links and images should use a label that is defined",
|
|
12
|
+
"tags": [ "images", "links" ],
|
|
13
|
+
"function": function MD052(params, onError) {
|
|
14
|
+
const { lines } = params;
|
|
15
|
+
const { references, definitions } = referenceLinkImageData();
|
|
16
|
+
// Look for links/images that use an undefined link reference
|
|
17
|
+
for (const reference of references.entries()) {
|
|
18
|
+
const [ label, datas ] = reference;
|
|
19
|
+
if (!definitions.has(label)) {
|
|
20
|
+
for (const data of datas) {
|
|
21
|
+
const [ lineIndex, index, length ] = data;
|
|
22
|
+
// Context will be incomplete if reporting for a multi-line link
|
|
23
|
+
const context = lines[lineIndex].slice(index, index + length);
|
|
24
|
+
addError(
|
|
25
|
+
onError,
|
|
26
|
+
lineIndex + 1,
|
|
27
|
+
`Missing link or image reference definition: "${label}"`,
|
|
28
|
+
context,
|
|
29
|
+
[ index + 1, context.length ]
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
package/lib/md053.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
const { addError, ellipsify, linkReferenceDefinitionRe } =
|
|
6
|
+
require("../helpers");
|
|
7
|
+
const { referenceLinkImageData } = require("./cache");
|
|
8
|
+
|
|
9
|
+
module.exports = {
|
|
10
|
+
"names": [ "MD053", "link-image-reference-definitions" ],
|
|
11
|
+
"description": "Link and image reference definitions should be needed",
|
|
12
|
+
"tags": [ "images", "links" ],
|
|
13
|
+
"function": function MD053(params, onError) {
|
|
14
|
+
const { lines } = params;
|
|
15
|
+
const { references, shortcuts, definitions, duplicateDefinitions } =
|
|
16
|
+
referenceLinkImageData();
|
|
17
|
+
const singleLineDefinition = (line) => (
|
|
18
|
+
line.replace(linkReferenceDefinitionRe, "").trim().length > 0
|
|
19
|
+
);
|
|
20
|
+
const deleteFixInfo = {
|
|
21
|
+
"deleteCount": -1
|
|
22
|
+
};
|
|
23
|
+
// Look for unused link references (unreferenced by any link/image)
|
|
24
|
+
for (const definition of definitions.entries()) {
|
|
25
|
+
const [ label, lineIndex ] = definition;
|
|
26
|
+
if (!references.has(label) && !shortcuts.has(label)) {
|
|
27
|
+
const line = lines[lineIndex];
|
|
28
|
+
addError(
|
|
29
|
+
onError,
|
|
30
|
+
lineIndex + 1,
|
|
31
|
+
`Unused link or image reference definition: "${label}"`,
|
|
32
|
+
ellipsify(line),
|
|
33
|
+
[ 1, line.length ],
|
|
34
|
+
singleLineDefinition(line) ? deleteFixInfo : 0
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// Look for duplicate link references (defined more than once)
|
|
39
|
+
for (const duplicateDefinition of duplicateDefinitions) {
|
|
40
|
+
const [ label, lineIndex ] = duplicateDefinition;
|
|
41
|
+
const line = lines[lineIndex];
|
|
42
|
+
addError(
|
|
43
|
+
onError,
|
|
44
|
+
lineIndex + 1,
|
|
45
|
+
`Duplicate link or image reference definition: "${label}"`,
|
|
46
|
+
ellipsify(line),
|
|
47
|
+
[ 1, line.length ],
|
|
48
|
+
singleLineDefinition(line) ? deleteFixInfo : 0
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
};
|
package/lib/rules.js
CHANGED
|
@@ -49,13 +49,15 @@ const rules = [
|
|
|
49
49
|
require("./md046"),
|
|
50
50
|
require("./md047"),
|
|
51
51
|
require("./md048"),
|
|
52
|
-
require("./md049"),
|
|
53
|
-
require("./
|
|
52
|
+
...require("./md049-md050"),
|
|
53
|
+
require("./md051"),
|
|
54
|
+
require("./md052"),
|
|
55
|
+
require("./md053")
|
|
54
56
|
];
|
|
55
|
-
|
|
57
|
+
for (const rule of rules) {
|
|
56
58
|
const name = rule.names[0].toLowerCase();
|
|
57
59
|
// eslint-disable-next-line dot-notation
|
|
58
60
|
rule["information"] =
|
|
59
61
|
new URL(`${homepage}/blob/v${version}/doc/Rules.md#${name}`);
|
|
60
|
-
}
|
|
62
|
+
}
|
|
61
63
|
module.exports = rules;
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "markdownlint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"description": "A Node.js style checker and lint tool for Markdown/CommonMark files.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "./lib/markdownlint.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./lib/markdownlint.js",
|
|
9
|
+
"./helpers": "./helpers/helpers.js"
|
|
10
|
+
},
|
|
11
|
+
"types": "./lib/markdownlint.d.ts",
|
|
7
12
|
"author": "David Anson (https://dlaa.me/)",
|
|
8
13
|
"license": "MIT",
|
|
9
14
|
"homepage": "https://github.com/DavidAnson/markdownlint",
|
|
@@ -16,7 +21,7 @@
|
|
|
16
21
|
"build-config": "npm run build-config-schema && npm run build-config-example",
|
|
17
22
|
"build-config-example": "node schema/build-config-example.js",
|
|
18
23
|
"build-config-schema": "node schema/build-config-schema.js",
|
|
19
|
-
"build-declaration": "tsc --allowJs --declaration --emitDeclarationOnly --resolveJsonModule lib/markdownlint.js && node scripts delete 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'",
|
|
24
|
+
"build-declaration": "tsc --allowJs --declaration --emitDeclarationOnly --module commonjs --resolveJsonModule --target es2015 lib/markdownlint.js && node scripts delete 'lib/{c,md,r}*.d.ts' 'helpers/*.d.ts'",
|
|
20
25
|
"build-demo": "node scripts copy node_modules/markdown-it/dist/markdown-it.min.js demo/markdown-it.min.js && cd demo && webpack --no-stats",
|
|
21
26
|
"build-example": "npm install --no-save --ignore-scripts grunt grunt-cli gulp through2",
|
|
22
27
|
"ci": "npm-run-all --continue-on-error --parallel build-config lint serial-declaration-demo test-cover && git diff --exit-code",
|
|
@@ -41,37 +46,39 @@
|
|
|
41
46
|
"test-cover": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 npm test",
|
|
42
47
|
"test-declaration": "cd example/typescript && tsc && node type-check.js",
|
|
43
48
|
"test-extra": "ava --timeout=5m test/markdownlint-test-extra-parse.js test/markdownlint-test-extra-type.js",
|
|
44
|
-
"
|
|
49
|
+
"update-snapshots": "ava --update-snapshots test/markdownlint-test-scenarios.js",
|
|
50
|
+
"upgrade": "npx --yes npm-check-updates --upgrade"
|
|
45
51
|
},
|
|
46
52
|
"engines": {
|
|
47
|
-
"node": ">=
|
|
53
|
+
"node": ">=14"
|
|
48
54
|
},
|
|
49
55
|
"dependencies": {
|
|
50
|
-
"markdown-it": "
|
|
56
|
+
"markdown-it": "13.0.1"
|
|
51
57
|
},
|
|
52
58
|
"devDependencies": {
|
|
53
|
-
"ava": "
|
|
54
|
-
"c8": "
|
|
55
|
-
"eslint": "
|
|
56
|
-
"eslint-plugin-
|
|
57
|
-
"eslint-plugin-
|
|
58
|
-
"eslint-plugin-
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"markdown-it-
|
|
63
|
-
"markdown-it-
|
|
64
|
-
"markdown-it-
|
|
65
|
-
"
|
|
66
|
-
"markdownlint-rule-
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"webpack
|
|
59
|
+
"ava": "4.3.0",
|
|
60
|
+
"c8": "7.11.3",
|
|
61
|
+
"eslint": "8.18.0",
|
|
62
|
+
"eslint-plugin-es": "4.1.0",
|
|
63
|
+
"eslint-plugin-jsdoc": "39.3.3",
|
|
64
|
+
"eslint-plugin-node": "11.1.0",
|
|
65
|
+
"eslint-plugin-unicorn": "42.0.0",
|
|
66
|
+
"globby": "13.1.2",
|
|
67
|
+
"js-yaml": "4.1.0",
|
|
68
|
+
"markdown-it-for-inline": "0.1.1",
|
|
69
|
+
"markdown-it-sub": "1.0.0",
|
|
70
|
+
"markdown-it-sup": "1.0.0",
|
|
71
|
+
"markdown-it-texmath": "1.0.0",
|
|
72
|
+
"markdownlint-rule-github-internal-links": "0.1.0",
|
|
73
|
+
"markdownlint-rule-helpers": "0.16.0",
|
|
74
|
+
"npm-run-all": "4.1.5",
|
|
75
|
+
"strip-json-comments": "4.0.0",
|
|
76
|
+
"toml": "3.0.0",
|
|
77
|
+
"ts-loader": "9.3.0",
|
|
78
|
+
"tv4": "1.3.0",
|
|
79
|
+
"typescript": "4.7.4",
|
|
80
|
+
"webpack": "5.73.0",
|
|
81
|
+
"webpack-cli": "4.10.0"
|
|
75
82
|
},
|
|
76
83
|
"keywords": [
|
|
77
84
|
"markdown",
|
|
@@ -58,6 +58,8 @@
|
|
|
58
58
|
"MD010": {
|
|
59
59
|
// Include code blocks
|
|
60
60
|
"code_blocks": true,
|
|
61
|
+
// Fenced code languages to ignore
|
|
62
|
+
"ignore_code_languages": [],
|
|
61
63
|
// Number of spaces for each hard tab
|
|
62
64
|
"spaces_per_tab": 1
|
|
63
65
|
},
|
|
@@ -231,7 +233,9 @@
|
|
|
231
233
|
// List of proper names
|
|
232
234
|
"names": [],
|
|
233
235
|
// Include code blocks
|
|
234
|
-
"code_blocks": true
|
|
236
|
+
"code_blocks": true,
|
|
237
|
+
// Include HTML elements
|
|
238
|
+
"html_elements": true
|
|
235
239
|
},
|
|
236
240
|
|
|
237
241
|
// MD045/no-alt-text - Images should have alternate text (alt text)
|
|
@@ -262,5 +266,14 @@
|
|
|
262
266
|
"MD050": {
|
|
263
267
|
// Strong style should be consistent
|
|
264
268
|
"style": "consistent"
|
|
265
|
-
}
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
// MD051/link-fragments - Link fragments should be valid
|
|
272
|
+
"MD051": true,
|
|
273
|
+
|
|
274
|
+
// MD052/reference-links-images - Reference links and images should use a label that is defined
|
|
275
|
+
"MD052": true,
|
|
276
|
+
|
|
277
|
+
// MD053/link-image-reference-definitions - Link and image reference definitions should be needed
|
|
278
|
+
"MD053": true
|
|
266
279
|
}
|
|
@@ -52,6 +52,8 @@ MD009:
|
|
|
52
52
|
MD010:
|
|
53
53
|
# Include code blocks
|
|
54
54
|
code_blocks: true
|
|
55
|
+
# Fenced code languages to ignore
|
|
56
|
+
ignore_code_languages: []
|
|
55
57
|
# Number of spaces for each hard tab
|
|
56
58
|
spaces_per_tab: 1
|
|
57
59
|
|
|
@@ -211,6 +213,8 @@ MD044:
|
|
|
211
213
|
names: []
|
|
212
214
|
# Include code blocks
|
|
213
215
|
code_blocks: true
|
|
216
|
+
# Include HTML elements
|
|
217
|
+
html_elements: true
|
|
214
218
|
|
|
215
219
|
# MD045/no-alt-text - Images should have alternate text (alt text)
|
|
216
220
|
MD045: true
|
|
@@ -236,4 +240,13 @@ MD049:
|
|
|
236
240
|
# MD050/strong-style - Strong style should be consistent
|
|
237
241
|
MD050:
|
|
238
242
|
# Strong style should be consistent
|
|
239
|
-
style: "consistent"
|
|
243
|
+
style: "consistent"
|
|
244
|
+
|
|
245
|
+
# MD051/link-fragments - Link fragments should be valid
|
|
246
|
+
MD051: true
|
|
247
|
+
|
|
248
|
+
# MD052/reference-links-images - Reference links and images should use a label that is defined
|
|
249
|
+
MD052: true
|
|
250
|
+
|
|
251
|
+
# MD053/link-image-reference-definitions - Link and image reference definitions should be needed
|
|
252
|
+
MD053: true
|