@alexlit/lint-kit 189.1.0 → 190.0.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.
Files changed (178) hide show
  1. package/package.json +1 -1
  2. package/packages/config-eslint/package.json +7 -7
  3. package/packages/config-eslint/plugins/json.js +1 -1
  4. package/packages/config-eslint/plugins/prettier.js +1 -1
  5. package/packages/config-eslint/plugins/unicorn.js +2 -1
  6. package/packages/config-markdownlint/node_modules/ansi-regex/index.d.ts +33 -0
  7. package/packages/config-markdownlint/node_modules/ansi-regex/index.js +14 -0
  8. package/packages/config-markdownlint/node_modules/ansi-regex/license +9 -0
  9. package/packages/config-markdownlint/node_modules/ansi-regex/package.json +61 -0
  10. package/packages/config-markdownlint/node_modules/ansi-regex/readme.md +66 -0
  11. package/packages/config-markdownlint/node_modules/markdownlint/CHANGELOG.md +529 -0
  12. package/packages/config-markdownlint/node_modules/markdownlint/CONTRIBUTING.md +92 -0
  13. package/packages/config-markdownlint/node_modules/markdownlint/LICENSE +21 -0
  14. package/packages/config-markdownlint/node_modules/markdownlint/README.md +1112 -0
  15. package/packages/config-markdownlint/node_modules/markdownlint/doc/CustomRules.md +194 -0
  16. package/packages/config-markdownlint/node_modules/markdownlint/doc/Prettier.md +27 -0
  17. package/packages/config-markdownlint/node_modules/markdownlint/doc/ReleaseProcess.md +20 -0
  18. package/packages/config-markdownlint/node_modules/markdownlint/doc/Rules.md +2858 -0
  19. package/packages/config-markdownlint/node_modules/markdownlint/doc/md001.md +51 -0
  20. package/packages/config-markdownlint/node_modules/markdownlint/doc/md003.md +59 -0
  21. package/packages/config-markdownlint/node_modules/markdownlint/doc/md004.md +50 -0
  22. package/packages/config-markdownlint/node_modules/markdownlint/doc/md005.md +53 -0
  23. package/packages/config-markdownlint/node_modules/markdownlint/doc/md007.md +52 -0
  24. package/packages/config-markdownlint/node_modules/markdownlint/doc/md009.md +50 -0
  25. package/packages/config-markdownlint/node_modules/markdownlint/doc/md010.md +62 -0
  26. package/packages/config-markdownlint/node_modules/markdownlint/doc/md011.md +30 -0
  27. package/packages/config-markdownlint/node_modules/markdownlint/doc/md012.md +38 -0
  28. package/packages/config-markdownlint/node_modules/markdownlint/doc/md013.md +58 -0
  29. package/packages/config-markdownlint/node_modules/markdownlint/doc/md014.md +54 -0
  30. package/packages/config-markdownlint/node_modules/markdownlint/doc/md018.md +27 -0
  31. package/packages/config-markdownlint/node_modules/markdownlint/doc/md019.md +28 -0
  32. package/packages/config-markdownlint/node_modules/markdownlint/doc/md020.md +29 -0
  33. package/packages/config-markdownlint/node_modules/markdownlint/doc/md021.md +31 -0
  34. package/packages/config-markdownlint/node_modules/markdownlint/doc/md022.md +67 -0
  35. package/packages/config-markdownlint/node_modules/markdownlint/doc/md023.md +33 -0
  36. package/packages/config-markdownlint/node_modules/markdownlint/doc/md024.md +44 -0
  37. package/packages/config-markdownlint/node_modules/markdownlint/doc/md025.md +49 -0
  38. package/packages/config-markdownlint/node_modules/markdownlint/doc/md026.md +40 -0
  39. package/packages/config-markdownlint/node_modules/markdownlint/doc/md027.md +32 -0
  40. package/packages/config-markdownlint/node_modules/markdownlint/doc/md028.md +44 -0
  41. package/packages/config-markdownlint/node_modules/markdownlint/doc/md029.md +100 -0
  42. package/packages/config-markdownlint/node_modules/markdownlint/doc/md030.md +82 -0
  43. package/packages/config-markdownlint/node_modules/markdownlint/doc/md031.md +50 -0
  44. package/packages/config-markdownlint/node_modules/markdownlint/doc/md032.md +55 -0
  45. package/packages/config-markdownlint/node_modules/markdownlint/doc/md033.md +33 -0
  46. package/packages/config-markdownlint/node_modules/markdownlint/doc/md034.md +55 -0
  47. package/packages/config-markdownlint/node_modules/markdownlint/doc/md035.md +44 -0
  48. package/packages/config-markdownlint/node_modules/markdownlint/doc/md036.md +45 -0
  49. package/packages/config-markdownlint/node_modules/markdownlint/doc/md037.md +37 -0
  50. package/packages/config-markdownlint/node_modules/markdownlint/doc/md038.md +52 -0
  51. package/packages/config-markdownlint/node_modules/markdownlint/doc/md039.md +21 -0
  52. package/packages/config-markdownlint/node_modules/markdownlint/doc/md040.md +52 -0
  53. package/packages/config-markdownlint/node_modules/markdownlint/doc/md041.md +64 -0
  54. package/packages/config-markdownlint/node_modules/markdownlint/doc/md042.md +38 -0
  55. package/packages/config-markdownlint/node_modules/markdownlint/doc/md043.md +87 -0
  56. package/packages/config-markdownlint/node_modules/markdownlint/doc/md044.md +45 -0
  57. package/packages/config-markdownlint/node_modules/markdownlint/doc/md045.md +48 -0
  58. package/packages/config-markdownlint/node_modules/markdownlint/doc/md046.md +40 -0
  59. package/packages/config-markdownlint/node_modules/markdownlint/doc/md047.md +34 -0
  60. package/packages/config-markdownlint/node_modules/markdownlint/doc/md048.md +42 -0
  61. package/packages/config-markdownlint/node_modules/markdownlint/doc/md049.md +36 -0
  62. package/packages/config-markdownlint/node_modules/markdownlint/doc/md050.md +35 -0
  63. package/packages/config-markdownlint/node_modules/markdownlint/doc/md051.md +117 -0
  64. package/packages/config-markdownlint/node_modules/markdownlint/doc/md052.md +52 -0
  65. package/packages/config-markdownlint/node_modules/markdownlint/doc/md053.md +38 -0
  66. package/packages/config-markdownlint/node_modules/markdownlint/doc/md054.md +100 -0
  67. package/packages/config-markdownlint/node_modules/markdownlint/doc/md055.md +55 -0
  68. package/packages/config-markdownlint/node_modules/markdownlint/doc/md056.md +37 -0
  69. package/packages/config-markdownlint/node_modules/markdownlint/doc/md058.md +48 -0
  70. package/packages/config-markdownlint/node_modules/markdownlint/doc/md059.md +33 -0
  71. package/packages/config-markdownlint/node_modules/markdownlint/doc/md060.md +130 -0
  72. package/packages/config-markdownlint/node_modules/markdownlint/helpers/LICENSE +21 -0
  73. package/packages/config-markdownlint/node_modules/markdownlint/helpers/README.md +29 -0
  74. package/packages/config-markdownlint/node_modules/markdownlint/helpers/helpers.cjs +695 -0
  75. package/packages/config-markdownlint/node_modules/markdownlint/helpers/micromark-helpers.cjs +332 -0
  76. package/packages/config-markdownlint/node_modules/markdownlint/helpers/package.json +26 -0
  77. package/packages/config-markdownlint/node_modules/markdownlint/helpers/shared.cjs +16 -0
  78. package/packages/config-markdownlint/node_modules/markdownlint/lib/cache.mjs +80 -0
  79. package/packages/config-markdownlint/node_modules/markdownlint/lib/configuration-strict.d.ts +2417 -0
  80. package/packages/config-markdownlint/node_modules/markdownlint/lib/configuration.d.ts +8 -0
  81. package/packages/config-markdownlint/node_modules/markdownlint/lib/constants.mjs +14 -0
  82. package/packages/config-markdownlint/node_modules/markdownlint/lib/defer-require.cjs +18 -0
  83. package/packages/config-markdownlint/node_modules/markdownlint/lib/exports-async.d.mts +1 -0
  84. package/packages/config-markdownlint/node_modules/markdownlint/lib/exports-async.mjs +3 -0
  85. package/packages/config-markdownlint/node_modules/markdownlint/lib/exports-promise.d.mts +1 -0
  86. package/packages/config-markdownlint/node_modules/markdownlint/lib/exports-promise.mjs +3 -0
  87. package/packages/config-markdownlint/node_modules/markdownlint/lib/exports-sync.d.mts +1 -0
  88. package/packages/config-markdownlint/node_modules/markdownlint/lib/exports-sync.mjs +3 -0
  89. package/packages/config-markdownlint/node_modules/markdownlint/lib/exports.d.mts +30 -0
  90. package/packages/config-markdownlint/node_modules/markdownlint/lib/exports.mjs +33 -0
  91. package/packages/config-markdownlint/node_modules/markdownlint/lib/markdownit.cjs +171 -0
  92. package/packages/config-markdownlint/node_modules/markdownlint/lib/markdownlint.d.mts +615 -0
  93. package/packages/config-markdownlint/node_modules/markdownlint/lib/markdownlint.mjs +1592 -0
  94. package/packages/config-markdownlint/node_modules/markdownlint/lib/md001.mjs +32 -0
  95. package/packages/config-markdownlint/node_modules/markdownlint/lib/md003.mjs +47 -0
  96. package/packages/config-markdownlint/node_modules/markdownlint/lib/md004.mjs +72 -0
  97. package/packages/config-markdownlint/node_modules/markdownlint/lib/md005.mjs +69 -0
  98. package/packages/config-markdownlint/node_modules/markdownlint/lib/md007.mjs +84 -0
  99. package/packages/config-markdownlint/node_modules/markdownlint/lib/md009.mjs +96 -0
  100. package/packages/config-markdownlint/node_modules/markdownlint/lib/md010.mjs +78 -0
  101. package/packages/config-markdownlint/node_modules/markdownlint/lib/md011.mjs +56 -0
  102. package/packages/config-markdownlint/node_modules/markdownlint/lib/md012.mjs +40 -0
  103. package/packages/config-markdownlint/node_modules/markdownlint/lib/md013.mjs +91 -0
  104. package/packages/config-markdownlint/node_modules/markdownlint/lib/md014.mjs +47 -0
  105. package/packages/config-markdownlint/node_modules/markdownlint/lib/md018.mjs +43 -0
  106. package/packages/config-markdownlint/node_modules/markdownlint/lib/md019-md021.mjs +77 -0
  107. package/packages/config-markdownlint/node_modules/markdownlint/lib/md020.mjs +68 -0
  108. package/packages/config-markdownlint/node_modules/markdownlint/lib/md022.mjs +103 -0
  109. package/packages/config-markdownlint/node_modules/markdownlint/lib/md023.mjs +37 -0
  110. package/packages/config-markdownlint/node_modules/markdownlint/lib/md024.mjs +45 -0
  111. package/packages/config-markdownlint/node_modules/markdownlint/lib/md025.mjs +45 -0
  112. package/packages/config-markdownlint/node_modules/markdownlint/lib/md026.mjs +46 -0
  113. package/packages/config-markdownlint/node_modules/markdownlint/lib/md027.mjs +50 -0
  114. package/packages/config-markdownlint/node_modules/markdownlint/lib/md028.mjs +39 -0
  115. package/packages/config-markdownlint/node_modules/markdownlint/lib/md029.mjs +84 -0
  116. package/packages/config-markdownlint/node_modules/markdownlint/lib/md030.mjs +57 -0
  117. package/packages/config-markdownlint/node_modules/markdownlint/lib/md031.mjs +61 -0
  118. package/packages/config-markdownlint/node_modules/markdownlint/lib/md032.mjs +78 -0
  119. package/packages/config-markdownlint/node_modules/markdownlint/lib/md033.mjs +46 -0
  120. package/packages/config-markdownlint/node_modules/markdownlint/lib/md034.mjs +92 -0
  121. package/packages/config-markdownlint/node_modules/markdownlint/lib/md035.mjs +23 -0
  122. package/packages/config-markdownlint/node_modules/markdownlint/lib/md036.mjs +55 -0
  123. package/packages/config-markdownlint/node_modules/markdownlint/lib/md037.mjs +94 -0
  124. package/packages/config-markdownlint/node_modules/markdownlint/lib/md038.mjs +73 -0
  125. package/packages/config-markdownlint/node_modules/markdownlint/lib/md039.mjs +59 -0
  126. package/packages/config-markdownlint/node_modules/markdownlint/lib/md040.mjs +32 -0
  127. package/packages/config-markdownlint/node_modules/markdownlint/lib/md041.mjs +71 -0
  128. package/packages/config-markdownlint/node_modules/markdownlint/lib/md042.mjs +58 -0
  129. package/packages/config-markdownlint/node_modules/markdownlint/lib/md043.mjs +72 -0
  130. package/packages/config-markdownlint/node_modules/markdownlint/lib/md044.mjs +110 -0
  131. package/packages/config-markdownlint/node_modules/markdownlint/lib/md045.mjs +61 -0
  132. package/packages/config-markdownlint/node_modules/markdownlint/lib/md046.mjs +31 -0
  133. package/packages/config-markdownlint/node_modules/markdownlint/lib/md047.mjs +28 -0
  134. package/packages/config-markdownlint/node_modules/markdownlint/lib/md048.mjs +47 -0
  135. package/packages/config-markdownlint/node_modules/markdownlint/lib/md049-md050.mjs +115 -0
  136. package/packages/config-markdownlint/node_modules/markdownlint/lib/md051.mjs +173 -0
  137. package/packages/config-markdownlint/node_modules/markdownlint/lib/md052.mjs +40 -0
  138. package/packages/config-markdownlint/node_modules/markdownlint/lib/md053.mjs +60 -0
  139. package/packages/config-markdownlint/node_modules/markdownlint/lib/md054.mjs +122 -0
  140. package/packages/config-markdownlint/node_modules/markdownlint/lib/md055.mjs +72 -0
  141. package/packages/config-markdownlint/node_modules/markdownlint/lib/md056.mjs +50 -0
  142. package/packages/config-markdownlint/node_modules/markdownlint/lib/md058.mjs +57 -0
  143. package/packages/config-markdownlint/node_modules/markdownlint/lib/md059.mjs +71 -0
  144. package/packages/config-markdownlint/node_modules/markdownlint/lib/md060.mjs +209 -0
  145. package/packages/config-markdownlint/node_modules/markdownlint/lib/micromark-parse.mjs +337 -0
  146. package/packages/config-markdownlint/node_modules/markdownlint/lib/micromark-types.d.mts +11 -0
  147. package/packages/config-markdownlint/node_modules/markdownlint/lib/node-imports-browser.mjs +22 -0
  148. package/packages/config-markdownlint/node_modules/markdownlint/lib/node-imports-node.mjs +11 -0
  149. package/packages/config-markdownlint/node_modules/markdownlint/lib/parse-configuration.mjs +47 -0
  150. package/packages/config-markdownlint/node_modules/markdownlint/lib/resolve-module.cjs +52 -0
  151. package/packages/config-markdownlint/node_modules/markdownlint/lib/resolve-module.d.cts +34 -0
  152. package/packages/config-markdownlint/node_modules/markdownlint/lib/rules.mjs +122 -0
  153. package/packages/config-markdownlint/node_modules/markdownlint/lib/types.d.mts +13 -0
  154. package/packages/config-markdownlint/node_modules/markdownlint/package.json +120 -0
  155. package/packages/config-markdownlint/node_modules/markdownlint/schema/.markdownlint.jsonc +349 -0
  156. package/packages/config-markdownlint/node_modules/markdownlint/schema/.markdownlint.yaml +310 -0
  157. package/packages/config-markdownlint/node_modules/markdownlint/schema/ValidatingConfiguration.md +26 -0
  158. package/packages/config-markdownlint/node_modules/markdownlint/schema/markdownlint-config-schema-strict.json +5138 -0
  159. package/packages/config-markdownlint/node_modules/markdownlint/schema/markdownlint-config-schema.json +5143 -0
  160. package/packages/config-markdownlint/node_modules/markdownlint/style/all.json +5 -0
  161. package/packages/config-markdownlint/node_modules/markdownlint/style/cirosantilli.json +22 -0
  162. package/packages/config-markdownlint/node_modules/markdownlint/style/prettier.json +27 -0
  163. package/packages/config-markdownlint/node_modules/markdownlint/style/relaxed.json +12 -0
  164. package/packages/config-markdownlint/node_modules/string-width/index.d.ts +39 -0
  165. package/packages/config-markdownlint/node_modules/string-width/index.js +203 -0
  166. package/packages/config-markdownlint/node_modules/string-width/license +9 -0
  167. package/packages/config-markdownlint/node_modules/string-width/package.json +65 -0
  168. package/packages/config-markdownlint/node_modules/string-width/readme.md +66 -0
  169. package/packages/config-markdownlint/node_modules/strip-ansi/index.d.ts +15 -0
  170. package/packages/config-markdownlint/node_modules/strip-ansi/index.js +19 -0
  171. package/packages/config-markdownlint/node_modules/strip-ansi/license +9 -0
  172. package/packages/config-markdownlint/node_modules/strip-ansi/package.json +59 -0
  173. package/packages/config-markdownlint/node_modules/strip-ansi/readme.md +37 -0
  174. package/packages/config-markdownlint/package.json +2 -2
  175. package/packages/config-npmlint/package.json +2 -2
  176. package/packages/config-stylelint/package.json +2 -2
  177. package/packages/config-stylelint/plugins/scss.js +1 -1
  178. package/packages/config-stylelint/plugins/selector-no-empty.js +1 -1
