markdownlint 0.33.0 → 0.35.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/CONTRIBUTING.md +4 -3
  3. package/README.md +25 -10
  4. package/demo/markdownlint-browser.js +3286 -2119
  5. package/doc/CustomRules.md +25 -13
  6. package/doc/Rules.md +106 -7
  7. package/doc/md013.md +8 -7
  8. package/doc/md034.md +5 -0
  9. package/doc/md044.md +10 -0
  10. package/doc/md049.md +3 -0
  11. package/doc/md050.md +3 -0
  12. package/doc/md051.md +26 -0
  13. package/doc/md058.md +48 -0
  14. package/helpers/README.md +3 -27
  15. package/helpers/helpers.js +60 -292
  16. package/helpers/micromark.cjs +153 -36
  17. package/helpers/package.json +2 -2
  18. package/lib/cache.js +62 -13
  19. package/lib/configuration-strict.d.ts +1185 -0
  20. package/lib/configuration.d.ts +3 -1173
  21. package/lib/constants.js +3 -2
  22. package/lib/markdownlint.d.ts +143 -61
  23. package/lib/markdownlint.js +151 -54
  24. package/lib/md001.js +17 -8
  25. package/lib/md003.js +16 -8
  26. package/lib/md004.js +57 -47
  27. package/lib/md005.js +7 -8
  28. package/lib/md007.js +13 -12
  29. package/lib/md009.js +52 -43
  30. package/lib/md010.js +50 -32
  31. package/lib/md011.js +18 -7
  32. package/lib/md012.js +19 -8
  33. package/lib/md013.js +46 -37
  34. package/lib/md014.js +37 -36
  35. package/lib/md018.js +20 -8
  36. package/lib/md019-md021.js +80 -0
  37. package/lib/md020.js +15 -6
  38. package/lib/md022.js +10 -12
  39. package/lib/md023.js +24 -22
  40. package/lib/md024.js +14 -8
  41. package/lib/md025.js +17 -9
  42. package/lib/md026.js +5 -6
  43. package/lib/md027.js +24 -43
  44. package/lib/md028.js +26 -14
  45. package/lib/md029.js +42 -33
  46. package/lib/md030.js +7 -8
  47. package/lib/md031.js +45 -22
  48. package/lib/md032.js +18 -30
  49. package/lib/md033.js +6 -4
  50. package/lib/md034.js +30 -9
  51. package/lib/md035.js +5 -3
  52. package/lib/md036.js +34 -39
  53. package/lib/md037.js +3 -0
  54. package/lib/md038.js +6 -5
  55. package/lib/md039.js +68 -52
  56. package/lib/md040.js +21 -21
  57. package/lib/md041.js +21 -26
  58. package/lib/md042.js +50 -36
  59. package/lib/md043.js +22 -13
  60. package/lib/md044.js +5 -2
  61. package/lib/md045.js +6 -4
  62. package/lib/md046.js +9 -8
  63. package/lib/md047.js +5 -2
  64. package/lib/md048.js +22 -13
  65. package/lib/md049-md050.js +19 -5
  66. package/lib/md051.js +18 -20
  67. package/lib/md052.js +5 -2
  68. package/lib/md053.js +5 -2
  69. package/lib/md054.js +12 -12
  70. package/lib/md055.js +10 -3
  71. package/lib/md056.js +18 -6
  72. package/lib/md058.js +43 -0
  73. package/lib/rules.js +11 -4
  74. package/package.json +22 -25
  75. package/schema/.markdownlint.jsonc +54 -51
  76. package/schema/.markdownlint.yaml +53 -50
  77. package/schema/ValidatingConfiguration.md +6 -8
  78. package/schema/markdownlint-config-schema-strict.json +1819 -0
  79. package/schema/markdownlint-config-schema.json +115 -105
  80. package/style/prettier.json +1 -0
  81. package/lib/md019.js +0 -39
  82. package/lib/md021.js +0 -62
@@ -7,6 +7,7 @@
7
7
  "code-fence-style": false,
8
8
  "emphasis-style": false,
9
9
  "heading-start-left": false,
10
+ "heading-style": false,
10
11
  "hr-style": false,
11
12
  "line-length": false,
12
13
  "list-indent": false,
package/lib/md019.js DELETED
@@ -1,39 +0,0 @@
1
- // @ts-check
2
-
3
- "use strict";
4
-
5
- const { addErrorContext, filterTokens, headingStyleFor } =
6
- require("../helpers");
7
-
8
- module.exports = {
9
- "names": [ "MD019", "no-multiple-space-atx" ],
10
- "description": "Multiple spaces after hash on atx style heading",
11
- "tags": [ "headings", "atx", "spaces" ],
12
- "function": function MD019(params, onError) {
13
- filterTokens(params, "heading_open", (token) => {
14
- if (headingStyleFor(token) === "atx") {
15
- const { line, lineNumber } = token;
16
- const match = /^(#+)([ \t]{2,})\S/.exec(line);
17
- if (match) {
18
- const [
19
- ,
20
- { "length": hashLength },
21
- { "length": spacesLength }
22
- ] = match;
23
- addErrorContext(
24
- onError,
25
- lineNumber,
26
- line.trim(),
27
- null,
28
- null,
29
- [ 1, hashLength + spacesLength + 1 ],
30
- {
31
- "editColumn": hashLength + 1,
32
- "deleteCount": spacesLength - 1
33
- }
34
- );
35
- }
36
- }
37
- });
38
- }
39
- };
package/lib/md021.js DELETED
@@ -1,62 +0,0 @@
1
- // @ts-check
2
-
3
- "use strict";
4
-
5
- const { addErrorContext, filterTokens, headingStyleFor } =
6
- require("../helpers");
7
-
8
- const closedAtxRe = /^(#+)([ \t]+)([^ \t]|[^ \t].*[^ \t])([ \t]+)(#+)(\s*)$/;
9
-
10
- module.exports = {
11
- "names": [ "MD021", "no-multiple-space-closed-atx" ],
12
- "description": "Multiple spaces inside hashes on closed atx style heading",
13
- "tags": [ "headings", "atx_closed", "spaces" ],
14
- "function": function MD021(params, onError) {
15
- filterTokens(params, "heading_open", (token) => {
16
- if (headingStyleFor(token) === "atx_closed") {
17
- const { line, lineNumber } = token;
18
- const match = closedAtxRe.exec(line);
19
- if (match) {
20
- const [
21
- ,
22
- leftHash,
23
- { "length": leftSpaceLength },
24
- content,
25
- { "length": rightSpaceLength },
26
- rightHash,
27
- { "length": trailSpaceLength }
28
- ] = match;
29
- const left = leftSpaceLength > 1;
30
- const right = rightSpaceLength > 1;
31
- if (left || right) {
32
- const length = line.length;
33
- const leftHashLength = leftHash.length;
34
- const rightHashLength = rightHash.length;
35
- const range = left ?
36
- [
37
- 1,
38
- leftHashLength + leftSpaceLength + 1
39
- ] :
40
- [
41
- length - trailSpaceLength - rightHashLength - rightSpaceLength,
42
- rightSpaceLength + rightHashLength + 1
43
- ];
44
- addErrorContext(
45
- onError,
46
- lineNumber,
47
- line.trim(),
48
- left,
49
- right,
50
- range,
51
- {
52
- "editColumn": 1,
53
- "deleteCount": length,
54
- "insertText": `${leftHash} ${content} ${rightHash}`
55
- }
56
- );
57
- }
58
- }
59
- }
60
- });
61
- }
62
- };