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.
Files changed (50) hide show
  1. package/CONTRIBUTING.md +2 -0
  2. package/README.md +126 -83
  3. package/demo/markdownlint-browser.js +1743 -1288
  4. package/doc/Rules.md +145 -16
  5. package/helpers/helpers.js +429 -192
  6. package/helpers/package.json +6 -2
  7. package/lib/cache.js +15 -25
  8. package/lib/constants.js +1 -1
  9. package/lib/markdownlint.d.ts +21 -17
  10. package/lib/markdownlint.js +237 -151
  11. package/lib/md004.js +4 -4
  12. package/lib/md005.js +4 -4
  13. package/lib/md006.js +4 -4
  14. package/lib/md007.js +4 -4
  15. package/lib/md009.js +20 -13
  16. package/lib/md010.js +15 -2
  17. package/lib/md011.js +2 -2
  18. package/lib/md013.js +4 -5
  19. package/lib/md014.js +4 -4
  20. package/lib/md021.js +3 -1
  21. package/lib/md026.js +1 -1
  22. package/lib/md027.js +2 -2
  23. package/lib/md028.js +2 -2
  24. package/lib/md029.js +5 -4
  25. package/lib/md030.js +4 -4
  26. package/lib/md031.js +2 -2
  27. package/lib/md032.js +7 -7
  28. package/lib/md033.js +3 -4
  29. package/lib/md034.js +2 -2
  30. package/lib/md035.js +7 -2
  31. package/lib/md036.js +2 -2
  32. package/lib/md037.js +23 -20
  33. package/lib/md038.js +7 -4
  34. package/lib/md039.js +6 -4
  35. package/lib/md042.js +17 -10
  36. package/lib/md043.js +2 -2
  37. package/lib/md044.js +20 -9
  38. package/lib/md046.js +14 -13
  39. package/lib/md048.js +13 -14
  40. package/lib/md049-md050.js +73 -0
  41. package/lib/md051.js +87 -0
  42. package/lib/md052.js +35 -0
  43. package/lib/md053.js +59 -0
  44. package/lib/rules.js +6 -4
  45. package/package.json +25 -18
  46. package/schema/.markdownlint.jsonc +19 -1
  47. package/schema/.markdownlint.yaml +18 -1
  48. package/schema/markdownlint-config-schema.json +126 -728
  49. package/lib/md049.js +0 -45
  50. 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
- };