@@ -0,0 +1,35 @@
1
+ # `MD050` - Strong style
2
+
3
+ Tags: `emphasis`
4
+
5
+ Aliases: `strong-style`
6
+
7
+ Parameters:
8
+
9
+ - `style`: Strong style (`string`, default `consistent`, values `asterisk` /
10
+ `consistent` / `underscore`)
11
+
12
+ Fixable: Some violations can be fixed by tooling
13
+
14
+ This rule is triggered when the symbols used in the document for strong do not
15
+ match the configured strong style:
16
+
17
+ ```markdown
18
+ **Text**
19
+ __Text__
20
+ ```
21
+
22
+ To fix this issue, use the configured strong style throughout the document:
23
+
24
+ ```markdown
25
+ **Text**
26
+ **Text**
27
+ ```
28
+
29
+ The configured strong style can be a specific symbol to use (`asterisk`,
30
+ `underscore`) or can require all strong matches the first strong (`consistent`).
31
+
32
+ Note: Emphasis within a word is restricted to `asterisk` in order to avoid
33
+ unwanted emphasis for words containing internal underscores like__this__one.
34
+
35
+ Rationale: Consistent formatting makes it easier to understand a document.
@@ -0,0 +1,117 @@
1
+ # `MD051` - Link fragments should be valid
2
+
3
+ Tags: `links`
4
+
5
+ Aliases: `link-fragments`
6
+
7
+ Parameters:
8
+
9
+ - `ignore_case`: Ignore case of fragments (`boolean`, default `false`)
10
+ - `ignored_pattern`: Pattern for ignoring additional fragments (`string`,
11
+ default ``)
12
+
13
+ Fixable: Some violations can be fixed by tooling
14
+
15
+ This rule is triggered when a link fragment does not match any of the fragments
16
+ that are automatically generated for headings in a document:
17
+
18
+ ```markdown
19
+ # Heading Name
20
+
21
+ [Link](#fragment)
22
+ ```
23
+
24
+ To fix this issue, change the link fragment to reference an existing heading's
25
+ generated name (see below):
26
+
27
+ ```markdown
28
+ # Heading Name
29
+
30
+ [Link](#heading-name)
31
+ ```
32
+
33
+ For consistency, this rule requires fragments to exactly match the [GitHub
34
+ heading algorithm][github-heading-algorithm] which converts letters to
35
+ lowercase. Therefore, the following example is reported as a violation:
36
+
37
+ ```markdown
38
+ # Heading Name
39
+
40
+ [Link](#Heading-Name)
41
+ ```
42
+
43
+ To ignore case when comparing fragments with heading names, the `ignore_case`
44
+ parameter can be set to `true`. In this configuration, the previous example is
45
+ not reported as a violation.
46
+
47
+ Alternatively, some platforms allow the syntax `{#named-anchor}` to be used
48
+ within a heading to provide a specific name (consisting of only lower-case
49
+ letters, numbers, `-`, and `_`):
50
+
51
+ ```markdown
52
+ # Heading Name {#custom-name}
53
+
54
+ [Link](#custom-name)
55
+ ```
56
+
57
+ Alternatively, any HTML tag with an `id` attribute or an `a` tag with a `name`
58
+ attribute can be used to define a fragment:
59
+
60
+ ```markdown
61
+ <a id="bookmark"></a>
62
+
63
+ [Link](#bookmark)
64
+ ```
65
+
66
+ An `a` tag can be useful in scenarios where a heading is not appropriate or for
67
+ control over the text of the fragment identifier.
68
+
69
+ [HTML links to `#top` scroll to the top of a document][html-top-fragment]. This
70
+ rule allows that syntax (using lower-case for consistency):
71
+
72
+ ```markdown
73
+ [Link](#top)
74
+ ```
75
+
76
+ This rule also recognizes the custom fragment syntax used by GitHub to highlight
77
+ [specific content in a document][github-linking-to-content].
78
+
79
+ For example, this link to line 20:
80
+
81
+ ```markdown
82
+ [Link](#L20)
83
+ ```
84
+
85
+ And this link to content starting within line 19 running into line 21:
86
+
87
+ ```markdown
88
+ [Link](#L19C5-L21C11)
89
+ ```
90
+
91
+ Some Markdown generators dynamically create and insert headings when building
92
+ documents, for example by combining a fixed prefix like `figure-` and an
93
+ incrementing numeric counter. To ignore such generated fragments, set the
94
+ `ignored_pattern` [regular expression][RegEx] parameter to a pattern that
95
+ matches (e.g., `^figure-`).
96
+
97
+ Rationale: [GitHub section links][github-section-links] are created
98
+ automatically for every heading when Markdown content is displayed on GitHub.
99
+ This makes it easy to link directly to different sections within a document.
100
+ However, section links change if headings are renamed or removed. This rule
101
+ helps identify broken section links within a document.
102
+
103
+ Note: Section links are **not** part of the CommonMark specification; this rule
104
+ enforces the [GitHub heading algorithm][github-heading-algorithm]:
105
+
106
+ 1. Convert text to lowercase
107
+ 2. Remove punctuation characters
108
+ 3. Convert spaces to dashes
109
+ 4. Append an incrementing integer (as needed for uniqueness)
110
+ 5. [URI-encode][encodeURIComponent] the result
111
+
112
+ [encodeURIComponent]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
113
+ [github-section-links]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#section-links
114
+ [github-heading-algorithm]: https://github.com/gjtorikian/html-pipeline/blob/f13a1534cb650ba17af400d1acd3a22c28004c09/lib/html/pipeline/toc_filter.rb
115
+ [github-linking-to-content]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-a-permanent-link-to-a-code-snippet#linking-to-markdown
116
+ [html-top-fragment]: https://html.spec.whatwg.org/multipage/browsing-the-web.html#scrolling-to-a-fragment
117
+ [RegEx]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions
@@ -0,0 +1,52 @@
1
+ # `MD052` - Reference links and images should use a label that is defined
2
+
3
+ Tags: `images`, `links`
4
+
5
+ Aliases: `reference-links-images`
6
+
7
+ Parameters:
8
+
9
+ - `ignored_labels`: Ignored link labels (`string[]`, default `["x"]`)
10
+ - `shortcut_syntax`: Include shortcut syntax (`boolean`, default `false`)
11
+
12
+ Links and images in Markdown can provide the link destination or image source
13
+ at the time of use or can define it elsewhere and use a label for reference.
14
+ The reference format is convenient for keeping paragraph text clutter-free
15
+ and makes it easy to reuse the same URL in multiple places.
16
+
17
+ There are three kinds of reference links and images:
18
+
19
+ ```markdown
20
+ Full: [text][label]
21
+ Collapsed: [label][]
22
+ Shortcut: [label]
23
+
24
+ Full: ![text][image]
25
+ Collapsed: ![image][]
26
+ Shortcut: ![image]
27
+
28
+ [label]: https://example.com/label
29
+ [image]: https://example.com/image
30
+ ```
31
+
32
+ A link or image renders correctly when the corresponding label is defined, but
33
+ displays as text with brackets when the label is not present. By default, this
34
+ rule warns of undefined labels for "full" and "collapsed" reference syntax but
35
+ not for "shortcut" syntax because it is ambiguous.
36
+
37
+ The text `[example]` could be a shortcut link or the text "example" in brackets,
38
+ so "shortcut" syntax is ignored by default. To include "shortcut" syntax, set
39
+ the `include_shortcut` parameter to `true`. Note that doing so produces warnings
40
+ for *all* text in the document that *could* be a shortcut. If bracketed text is
41
+ intentional, brackets can be escaped with the `\` character: `\[example\]`.
42
+
43
+ If there are link labels that are deliberately unreferenced, they can be ignored
44
+ by setting the `ignored_labels` parameter to the list of strings to ignore. The
45
+ default value of this parameter ignores the checkbox syntax used by
46
+ [GitHub Flavored Markdown task list items][gfm-tasklist]:
47
+
48
+ ```markdown
49
+ - [x] Checked task list item
50
+ ```
51
+
52
+ [gfm-tasklist]: https://github.github.com/gfm/#task-list-items-extension-
@@ -0,0 +1,38 @@
1
+ # `MD053` - Link and image reference definitions should be needed
2
+
3
+ Tags: `images`, `links`
4
+
5
+ Aliases: `link-image-reference-definitions`
6
+
7
+ Parameters:
8
+
9
+ - `ignored_definitions`: Ignored definitions (`string[]`, default `["//"]`)
10
+
11
+ Fixable: Some violations can be fixed by tooling
12
+
13
+ Links and images in Markdown can provide the link destination or image source
14
+ at the time of use or can use a label to reference a definition elsewhere in
15
+ the document. The latter reference format is convenient for keeping paragraph
16
+ text clutter-free and makes it easy to reuse the same URL in multiple places.
17
+
18
+ Because link and image reference definitions are located separately from
19
+ where they are used, there are two scenarios where a definition can be
20
+ unnecessary:
21
+
22
+ 1. If a label is not referenced by any link or image in a document, that
23
+ definition is unused and can be deleted.
24
+ 2. If a label is defined multiple times in a document, the first definition is
25
+ used and the others can be deleted.
26
+
27
+ This rule considers a reference definition to be used if any link or image
28
+ reference has the corresponding label. The "full", "collapsed", and "shortcut"
29
+ formats are all supported.
30
+
31
+ If there are reference definitions that are deliberately unreferenced, they can
32
+ be ignored by setting the `ignored_definitions` parameter to the list of strings
33
+ to ignore. The default value of this parameter ignores the following convention
34
+ for adding non-HTML comments to Markdown:
35
+
36
+ ```markdown
37
+ [//]: # (This behaves like a comment)
38
+ ```
@@ -0,0 +1,100 @@
1
+ # `MD054` - Link and image style
2
+
3
+ Tags: `images`, `links`
4
+
5
+ Aliases: `link-image-style`
6
+
7
+ Parameters:
8
+
9
+ - `autolink`: Allow autolinks (`boolean`, default `true`)
10
+ - `collapsed`: Allow collapsed reference links and images (`boolean`, default
11
+ `true`)
12
+ - `full`: Allow full reference links and images (`boolean`, default `true`)
13
+ - `inline`: Allow inline links and images (`boolean`, default `true`)
14
+ - `shortcut`: Allow shortcut reference links and images (`boolean`, default
15
+ `true`)
16
+ - `url_inline`: Allow URLs as inline links (`boolean`, default `true`)
17
+
18
+ Fixable: Some violations can be fixed by tooling
19
+
20
+ Links and images in Markdown can provide the link destination or image source at
21
+ the time of use or can use a label to reference a definition elsewhere in the
22
+ document. The three reference formats are convenient for keeping paragraph text
23
+ clutter-free and make it easy to reuse the same URL in multiple places.
24
+
25
+ By default, this rule allows all link/image styles.
26
+
27
+ Setting the `autolink` parameter to `false` disables autolinks:
28
+
29
+ ```markdown
30
+ <https://example.com>
31
+ ```
32
+
33
+ Setting the `inline` parameter to `false` disables inline links and images:
34
+
35
+ ```markdown
36
+ [link](https://example.com)
37
+
38
+ ![image](https://example.com)
39
+ ```
40
+
41
+ Setting the `full` parameter to `false` disables full reference links and
42
+ images:
43
+
44
+ ```markdown
45
+ [link][url]
46
+
47
+ ![image][url]
48
+
49
+ [url]: https://example.com
50
+ ```
51
+
52
+ Setting the `collapsed` parameter to `false` disables collapsed reference links
53
+ and images:
54
+
55
+ ```markdown
56
+ [url][]
57
+
58
+ ![url][]
59
+
60
+ [url]: https://example.com
61
+ ```
62
+
63
+ Setting the `shortcut` parameter to `false` disables shortcut reference links
64
+ and images:
65
+
66
+ ```markdown
67
+ [url]
68
+
69
+ ![url]
70
+
71
+ [url]: https://example.com
72
+ ```
73
+
74
+ To fix violations of this rule, change the link or image to use an allowed
75
+ style. This rule can automatically fix violations when a link or image can be
76
+ converted to the `inline` style (preferred) or a link can be converted to the
77
+ `autolink` style (which does not support images and must be an absolute URL).
78
+ This rule does *not* fix scenarios that require converting a link or image to
79
+ the `full`, `collapsed`, or `shortcut` reference styles because that involves
80
+ naming the reference and determining where to insert it in the document.
81
+
82
+ Setting the `url_inline` parameter to `false` prevents the use of inline links
83
+ with the same absolute URL text/destination and no title because such links can
84
+ be converted to autolinks:
85
+
86
+ ```markdown
87
+ [https://example.com](https://example.com)
88
+ ```
89
+
90
+ To fix `url_inline` violations, use the simpler autolink syntax instead:
91
+
92
+ ```markdown
93
+ <https://example.com>
94
+ ```
95
+
96
+ Rationale: Consistent formatting makes it easier to understand a document.
97
+ Autolinks are concise, but appear as URLs which can be long and confusing.
98
+ Inline links and images can include descriptive text, but take up more space in
99
+ Markdown form. Reference links and images can be easier to read and manipulate
100
+ in Markdown form, but require a separate link reference definition.
@@ -0,0 +1,55 @@
1
+ # `MD055` - Table pipe style
2
+
3
+ Tags: `table`
4
+
5
+ Aliases: `table-pipe-style`
6
+
7
+ Parameters:
8
+
9
+ - `style`: Table pipe style (`string`, default `consistent`, values
10
+ `consistent` / `leading_and_trailing` / `leading_only` /
11
+ `no_leading_or_trailing` / `trailing_only`)
12
+
13
+ This rule is triggered when a [GitHub Flavored Markdown table][gfm-table-055]
14
+ is inconsistent about its use of leading and trailing pipe characters (`|`).
15
+
16
+ By default (`consistent` style), the header row of the first table in a document
17
+ is used to determine the style that is enforced for every table in the document.
18
+ A specific style can be used instead (`leading_and_trailing`, `leading_only`,
19
+ `no_leading_or_trailing`, `trailing_only`).
20
+
21
+ This table's header row has leading and trailing pipes, but its delimiter row is
22
+ missing the trailing pipe and its first row of cells is missing the leading
23
+ pipe:
24
+
25
+ ```markdown
26
+ | Header | Header |
27
+ | ------ | ------
28
+ Cell | Cell |
29
+ ```
30
+
31
+ To fix these issues, make sure there is a pipe character at the beginning and
32
+ end of every row:
33
+
34
+ ```markdown
35
+ | Header | Header |
36
+ | ------ | ------ |
37
+ | Cell | Cell |
38
+ ```
39
+
40
+ Note that text immediately following a table (i.e., not separated by an empty
41
+ line) is treated as part of the table (per the specification) and may also
42
+ trigger this rule:
43
+
44
+ ```markdown
45
+ | Header | Header |
46
+ | ------ | ------ |
47
+ | Cell | Cell |
48
+ This text is part of the table
49
+ ```
50
+
51
+ Rationale: Some parsers have difficulty with tables that are missing their
52
+ leading or trailing pipe characters. The use of leading/trailing pipes can also
53
+ help provide visual clarity.
54
+
55
+ [gfm-table-055]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables
@@ -0,0 +1,37 @@
1
+ # `MD056` - Table column count
2
+
3
+ Tags: `table`
4
+
5
+ Aliases: `table-column-count`
6
+
7
+ This rule is triggered when a [GitHub Flavored Markdown table][gfm-table-056]
8
+ does not have the same number of cells in every row.
9
+
10
+ This table's second data row has too few cells and its third data row has too
11
+ many cells:
12
+
13
+ ```markdown
14
+ | Header | Header |
15
+ | ------ | ------ |
16
+ | Cell | Cell |
17
+ | Cell |
18
+ | Cell | Cell | Cell |
19
+ ```
20
+
21
+ To fix these issues, ensure every row has the same number of cells:
22
+
23
+ ```markdown
24
+ | Header | Header |
25
+ | ------ | ------ |
26
+ | Cell | Cell |
27
+ | Cell | Cell |
28
+ | Cell | Cell |
29
+ ```
30
+
31
+ Note that a table's header row and its delimiter row must have the same number
32
+ of cells or it will not be recognized as a table (per specification).
33
+
34
+ Rationale: Extra cells in a row are usually not shown, so their data is lost.
35
+ Missing cells in a row create holes in the table and suggest an omission.
36
+
37
+ [gfm-table-056]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables
@@ -0,0 +1,48 @@
1
+ # `MD058` - Tables should be surrounded by blank lines
2
+
3
+ Tags: `table`
4
+
5
+ Aliases: `blanks-around-tables`
6
+
7
+ Fixable: Some violations can be fixed by tooling
8
+
9
+ This rule is triggered when tables are either not preceded or not followed by a
10
+ blank line:
11
+
12
+ ```markdown
13
+ Some text
14
+ | Header | Header |
15
+ | ------ | ------ |
16
+ | Cell | Cell |
17
+ > Blockquote
18
+ ```
19
+
20
+ To fix violations of this rule, ensure that all tables have a blank line both
21
+ before and after (except when the table is at the very beginning or end of the
22
+ document):
23
+
24
+ ```markdown
25
+ Some text
26
+
27
+ | Header | Header |
28
+ | ------ | ------ |
29
+ | Cell | Cell |
30
+
31
+ > Blockquote
32
+ ```
33
+
34
+ Note that text immediately following a table (i.e., not separated by an empty
35
+ line) is treated as part of the table (per the specification) and will not
36
+ trigger this rule:
37
+
38
+ ```markdown
39
+ | Header | Header |
40
+ | ------ | ------ |
41
+ | Cell | Cell |
42
+ This text is part of the table and the next line is blank
43
+
44
+ Some text
45
+ ```
46
+
47
+ Rationale: In addition to aesthetic reasons, some parsers will incorrectly parse
48
+ tables that don't have blank lines before and after them.
@@ -0,0 +1,33 @@
1
+ # `MD059` - Link text should be descriptive
2
+
3
+ Tags: `accessibility`, `links`
4
+
5
+ Aliases: `descriptive-link-text`
6
+
7
+ Parameters:
8
+
9
+ - `prohibited_texts`: Prohibited link texts (`string[]`, default `["click
10
+ here","here","link","more"]`)
11
+
12
+ This rule is triggered when a link has generic text like `[click here](...)` or
13
+ `[link](...)`.
14
+
15
+ Link text should be descriptive and communicate the purpose of the link (e.g.,
16
+ `[Download the budget document](...)` or `[CommonMark Specification](...)`).
17
+ This is especially important for screen readers which sometimes present links
18
+ without context.
19
+
20
+ By default, this rule prohibits a small number of common English words/phrases.
21
+ To customize that list of words/phrases, set the `prohibited_texts` parameter to
22
+ an `Array` of `string`s.
23
+
24
+ Note: For languages other than English, use the `prohibited_texts` parameter to
25
+ customize the list for that language. It is *not* a goal for this rule to have
26
+ translations for every language.
27
+
28
+ Note: This rule checks Markdown links; HTML links are ignored.
29
+
30
+ More information:
31
+
32
+ - <https://webaim.org/techniques/hypertext/>
33
+ - <https://www.w3.org/WAI/WCAG21/Understanding/link-purpose-link-only.html>
@@ -0,0 +1,130 @@
1
+ # `MD060` - Table column style
2
+
3
+ Tags: `table`
4
+
5
+ Aliases: `table-column-style`
6
+
7
+ Parameters:
8
+
9
+ - `aligned_delimiter`: Aligned delimiter columns (`boolean`, default `false`)
10
+ - `style`: Table column style (`string`, default `any`, values `aligned` /
11
+ `any` / `compact` / `tight`)
12
+
13
+ Fixable: Some violations can be fixed by tooling
14
+
15
+ This rule is triggered when the column separator pipe characters (`|`) of a
16
+ [GitHub Flavored Markdown table][gfm-table-060] are used inconsistently.
17
+
18
+ This rule recognizes three table column styles based on popular use.
19
+
20
+ Style `aligned` ensures pipe characters are vertically aligned:
21
+
22
+ ```markdown
23
+ | Character | Meaning |
24
+ | --------- | ------- |
25
+ | Y | Yes |
26
+ | N | No |
27
+ ```
28
+
29
+ The `aligned` style ignores cell content, so the following is also valid:
30
+
31
+ ```markdown
32
+ | Character | Meaning |
33
+ |-----------|---------|
34
+ | Y | Yes |
35
+ | N | No |
36
+ ```
37
+
38
+ Style `compact` avoids extra padding with a single space around cell content:
39
+
40
+ ```markdown
41
+ | Character | Meaning |
42
+ | --- | --- |
43
+ | Y | Yes |
44
+ | N | No |
45
+ ```
46
+
47
+ Style `tight` uses no padding at all for cell content:
48
+
49
+ ```markdown
50
+ |Character|Meaning|
51
+ |---|---|
52
+ |Y|Yes|
53
+ |N|No|
54
+ ```
55
+
56
+ When this rule's `style` parameter is set to `aligned`, `compact`, or `tight`,
57
+ every table must match the corresponding pattern and any violations will be
58
+ reported. By default, or when the `any` style is used, each table is analyzed to
59
+ see if it satisfies any supported style. If so, no violations are reported. If
60
+ not, violations are be reported for whichever style would produce the *fewest*
61
+ issues (i.e., whichever style is the closest match).
62
+
63
+ Setting the `aligned_delimiter` parameter to `true` requires pipe characters in
64
+ the delimiter row to align with those in the header row. This can be used with
65
+ `compact` and `tight` tables to make the header text more obvious. (It's already
66
+ required for tables with style `aligned`.)
67
+
68
+ Style `compact` with `aligned_delimiter`:
69
+
70
+ ```markdown
71
+ | Character | Meaning |
72
+ | --------- | ------- |
73
+ | Y | Yes |
74
+ | N | No |
75
+ ```
76
+
77
+ Style `tight` with `aligned_delimiter`:
78
+
79
+ ```markdown
80
+ |Character|Meaning|
81
+ |---------|-------|
82
+ |Y|Yes|
83
+ |N|No|
84
+ ```
85
+
86
+ Violations for styles `compact` and `tight` are simple/independent and can be
87
+ fixed automatically. However, fixing even single violations for style `aligned`
88
+ may require modifying the entire table, and therefore are not automatic:
89
+
90
+ ```markdown
91
+ |Alpha |Delta|
92
+ |------|-----|
93
+ |Charlie|Beta|
94
+ ```
95
+
96
+ **Note**: This rule does not require leading/trailing pipe characters, so this
97
+ is also a valid table for style `compact`:
98
+
99
+ ```markdown
100
+ Character | Meaning
101
+ --- | ---
102
+ Y | Yes
103
+ N | No
104
+ ```
105
+
106
+ **Note**: Pipe alignment for the `aligned` style is based on visual appearance
107
+ and not character count. Because editors typically render [emoji][emoji] and
108
+ [CJK characters][cjk-characters] at *twice* the width of
109
+ [Latin characters][latin-script], this rule takes that into account for tables
110
+ using the `aligned` style. The following table is correctly formatted and will
111
+ appear aligned in most editors and monospaced fonts:
112
+
113
+ <!-- markdownlint-capture -->
114
+ <!-- markdownlint-disable extended-ascii -->
115
+
116
+ ```markdown
117
+ | Response | Emoji |
118
+ | -------- | ----- |
119
+ | Yes | ✅ |
120
+ | No | ❎ |
121
+ ```
122
+
123
+ <!-- markdownlint-restore -->
124
+
125
+ Rationale: Consistent formatting makes it easier to understand a document.
126
+
127
+ [cjk-characters]: https://wikipedia.org/wiki/CJK_characters
128
+ [emoji]: https://wikipedia.org/wiki/Emoji
129
+ [gfm-table-060]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables
130
+ [latin-script]: https://wikipedia.org/wiki/Latin_script
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) David Anson
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.