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/md049.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addError, emphasisOrStrongStyleFor, forEachInlineChild,
|
|
6
|
-
getNextChildToken, getRangeAndFixInfoIfFound } = require("../helpers");
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
"names": [ "MD049", "emphasis-style" ],
|
|
10
|
-
"description": "Emphasis style should be consistent",
|
|
11
|
-
"tags": [ "emphasis" ],
|
|
12
|
-
"function": function MD049(params, onError) {
|
|
13
|
-
let expectedStyle = String(params.config.style || "consistent");
|
|
14
|
-
forEachInlineChild(params, "em_open", (token, parent) => {
|
|
15
|
-
const { lineNumber, markup } = token;
|
|
16
|
-
const markupStyle = emphasisOrStrongStyleFor(markup);
|
|
17
|
-
if (expectedStyle === "consistent") {
|
|
18
|
-
expectedStyle = markupStyle;
|
|
19
|
-
}
|
|
20
|
-
if (expectedStyle !== markupStyle) {
|
|
21
|
-
let rangeAndFixInfo = {};
|
|
22
|
-
const contentToken = getNextChildToken(
|
|
23
|
-
parent, token, "text", "em_close"
|
|
24
|
-
);
|
|
25
|
-
if (contentToken) {
|
|
26
|
-
const { content } = contentToken;
|
|
27
|
-
const actual = `${markup}${content}${markup}`;
|
|
28
|
-
const expectedMarkup = (expectedStyle === "asterisk") ? "*" : "_";
|
|
29
|
-
const expected = `${expectedMarkup}${content}${expectedMarkup}`;
|
|
30
|
-
rangeAndFixInfo = getRangeAndFixInfoIfFound(
|
|
31
|
-
params.lines, lineNumber - 1, actual, expected
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
addError(
|
|
35
|
-
onError,
|
|
36
|
-
lineNumber,
|
|
37
|
-
`Expected: ${expectedStyle}; Actual: ${markupStyle}`,
|
|
38
|
-
null,
|
|
39
|
-
rangeAndFixInfo.range,
|
|
40
|
-
rangeAndFixInfo.fixInfo
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
};
|
package/lib/md050.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const { addError, emphasisOrStrongStyleFor, forEachInlineChild,
|
|
6
|
-
getNextChildToken, getRangeAndFixInfoIfFound } = require("../helpers");
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
"names": [ "MD050", "strong-style" ],
|
|
10
|
-
"description": "Strong style should be consistent",
|
|
11
|
-
"tags": [ "emphasis" ],
|
|
12
|
-
"function": function MD050(params, onError) {
|
|
13
|
-
let expectedStyle = String(params.config.style || "consistent");
|
|
14
|
-
forEachInlineChild(params, "strong_open", (token, parent) => {
|
|
15
|
-
const { lineNumber, markup } = token;
|
|
16
|
-
const markupStyle = emphasisOrStrongStyleFor(markup);
|
|
17
|
-
if (expectedStyle === "consistent") {
|
|
18
|
-
expectedStyle = markupStyle;
|
|
19
|
-
}
|
|
20
|
-
if (expectedStyle !== markupStyle) {
|
|
21
|
-
let rangeAndFixInfo = {};
|
|
22
|
-
const contentToken = getNextChildToken(
|
|
23
|
-
parent, token, "text", "strong_close"
|
|
24
|
-
);
|
|
25
|
-
if (contentToken) {
|
|
26
|
-
const { content } = contentToken;
|
|
27
|
-
const actual = `${markup}${content}${markup}`;
|
|
28
|
-
const expectedMarkup = (expectedStyle === "asterisk") ? "**" : "__";
|
|
29
|
-
const expected = `${expectedMarkup}${content}${expectedMarkup}`;
|
|
30
|
-
rangeAndFixInfo = getRangeAndFixInfoIfFound(
|
|
31
|
-
params.lines, lineNumber - 1, actual, expected
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
addError(
|
|
35
|
-
onError,
|
|
36
|
-
lineNumber,
|
|
37
|
-
`Expected: ${expectedStyle}; Actual: ${markupStyle}`,
|
|
38
|
-
null,
|
|
39
|
-
rangeAndFixInfo.range,
|
|
40
|
-
rangeAndFixInfo.fixInfo
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
};
|