@redocly/recheck 0.15.0 → 2.58.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 (1034) hide show
  1. package/README.md +71 -1886
  2. package/examples/appendices/google.appendix.yaml +1 -1
  3. package/examples/appendices/inclusive-language.appendix.yaml +1 -1
  4. package/examples/appendices/microsoft.appendix.yaml +1 -1
  5. package/examples/appendices/plain-language.appendix.yaml +1 -1
  6. package/examples/appendices/technical-english.appendix.yaml +1 -1
  7. package/examples/google.yaml +7 -7
  8. package/examples/inclusive-language.yaml +7 -7
  9. package/examples/microsoft.yaml +7 -7
  10. package/examples/plain-language.yaml +7 -7
  11. package/examples/technical-english.yaml +7 -7
  12. package/lib/actions/baseline.d.ts +15 -0
  13. package/lib/actions/baseline.d.ts.map +1 -0
  14. package/lib/actions/baseline.js +51 -0
  15. package/lib/actions/baseline.js.map +1 -0
  16. package/lib/actions/lint.d.ts +51 -0
  17. package/lib/actions/lint.d.ts.map +1 -0
  18. package/lib/actions/lint.js +123 -0
  19. package/lib/actions/lint.js.map +1 -0
  20. package/lib/actions/markdoc-schema.d.ts +34 -0
  21. package/lib/actions/markdoc-schema.d.ts.map +1 -0
  22. package/lib/actions/markdoc-schema.js +106 -0
  23. package/lib/actions/markdoc-schema.js.map +1 -0
  24. package/lib/actions/readability.d.ts +25 -0
  25. package/lib/actions/readability.d.ts.map +1 -0
  26. package/lib/actions/readability.js +47 -0
  27. package/lib/actions/readability.js.map +1 -0
  28. package/lib/actions/roots.d.ts +7 -0
  29. package/lib/actions/roots.d.ts.map +1 -0
  30. package/lib/actions/roots.js +36 -0
  31. package/lib/actions/roots.js.map +1 -0
  32. package/lib/config/presets/api-descriptions.d.ts +8 -0
  33. package/lib/config/presets/api-descriptions.d.ts.map +1 -0
  34. package/lib/config/presets/api-descriptions.js +24 -0
  35. package/lib/config/presets/api-descriptions.js.map +1 -0
  36. package/lib/config/presets/google.d.ts +3 -0
  37. package/lib/config/presets/google.d.ts.map +1 -0
  38. package/lib/config/presets/google.js +1086 -0
  39. package/lib/config/presets/google.js.map +1 -0
  40. package/lib/config/presets/inclusive-language.d.ts +3 -0
  41. package/lib/config/presets/inclusive-language.d.ts.map +1 -0
  42. package/lib/config/presets/inclusive-language.js +151 -0
  43. package/lib/config/presets/inclusive-language.js.map +1 -0
  44. package/lib/config/presets/index.d.ts +16 -0
  45. package/lib/config/presets/index.d.ts.map +1 -0
  46. package/lib/config/presets/index.js +38 -0
  47. package/lib/config/presets/index.js.map +1 -0
  48. package/lib/config/presets/markdoc.d.ts +3 -0
  49. package/lib/config/presets/markdoc.d.ts.map +1 -0
  50. package/lib/config/presets/markdoc.js +45 -0
  51. package/lib/config/presets/markdoc.js.map +1 -0
  52. package/lib/config/presets/markdown-relaxed.d.ts +3 -0
  53. package/lib/config/presets/markdown-relaxed.d.ts.map +1 -0
  54. package/lib/config/presets/markdown-relaxed.js +34 -0
  55. package/lib/config/presets/markdown-relaxed.js.map +1 -0
  56. package/lib/config/presets/markdown.d.ts +11 -0
  57. package/lib/config/presets/markdown.d.ts.map +1 -0
  58. package/lib/config/presets/markdown.js +73 -0
  59. package/lib/config/presets/markdown.js.map +1 -0
  60. package/lib/config/presets/microsoft.d.ts +3 -0
  61. package/lib/config/presets/microsoft.d.ts.map +1 -0
  62. package/lib/config/presets/microsoft.js +1260 -0
  63. package/lib/config/presets/microsoft.js.map +1 -0
  64. package/lib/config/presets/minimal.d.ts +3 -0
  65. package/lib/config/presets/minimal.d.ts.map +1 -0
  66. package/lib/config/presets/minimal.js +13 -0
  67. package/lib/config/presets/minimal.js.map +1 -0
  68. package/lib/config/presets/plain-language.d.ts +3 -0
  69. package/lib/config/presets/plain-language.d.ts.map +1 -0
  70. package/lib/config/presets/plain-language.js +175 -0
  71. package/lib/config/presets/plain-language.js.map +1 -0
  72. package/lib/config/presets/prose.d.ts +3 -0
  73. package/lib/config/presets/prose.d.ts.map +1 -0
  74. package/lib/config/presets/prose.js +60 -0
  75. package/lib/config/presets/prose.js.map +1 -0
  76. package/lib/config/presets/technical-english.d.ts +22 -0
  77. package/lib/config/presets/technical-english.d.ts.map +1 -0
  78. package/lib/config/presets/technical-english.js +61 -0
  79. package/lib/config/presets/technical-english.js.map +1 -0
  80. package/lib/config/resolve.d.ts +36 -0
  81. package/lib/config/resolve.d.ts.map +1 -0
  82. package/lib/config/resolve.js +106 -0
  83. package/lib/config/resolve.js.map +1 -0
  84. package/lib/config/schema.d.ts +215 -0
  85. package/lib/config/schema.d.ts.map +1 -0
  86. package/lib/config/schema.js +152 -0
  87. package/lib/config/schema.js.map +1 -0
  88. package/lib/config/validate.d.ts +19 -0
  89. package/lib/config/validate.d.ts.map +1 -0
  90. package/lib/config/validate.js +1049 -0
  91. package/lib/config/validate.js.map +1 -0
  92. package/lib/core/auto-fix.d.ts.map +1 -0
  93. package/lib/core/auto-fix.js +94 -0
  94. package/lib/core/auto-fix.js.map +1 -0
  95. package/lib/core/baseline.d.ts +43 -0
  96. package/lib/core/baseline.d.ts.map +1 -0
  97. package/lib/core/baseline.js +142 -0
  98. package/lib/core/baseline.js.map +1 -0
  99. package/lib/core/case-preserve.d.ts +11 -0
  100. package/lib/core/case-preserve.d.ts.map +1 -0
  101. package/lib/core/case-preserve.js +22 -0
  102. package/lib/core/case-preserve.js.map +1 -0
  103. package/lib/core/directives.d.ts.map +1 -0
  104. package/lib/core/directives.js +66 -0
  105. package/lib/core/directives.js.map +1 -0
  106. package/lib/core/files.d.ts +31 -0
  107. package/lib/core/files.d.ts.map +1 -0
  108. package/lib/core/files.js +184 -0
  109. package/lib/core/files.js.map +1 -0
  110. package/lib/core/inline-code.d.ts +33 -0
  111. package/lib/core/inline-code.d.ts.map +1 -0
  112. package/lib/core/inline-code.js +50 -0
  113. package/lib/core/inline-code.js.map +1 -0
  114. package/lib/core/line-endings.d.ts +13 -0
  115. package/lib/core/line-endings.d.ts.map +1 -0
  116. package/lib/core/line-endings.js +39 -0
  117. package/lib/core/line-endings.js.map +1 -0
  118. package/lib/core/markdoc-tags.d.ts +48 -0
  119. package/lib/core/markdoc-tags.d.ts.map +1 -0
  120. package/lib/core/markdoc-tags.js +102 -0
  121. package/lib/core/markdoc-tags.js.map +1 -0
  122. package/lib/core/prose-extract.d.ts +6 -0
  123. package/lib/core/prose-extract.d.ts.map +1 -0
  124. package/lib/core/prose-extract.js +71 -0
  125. package/lib/core/prose-extract.js.map +1 -0
  126. package/lib/core/readability.d.ts +17 -0
  127. package/lib/core/readability.d.ts.map +1 -0
  128. package/lib/core/readability.js +34 -0
  129. package/lib/core/readability.js.map +1 -0
  130. package/lib/core/rule-filters.d.ts +29 -0
  131. package/lib/core/rule-filters.d.ts.map +1 -0
  132. package/lib/core/rule-filters.js +88 -0
  133. package/lib/core/rule-filters.js.map +1 -0
  134. package/lib/core/runner.d.ts +60 -0
  135. package/lib/core/runner.d.ts.map +1 -0
  136. package/lib/core/runner.js +305 -0
  137. package/lib/core/runner.js.map +1 -0
  138. package/lib/core/summary.d.ts +4 -0
  139. package/lib/core/summary.d.ts.map +1 -0
  140. package/lib/core/summary.js +37 -0
  141. package/lib/core/summary.js.map +1 -0
  142. package/lib/core/timing.d.ts +9 -0
  143. package/lib/core/timing.d.ts.map +1 -0
  144. package/lib/core/timing.js +19 -0
  145. package/lib/core/timing.js.map +1 -0
  146. package/lib/data/markdoc-realm-schema.d.ts.map +1 -0
  147. package/lib/data/markdoc-realm-schema.js +782 -0
  148. package/lib/data/markdoc-realm-schema.js.map +1 -0
  149. package/lib/data/proper-nouns.d.ts.map +1 -0
  150. package/lib/data/proper-nouns.js +42 -0
  151. package/lib/data/proper-nouns.js.map +1 -0
  152. package/lib/data/realm-front-matter-schema.d.ts +12 -0
  153. package/lib/data/realm-front-matter-schema.d.ts.map +1 -0
  154. package/lib/data/realm-front-matter-schema.js +51 -0
  155. package/lib/data/realm-front-matter-schema.js.map +1 -0
  156. package/lib/index.d.ts +81 -0
  157. package/lib/index.d.ts.map +1 -0
  158. package/lib/index.js +114 -0
  159. package/lib/index.js.map +1 -0
  160. package/lib/metrics/formulas.d.ts +9 -0
  161. package/lib/metrics/formulas.d.ts.map +1 -0
  162. package/lib/metrics/formulas.js +59 -0
  163. package/lib/metrics/formulas.js.map +1 -0
  164. package/lib/metrics/statistics.d.ts +14 -0
  165. package/lib/metrics/statistics.d.ts.map +1 -0
  166. package/lib/metrics/statistics.js +35 -0
  167. package/lib/metrics/statistics.js.map +1 -0
  168. package/lib/parser/index.d.ts +13 -0
  169. package/lib/parser/index.d.ts.map +1 -0
  170. package/lib/parser/index.js +123 -0
  171. package/lib/parser/index.js.map +1 -0
  172. package/lib/parser/markdoc/extract-statics.d.ts +28 -0
  173. package/lib/parser/markdoc/extract-statics.d.ts.map +1 -0
  174. package/lib/parser/markdoc/extract-statics.js +80 -0
  175. package/lib/parser/markdoc/extract-statics.js.map +1 -0
  176. package/lib/parser/markdoc/pairing.d.ts +38 -0
  177. package/lib/parser/markdoc/pairing.d.ts.map +1 -0
  178. package/lib/parser/markdoc/pairing.js +77 -0
  179. package/lib/parser/markdoc/pairing.js.map +1 -0
  180. package/lib/parser/markdoc/schema.d.ts +56 -0
  181. package/lib/parser/markdoc/schema.d.ts.map +1 -0
  182. package/lib/parser/markdoc/schema.js +60 -0
  183. package/lib/parser/markdoc/schema.js.map +1 -0
  184. package/lib/parser/markdoc/span.d.ts +52 -0
  185. package/lib/parser/markdoc/span.d.ts.map +1 -0
  186. package/lib/parser/markdoc/span.js +577 -0
  187. package/lib/parser/markdoc/span.js.map +1 -0
  188. package/lib/parser/markdoc/structure.d.ts +17 -0
  189. package/lib/parser/markdoc/structure.d.ts.map +1 -0
  190. package/lib/parser/markdoc/structure.js +121 -0
  191. package/lib/parser/markdoc/structure.js.map +1 -0
  192. package/lib/parser/markdoc/syntax.d.ts +17 -0
  193. package/lib/parser/markdoc/syntax.d.ts.map +1 -0
  194. package/lib/parser/markdoc/syntax.js +262 -0
  195. package/lib/parser/markdoc/syntax.js.map +1 -0
  196. package/lib/parser/types.d.ts.map +1 -0
  197. package/lib/presets.d.ts +6 -0
  198. package/lib/presets.d.ts.map +1 -0
  199. package/lib/presets.js +12 -0
  200. package/lib/presets.js.map +1 -0
  201. package/lib/rules/registry.d.ts +13 -0
  202. package/lib/rules/registry.d.ts.map +1 -0
  203. package/lib/rules/registry.js +54 -0
  204. package/lib/rules/registry.js.map +1 -0
  205. package/lib/rules/scope/capitalization.d.ts.map +1 -0
  206. package/lib/rules/scope/capitalization.js +128 -0
  207. package/lib/rules/scope/capitalization.js.map +1 -0
  208. package/lib/rules/scope/conditional.d.ts.map +1 -0
  209. package/lib/rules/scope/conditional.js +93 -0
  210. package/lib/rules/scope/conditional.js.map +1 -0
  211. package/lib/rules/scope/consistency.d.ts.map +1 -0
  212. package/lib/rules/scope/consistency.js +118 -0
  213. package/lib/rules/scope/consistency.js.map +1 -0
  214. package/lib/rules/scope/length.d.ts.map +1 -0
  215. package/lib/rules/scope/length.js +50 -0
  216. package/lib/rules/scope/length.js.map +1 -0
  217. package/lib/rules/scope/max-image-size.d.ts.map +1 -0
  218. package/lib/rules/scope/max-image-size.js +55 -0
  219. package/lib/rules/scope/max-image-size.js.map +1 -0
  220. package/lib/rules/scope/metric.d.ts +3 -0
  221. package/lib/rules/scope/metric.d.ts.map +1 -0
  222. package/lib/rules/scope/metric.js +59 -0
  223. package/lib/rules/scope/metric.js.map +1 -0
  224. package/lib/rules/scope/occurrence.d.ts.map +1 -0
  225. package/lib/rules/scope/occurrence.js +41 -0
  226. package/lib/rules/scope/occurrence.js.map +1 -0
  227. package/lib/rules/scope/pattern.d.ts.map +1 -0
  228. package/lib/rules/scope/pattern.js +58 -0
  229. package/lib/rules/scope/pattern.js.map +1 -0
  230. package/lib/rules/scope/repetition.d.ts.map +1 -0
  231. package/lib/rules/scope/repetition.js +134 -0
  232. package/lib/rules/scope/repetition.js.map +1 -0
  233. package/lib/rules/scope/semantic-line-breaks.d.ts.map +1 -0
  234. package/lib/rules/scope/semantic-line-breaks.js +180 -0
  235. package/lib/rules/scope/semantic-line-breaks.js.map +1 -0
  236. package/lib/rules/scope/spelling.d.ts +11 -0
  237. package/lib/rules/scope/spelling.d.ts.map +1 -0
  238. package/lib/rules/scope/spelling.js +146 -0
  239. package/lib/rules/scope/spelling.js.map +1 -0
  240. package/lib/rules/scope/swap.d.ts.map +1 -0
  241. package/lib/rules/scope/swap.js +111 -0
  242. package/lib/rules/scope/swap.js.map +1 -0
  243. package/lib/rules/scope/title-case.d.ts +24 -0
  244. package/lib/rules/scope/title-case.d.ts.map +1 -0
  245. package/lib/rules/scope/title-case.js +216 -0
  246. package/lib/rules/scope/title-case.js.map +1 -0
  247. package/lib/rules/token/blanks-around-fences.d.ts.map +1 -0
  248. package/lib/rules/token/blanks-around-fences.js.map +1 -0
  249. package/lib/rules/token/blanks-around-headings.d.ts.map +1 -0
  250. package/lib/rules/token/blanks-around-headings.js +96 -0
  251. package/lib/rules/token/blanks-around-headings.js.map +1 -0
  252. package/lib/rules/token/blanks-around-lists.d.ts.map +1 -0
  253. package/lib/rules/token/blanks-around-lists.js +48 -0
  254. package/lib/rules/token/blanks-around-lists.js.map +1 -0
  255. package/lib/rules/token/blanks-around-tables.d.ts.map +1 -0
  256. package/lib/rules/token/blanks-around-tables.js +40 -0
  257. package/lib/rules/token/blanks-around-tables.js.map +1 -0
  258. package/lib/rules/token/code-block-style.d.ts.map +1 -0
  259. package/lib/rules/token/code-block-style.js.map +1 -0
  260. package/lib/rules/token/code-fence-style.d.ts.map +1 -0
  261. package/lib/rules/token/code-fence-style.js.map +1 -0
  262. package/lib/rules/token/commands-show-output.d.ts.map +1 -0
  263. package/lib/rules/token/commands-show-output.js.map +1 -0
  264. package/lib/rules/token/descriptive-link-text.d.ts.map +1 -0
  265. package/lib/rules/token/descriptive-link-text.js +46 -0
  266. package/lib/rules/token/descriptive-link-text.js.map +1 -0
  267. package/lib/rules/token/fenced-code-language.d.ts.map +1 -0
  268. package/lib/rules/token/fenced-code-language.js.map +1 -0
  269. package/lib/rules/token/first-line-h1.d.ts.map +1 -0
  270. package/lib/rules/token/first-line-h1.js +83 -0
  271. package/lib/rules/token/first-line-h1.js.map +1 -0
  272. package/lib/rules/token/front-matter.d.ts.map +1 -0
  273. package/lib/rules/token/front-matter.js +169 -0
  274. package/lib/rules/token/front-matter.js.map +1 -0
  275. package/lib/rules/token/heading-increment.d.ts.map +1 -0
  276. package/lib/rules/token/heading-increment.js +26 -0
  277. package/lib/rules/token/heading-increment.js.map +1 -0
  278. package/lib/rules/token/heading-start-left.d.ts.map +1 -0
  279. package/lib/rules/token/heading-start-left.js.map +1 -0
  280. package/lib/rules/token/heading-style.d.ts.map +1 -0
  281. package/lib/rules/token/heading-style.js.map +1 -0
  282. package/lib/rules/token/helpers.d.ts +115 -0
  283. package/lib/rules/token/helpers.d.ts.map +1 -0
  284. package/lib/rules/token/helpers.js +502 -0
  285. package/lib/rules/token/helpers.js.map +1 -0
  286. package/lib/rules/token/hr-style.d.ts.map +1 -0
  287. package/lib/rules/token/hr-style.js.map +1 -0
  288. package/lib/rules/token/index.d.ts +65 -0
  289. package/lib/rules/token/index.d.ts.map +1 -0
  290. package/lib/rules/token/index.js +157 -0
  291. package/lib/rules/token/index.js.map +1 -0
  292. package/lib/rules/token/line-length.d.ts.map +1 -0
  293. package/lib/rules/token/line-length.js +96 -0
  294. package/lib/rules/token/line-length.js.map +1 -0
  295. package/lib/rules/token/link-fragments.d.ts.map +1 -0
  296. package/lib/rules/token/link-fragments.js +398 -0
  297. package/lib/rules/token/link-fragments.js.map +1 -0
  298. package/lib/rules/token/link-image-reference-definitions.d.ts.map +1 -0
  299. package/lib/rules/token/link-image-reference-definitions.js.map +1 -0
  300. package/lib/rules/token/link-image-style.d.ts.map +1 -0
  301. package/lib/rules/token/link-image-style.js +138 -0
  302. package/lib/rules/token/link-image-style.js.map +1 -0
  303. package/lib/rules/token/list-indent.d.ts.map +1 -0
  304. package/lib/rules/token/list-indent.js.map +1 -0
  305. package/lib/rules/token/list-length.d.ts.map +1 -0
  306. package/lib/rules/token/list-length.js +31 -0
  307. package/lib/rules/token/list-length.js.map +1 -0
  308. package/lib/rules/token/list-marker-space.d.ts.map +1 -0
  309. package/lib/rules/token/list-marker-space.js.map +1 -0
  310. package/lib/rules/token/markdoc-attributes.d.ts.map +1 -0
  311. package/lib/rules/token/markdoc-attributes.js +198 -0
  312. package/lib/rules/token/markdoc-attributes.js.map +1 -0
  313. package/lib/rules/token/markdoc-pairing.d.ts.map +1 -0
  314. package/lib/rules/token/markdoc-pairing.js +65 -0
  315. package/lib/rules/token/markdoc-pairing.js.map +1 -0
  316. package/lib/rules/token/markdoc-syntax.d.ts.map +1 -0
  317. package/lib/rules/token/markdoc-syntax.js +84 -0
  318. package/lib/rules/token/markdoc-syntax.js.map +1 -0
  319. package/lib/rules/token/markdoc-unknown-tag.d.ts.map +1 -0
  320. package/lib/rules/token/markdoc-unknown-tag.js +44 -0
  321. package/lib/rules/token/markdoc-unknown-tag.js.map +1 -0
  322. package/lib/rules/token/no-alt-text.d.ts.map +1 -0
  323. package/lib/rules/token/no-alt-text.js +43 -0
  324. package/lib/rules/token/no-alt-text.js.map +1 -0
  325. package/lib/rules/token/no-bare-urls.d.ts.map +1 -0
  326. package/lib/rules/token/no-bare-urls.js +74 -0
  327. package/lib/rules/token/no-bare-urls.js.map +1 -0
  328. package/lib/rules/token/no-blanks-blockquote.d.ts.map +1 -0
  329. package/lib/rules/token/no-blanks-blockquote.js.map +1 -0
  330. package/lib/rules/token/no-duplicate-heading.d.ts.map +1 -0
  331. package/lib/rules/token/no-duplicate-heading.js +89 -0
  332. package/lib/rules/token/no-duplicate-heading.js.map +1 -0
  333. package/lib/rules/token/no-duplicate-link-destinations.d.ts.map +1 -0
  334. package/lib/rules/token/no-duplicate-link-destinations.js +54 -0
  335. package/lib/rules/token/no-duplicate-link-destinations.js.map +1 -0
  336. package/lib/rules/token/no-emphasis-as-heading.d.ts.map +1 -0
  337. package/lib/rules/token/no-emphasis-as-heading.js +39 -0
  338. package/lib/rules/token/no-emphasis-as-heading.js.map +1 -0
  339. package/lib/rules/token/no-empty-headings.d.ts.map +1 -0
  340. package/lib/rules/token/no-empty-headings.js +21 -0
  341. package/lib/rules/token/no-empty-headings.js.map +1 -0
  342. package/lib/rules/token/no-empty-links.d.ts.map +1 -0
  343. package/lib/rules/token/no-empty-links.js.map +1 -0
  344. package/lib/rules/token/no-hard-tabs.d.ts.map +1 -0
  345. package/lib/rules/token/no-hard-tabs.js.map +1 -0
  346. package/lib/rules/token/no-inline-html.d.ts.map +1 -0
  347. package/lib/rules/token/no-inline-html.js +41 -0
  348. package/lib/rules/token/no-inline-html.js.map +1 -0
  349. package/lib/rules/token/no-multiple-blanks.d.ts.map +1 -0
  350. package/lib/rules/token/no-multiple-blanks.js.map +1 -0
  351. package/lib/rules/token/no-multiple-space-atx.d.ts +9 -0
  352. package/lib/rules/token/no-multiple-space-atx.d.ts.map +1 -0
  353. package/lib/rules/token/no-multiple-space-atx.js +46 -0
  354. package/lib/rules/token/no-multiple-space-atx.js.map +1 -0
  355. package/lib/rules/token/no-multiple-space-closed-atx.d.ts.map +1 -0
  356. package/lib/rules/token/no-multiple-space-closed-atx.js.map +1 -0
  357. package/lib/rules/token/no-reversed-links.d.ts.map +1 -0
  358. package/lib/rules/token/no-reversed-links.js.map +1 -0
  359. package/lib/rules/token/no-space-in-code.d.ts.map +1 -0
  360. package/lib/rules/token/no-space-in-code.js.map +1 -0
  361. package/lib/rules/token/no-space-in-emphasis.d.ts.map +1 -0
  362. package/lib/rules/token/no-space-in-emphasis.js +72 -0
  363. package/lib/rules/token/no-space-in-emphasis.js.map +1 -0
  364. package/lib/rules/token/no-space-in-links.d.ts.map +1 -0
  365. package/lib/rules/token/no-space-in-links.js.map +1 -0
  366. package/lib/rules/token/no-trailing-punctuation.d.ts.map +1 -0
  367. package/lib/rules/token/no-trailing-punctuation.js.map +1 -0
  368. package/lib/rules/token/no-trailing-spaces.d.ts.map +1 -0
  369. package/lib/rules/token/no-trailing-spaces.js.map +1 -0
  370. package/lib/rules/token/ol-prefix.d.ts.map +1 -0
  371. package/lib/rules/token/ol-prefix.js.map +1 -0
  372. package/lib/rules/token/proper-names.d.ts.map +1 -0
  373. package/lib/rules/token/proper-names.js +87 -0
  374. package/lib/rules/token/proper-names.js.map +1 -0
  375. package/lib/rules/token/reference-links-images.d.ts.map +1 -0
  376. package/lib/rules/token/reference-links-images.js.map +1 -0
  377. package/lib/rules/token/required-headings.d.ts.map +1 -0
  378. package/lib/rules/token/required-headings.js +73 -0
  379. package/lib/rules/token/required-headings.js.map +1 -0
  380. package/lib/rules/token/single-h1.d.ts.map +1 -0
  381. package/lib/rules/token/single-h1.js +43 -0
  382. package/lib/rules/token/single-h1.js.map +1 -0
  383. package/lib/rules/token/table-column-count.d.ts.map +1 -0
  384. package/lib/rules/token/table-column-count.js.map +1 -0
  385. package/lib/rules/token/table-column-style.d.ts.map +1 -0
  386. package/lib/rules/token/table-column-style.js +162 -0
  387. package/lib/rules/token/table-column-style.js.map +1 -0
  388. package/lib/rules/token/table-pipe-style.d.ts.map +1 -0
  389. package/lib/rules/token/table-pipe-style.js.map +1 -0
  390. package/lib/rules/token/ul-indent.d.ts.map +1 -0
  391. package/lib/rules/token/ul-indent.js.map +1 -0
  392. package/lib/rules/token/ul-style.d.ts.map +1 -0
  393. package/lib/rules/token/ul-style.js +70 -0
  394. package/lib/rules/token/ul-style.js.map +1 -0
  395. package/lib/rules/types.d.ts +62 -0
  396. package/lib/rules/types.d.ts.map +1 -0
  397. package/lib/rules/utils.d.ts +18 -0
  398. package/lib/rules/utils.d.ts.map +1 -0
  399. package/lib/rules/utils.js +75 -0
  400. package/lib/rules/utils.js.map +1 -0
  401. package/lib/scopes/extractor.d.ts +6 -0
  402. package/lib/scopes/extractor.d.ts.map +1 -0
  403. package/lib/scopes/extractor.js +398 -0
  404. package/lib/scopes/extractor.js.map +1 -0
  405. package/lib/scopes/selector.d.ts +26 -0
  406. package/lib/scopes/selector.d.ts.map +1 -0
  407. package/lib/scopes/selector.js +78 -0
  408. package/lib/scopes/selector.js.map +1 -0
  409. package/lib/scopes/sentences.d.ts +13 -0
  410. package/lib/scopes/sentences.d.ts.map +1 -0
  411. package/lib/scopes/sentences.js +237 -0
  412. package/lib/scopes/sentences.js.map +1 -0
  413. package/lib/scopes/types.d.ts +35 -0
  414. package/lib/scopes/types.d.ts.map +1 -0
  415. package/lib/scopes/vocabulary.d.ts +12 -0
  416. package/lib/scopes/vocabulary.d.ts.map +1 -0
  417. package/lib/scopes/vocabulary.js +56 -0
  418. package/lib/scopes/vocabulary.js.map +1 -0
  419. package/lib/types/assertions.d.ts +97 -0
  420. package/lib/types/assertions.d.ts.map +1 -0
  421. package/lib/types/reporting.d.ts +23 -0
  422. package/lib/types/reporting.d.ts.map +1 -0
  423. package/lib/types/rules.d.ts +53 -0
  424. package/lib/types/rules.d.ts.map +1 -0
  425. package/lib/types/validation.d.ts +5 -0
  426. package/lib/types/validation.d.ts.map +1 -0
  427. package/lib/utils/is-plain-object.d.ts +2 -0
  428. package/lib/utils/is-plain-object.d.ts.map +1 -0
  429. package/lib/utils/is-plain-object.js +5 -0
  430. package/lib/utils/is-plain-object.js.map +1 -0
  431. package/package.json +58 -61
  432. package/presets/google/PROVENANCE.md +217 -221
  433. package/presets/inclusive-language/PROVENANCE.md +20 -19
  434. package/presets/microsoft/PROVENANCE.md +242 -243
  435. package/presets/plain-language/PROVENANCE.md +66 -60
  436. package/presets/technical-english/PROVENANCE.md +5 -5
  437. package/skills/recheck-config/SKILL.md +70 -20
  438. package/skills/recheck-lint/SKILL.md +37 -13
  439. package/dist/cli.d.ts +0 -3
  440. package/dist/cli.d.ts.map +0 -1
  441. package/dist/cli.js +0 -228
  442. package/dist/cli.js.map +0 -1
  443. package/dist/commands/baseline.d.ts +0 -10
  444. package/dist/commands/baseline.d.ts.map +0 -1
  445. package/dist/commands/baseline.js +0 -59
  446. package/dist/commands/baseline.js.map +0 -1
  447. package/dist/commands/markdoc-schema.d.ts +0 -17
  448. package/dist/commands/markdoc-schema.d.ts.map +0 -1
  449. package/dist/commands/markdoc-schema.js +0 -127
  450. package/dist/commands/markdoc-schema.js.map +0 -1
  451. package/dist/commands/readability.d.ts +0 -10
  452. package/dist/commands/readability.d.ts.map +0 -1
  453. package/dist/commands/readability.js +0 -90
  454. package/dist/commands/readability.js.map +0 -1
  455. package/dist/commands/run.d.ts +0 -21
  456. package/dist/commands/run.d.ts.map +0 -1
  457. package/dist/commands/run.js +0 -236
  458. package/dist/commands/run.js.map +0 -1
  459. package/dist/commands/validate.d.ts +0 -8
  460. package/dist/commands/validate.d.ts.map +0 -1
  461. package/dist/commands/validate.js +0 -43
  462. package/dist/commands/validate.js.map +0 -1
  463. package/dist/config/load.d.ts +0 -33
  464. package/dist/config/load.d.ts.map +0 -1
  465. package/dist/config/load.js +0 -98
  466. package/dist/config/load.js.map +0 -1
  467. package/dist/config/presets/api-descriptions.d.ts +0 -8
  468. package/dist/config/presets/api-descriptions.d.ts.map +0 -1
  469. package/dist/config/presets/api-descriptions.js +0 -24
  470. package/dist/config/presets/api-descriptions.js.map +0 -1
  471. package/dist/config/presets/google.d.ts +0 -3
  472. package/dist/config/presets/google.d.ts.map +0 -1
  473. package/dist/config/presets/google.js +0 -1671
  474. package/dist/config/presets/google.js.map +0 -1
  475. package/dist/config/presets/inclusive-language.d.ts +0 -3
  476. package/dist/config/presets/inclusive-language.d.ts.map +0 -1
  477. package/dist/config/presets/inclusive-language.js +0 -321
  478. package/dist/config/presets/inclusive-language.js.map +0 -1
  479. package/dist/config/presets/index.d.ts +0 -67
  480. package/dist/config/presets/index.d.ts.map +0 -1
  481. package/dist/config/presets/index.js +0 -141
  482. package/dist/config/presets/index.js.map +0 -1
  483. package/dist/config/presets/markdoc.d.ts +0 -21
  484. package/dist/config/presets/markdoc.d.ts.map +0 -1
  485. package/dist/config/presets/markdoc.js +0 -101
  486. package/dist/config/presets/markdoc.js.map +0 -1
  487. package/dist/config/presets/markdown-relaxed.d.ts +0 -3
  488. package/dist/config/presets/markdown-relaxed.d.ts.map +0 -1
  489. package/dist/config/presets/markdown-relaxed.js +0 -98
  490. package/dist/config/presets/markdown-relaxed.js.map +0 -1
  491. package/dist/config/presets/markdown.d.ts +0 -43
  492. package/dist/config/presets/markdown.d.ts.map +0 -1
  493. package/dist/config/presets/markdown.js +0 -132
  494. package/dist/config/presets/markdown.js.map +0 -1
  495. package/dist/config/presets/microsoft.d.ts +0 -3
  496. package/dist/config/presets/microsoft.d.ts.map +0 -1
  497. package/dist/config/presets/microsoft.js +0 -2268
  498. package/dist/config/presets/microsoft.js.map +0 -1
  499. package/dist/config/presets/minimal.d.ts +0 -3
  500. package/dist/config/presets/minimal.d.ts.map +0 -1
  501. package/dist/config/presets/minimal.js +0 -21
  502. package/dist/config/presets/minimal.js.map +0 -1
  503. package/dist/config/presets/plain-language.d.ts +0 -3
  504. package/dist/config/presets/plain-language.d.ts.map +0 -1
  505. package/dist/config/presets/plain-language.js +0 -351
  506. package/dist/config/presets/plain-language.js.map +0 -1
  507. package/dist/config/presets/prose.d.ts +0 -52
  508. package/dist/config/presets/prose.d.ts.map +0 -1
  509. package/dist/config/presets/prose.js +0 -138
  510. package/dist/config/presets/prose.js.map +0 -1
  511. package/dist/config/presets/technical-english.d.ts +0 -34
  512. package/dist/config/presets/technical-english.d.ts.map +0 -1
  513. package/dist/config/presets/technical-english.js +0 -79
  514. package/dist/config/presets/technical-english.js.map +0 -1
  515. package/dist/config/schema.d.ts +0 -226
  516. package/dist/config/schema.d.ts.map +0 -1
  517. package/dist/config/schema.js +0 -196
  518. package/dist/config/schema.js.map +0 -1
  519. package/dist/config/validate.d.ts +0 -22
  520. package/dist/config/validate.d.ts.map +0 -1
  521. package/dist/config/validate.js +0 -1315
  522. package/dist/config/validate.js.map +0 -1
  523. package/dist/core/auto-fix.d.ts.map +0 -1
  524. package/dist/core/auto-fix.js +0 -101
  525. package/dist/core/auto-fix.js.map +0 -1
  526. package/dist/core/baseline.d.ts +0 -49
  527. package/dist/core/baseline.d.ts.map +0 -1
  528. package/dist/core/baseline.js +0 -0
  529. package/dist/core/baseline.js.map +0 -1
  530. package/dist/core/case-preserve.d.ts +0 -46
  531. package/dist/core/case-preserve.d.ts.map +0 -1
  532. package/dist/core/case-preserve.js +0 -57
  533. package/dist/core/case-preserve.js.map +0 -1
  534. package/dist/core/directives.d.ts.map +0 -1
  535. package/dist/core/directives.js +0 -73
  536. package/dist/core/directives.js.map +0 -1
  537. package/dist/core/files.d.ts +0 -69
  538. package/dist/core/files.d.ts.map +0 -1
  539. package/dist/core/files.js +0 -260
  540. package/dist/core/files.js.map +0 -1
  541. package/dist/core/inline-code.d.ts +0 -87
  542. package/dist/core/inline-code.d.ts.map +0 -1
  543. package/dist/core/inline-code.js +0 -104
  544. package/dist/core/inline-code.js.map +0 -1
  545. package/dist/core/line-endings.d.ts +0 -32
  546. package/dist/core/line-endings.d.ts.map +0 -1
  547. package/dist/core/line-endings.js +0 -65
  548. package/dist/core/line-endings.js.map +0 -1
  549. package/dist/core/markdoc-tags.d.ts +0 -79
  550. package/dist/core/markdoc-tags.d.ts.map +0 -1
  551. package/dist/core/markdoc-tags.js +0 -131
  552. package/dist/core/markdoc-tags.js.map +0 -1
  553. package/dist/core/prose-extract.d.ts +0 -6
  554. package/dist/core/prose-extract.d.ts.map +0 -1
  555. package/dist/core/prose-extract.js +0 -79
  556. package/dist/core/prose-extract.js.map +0 -1
  557. package/dist/core/readability.d.ts +0 -17
  558. package/dist/core/readability.d.ts.map +0 -1
  559. package/dist/core/readability.js +0 -37
  560. package/dist/core/readability.js.map +0 -1
  561. package/dist/core/rule-filters.d.ts +0 -45
  562. package/dist/core/rule-filters.d.ts.map +0 -1
  563. package/dist/core/rule-filters.js +0 -118
  564. package/dist/core/rule-filters.js.map +0 -1
  565. package/dist/core/runner.d.ts +0 -98
  566. package/dist/core/runner.d.ts.map +0 -1
  567. package/dist/core/runner.js +0 -401
  568. package/dist/core/runner.js.map +0 -1
  569. package/dist/core/timing.d.ts +0 -24
  570. package/dist/core/timing.d.ts.map +0 -1
  571. package/dist/core/timing.js +0 -39
  572. package/dist/core/timing.js.map +0 -1
  573. package/dist/data/markdoc-realm-schema.d.ts.map +0 -1
  574. package/dist/data/markdoc-realm-schema.js +0 -798
  575. package/dist/data/markdoc-realm-schema.js.map +0 -1
  576. package/dist/data/proper-nouns.d.ts.map +0 -1
  577. package/dist/data/proper-nouns.js +0 -47
  578. package/dist/data/proper-nouns.js.map +0 -1
  579. package/dist/data/realm-front-matter-schema.d.ts +0 -28
  580. package/dist/data/realm-front-matter-schema.d.ts.map +0 -1
  581. package/dist/data/realm-front-matter-schema.js +0 -73
  582. package/dist/data/realm-front-matter-schema.js.map +0 -1
  583. package/dist/index.d.ts +0 -90
  584. package/dist/index.d.ts.map +0 -1
  585. package/dist/index.js +0 -152
  586. package/dist/index.js.map +0 -1
  587. package/dist/metrics/formulas.d.ts +0 -17
  588. package/dist/metrics/formulas.d.ts.map +0 -1
  589. package/dist/metrics/formulas.js +0 -70
  590. package/dist/metrics/formulas.js.map +0 -1
  591. package/dist/metrics/statistics.d.ts +0 -27
  592. package/dist/metrics/statistics.d.ts.map +0 -1
  593. package/dist/metrics/statistics.js +0 -56
  594. package/dist/metrics/statistics.js.map +0 -1
  595. package/dist/parser/index.d.ts +0 -19
  596. package/dist/parser/index.d.ts.map +0 -1
  597. package/dist/parser/index.js +0 -174
  598. package/dist/parser/index.js.map +0 -1
  599. package/dist/parser/markdoc/extract-statics.d.ts +0 -45
  600. package/dist/parser/markdoc/extract-statics.d.ts.map +0 -1
  601. package/dist/parser/markdoc/extract-statics.js +0 -139
  602. package/dist/parser/markdoc/extract-statics.js.map +0 -1
  603. package/dist/parser/markdoc/pairing.d.ts +0 -63
  604. package/dist/parser/markdoc/pairing.d.ts.map +0 -1
  605. package/dist/parser/markdoc/pairing.js +0 -94
  606. package/dist/parser/markdoc/pairing.js.map +0 -1
  607. package/dist/parser/markdoc/schema.d.ts +0 -85
  608. package/dist/parser/markdoc/schema.d.ts.map +0 -1
  609. package/dist/parser/markdoc/schema.js +0 -86
  610. package/dist/parser/markdoc/schema.js.map +0 -1
  611. package/dist/parser/markdoc/span.d.ts +0 -64
  612. package/dist/parser/markdoc/span.d.ts.map +0 -1
  613. package/dist/parser/markdoc/span.js +0 -729
  614. package/dist/parser/markdoc/span.js.map +0 -1
  615. package/dist/parser/markdoc/structure.d.ts +0 -28
  616. package/dist/parser/markdoc/structure.d.ts.map +0 -1
  617. package/dist/parser/markdoc/structure.js +0 -153
  618. package/dist/parser/markdoc/structure.js.map +0 -1
  619. package/dist/parser/markdoc/syntax.d.ts +0 -44
  620. package/dist/parser/markdoc/syntax.d.ts.map +0 -1
  621. package/dist/parser/markdoc/syntax.js +0 -317
  622. package/dist/parser/markdoc/syntax.js.map +0 -1
  623. package/dist/parser/types.d.ts.map +0 -1
  624. package/dist/reporter/fixes.d.ts +0 -3
  625. package/dist/reporter/fixes.d.ts.map +0 -1
  626. package/dist/reporter/fixes.js +0 -41
  627. package/dist/reporter/fixes.js.map +0 -1
  628. package/dist/reporter/formats/github-actions.d.ts +0 -6
  629. package/dist/reporter/formats/github-actions.d.ts.map +0 -1
  630. package/dist/reporter/formats/github-actions.js +0 -20
  631. package/dist/reporter/formats/github-actions.js.map +0 -1
  632. package/dist/reporter/formats/json.d.ts +0 -10
  633. package/dist/reporter/formats/json.d.ts.map +0 -1
  634. package/dist/reporter/formats/json.js +0 -25
  635. package/dist/reporter/formats/json.js.map +0 -1
  636. package/dist/reporter/formats/sarif.d.ts +0 -10
  637. package/dist/reporter/formats/sarif.d.ts.map +0 -1
  638. package/dist/reporter/formats/sarif.js +0 -66
  639. package/dist/reporter/formats/sarif.js.map +0 -1
  640. package/dist/reporter/formats/table.d.ts +0 -6
  641. package/dist/reporter/formats/table.d.ts.map +0 -1
  642. package/dist/reporter/formats/table.js +0 -43
  643. package/dist/reporter/formats/table.js.map +0 -1
  644. package/dist/reporter/index.d.ts +0 -10
  645. package/dist/reporter/index.d.ts.map +0 -1
  646. package/dist/reporter/index.js +0 -42
  647. package/dist/reporter/index.js.map +0 -1
  648. package/dist/reporter/prioritize-problems.d.ts +0 -7
  649. package/dist/reporter/prioritize-problems.d.ts.map +0 -1
  650. package/dist/reporter/prioritize-problems.js +0 -29
  651. package/dist/reporter/prioritize-problems.js.map +0 -1
  652. package/dist/reporter/statistics.d.ts +0 -10
  653. package/dist/reporter/statistics.d.ts.map +0 -1
  654. package/dist/reporter/statistics.js +0 -52
  655. package/dist/reporter/statistics.js.map +0 -1
  656. package/dist/reporter/summary.d.ts +0 -10
  657. package/dist/reporter/summary.d.ts.map +0 -1
  658. package/dist/reporter/summary.js +0 -49
  659. package/dist/reporter/summary.js.map +0 -1
  660. package/dist/rules/registry.d.ts +0 -15
  661. package/dist/rules/registry.d.ts.map +0 -1
  662. package/dist/rules/registry.js +0 -81
  663. package/dist/rules/registry.js.map +0 -1
  664. package/dist/rules/scope/capitalization.d.ts.map +0 -1
  665. package/dist/rules/scope/capitalization.js +0 -164
  666. package/dist/rules/scope/capitalization.js.map +0 -1
  667. package/dist/rules/scope/conditional.d.ts.map +0 -1
  668. package/dist/rules/scope/conditional.js +0 -112
  669. package/dist/rules/scope/conditional.js.map +0 -1
  670. package/dist/rules/scope/consistency.d.ts.map +0 -1
  671. package/dist/rules/scope/consistency.js +0 -179
  672. package/dist/rules/scope/consistency.js.map +0 -1
  673. package/dist/rules/scope/length.d.ts.map +0 -1
  674. package/dist/rules/scope/length.js +0 -73
  675. package/dist/rules/scope/length.js.map +0 -1
  676. package/dist/rules/scope/max-image-size.d.ts.map +0 -1
  677. package/dist/rules/scope/max-image-size.js +0 -65
  678. package/dist/rules/scope/max-image-size.js.map +0 -1
  679. package/dist/rules/scope/metric.d.ts +0 -5
  680. package/dist/rules/scope/metric.d.ts.map +0 -1
  681. package/dist/rules/scope/metric.js +0 -74
  682. package/dist/rules/scope/metric.js.map +0 -1
  683. package/dist/rules/scope/occurrence.d.ts.map +0 -1
  684. package/dist/rules/scope/occurrence.js +0 -48
  685. package/dist/rules/scope/occurrence.js.map +0 -1
  686. package/dist/rules/scope/pattern.d.ts.map +0 -1
  687. package/dist/rules/scope/pattern.js +0 -75
  688. package/dist/rules/scope/pattern.js.map +0 -1
  689. package/dist/rules/scope/repetition.d.ts.map +0 -1
  690. package/dist/rules/scope/repetition.js +0 -139
  691. package/dist/rules/scope/repetition.js.map +0 -1
  692. package/dist/rules/scope/semantic-line-breaks.d.ts.map +0 -1
  693. package/dist/rules/scope/semantic-line-breaks.js +0 -236
  694. package/dist/rules/scope/semantic-line-breaks.js.map +0 -1
  695. package/dist/rules/scope/spelling.d.ts +0 -27
  696. package/dist/rules/scope/spelling.d.ts.map +0 -1
  697. package/dist/rules/scope/spelling.js +0 -227
  698. package/dist/rules/scope/spelling.js.map +0 -1
  699. package/dist/rules/scope/swap.d.ts.map +0 -1
  700. package/dist/rules/scope/swap.js +0 -149
  701. package/dist/rules/scope/swap.js.map +0 -1
  702. package/dist/rules/scope/title-case.d.ts +0 -46
  703. package/dist/rules/scope/title-case.d.ts.map +0 -1
  704. package/dist/rules/scope/title-case.js +0 -301
  705. package/dist/rules/scope/title-case.js.map +0 -1
  706. package/dist/rules/token/blanks-around-fences.d.ts.map +0 -1
  707. package/dist/rules/token/blanks-around-fences.js.map +0 -1
  708. package/dist/rules/token/blanks-around-headings.d.ts.map +0 -1
  709. package/dist/rules/token/blanks-around-headings.js +0 -108
  710. package/dist/rules/token/blanks-around-headings.js.map +0 -1
  711. package/dist/rules/token/blanks-around-lists.d.ts.map +0 -1
  712. package/dist/rules/token/blanks-around-lists.js +0 -56
  713. package/dist/rules/token/blanks-around-lists.js.map +0 -1
  714. package/dist/rules/token/blanks-around-tables.d.ts.map +0 -1
  715. package/dist/rules/token/blanks-around-tables.js +0 -42
  716. package/dist/rules/token/blanks-around-tables.js.map +0 -1
  717. package/dist/rules/token/code-block-style.d.ts.map +0 -1
  718. package/dist/rules/token/code-block-style.js.map +0 -1
  719. package/dist/rules/token/code-fence-style.d.ts.map +0 -1
  720. package/dist/rules/token/code-fence-style.js.map +0 -1
  721. package/dist/rules/token/commands-show-output.d.ts.map +0 -1
  722. package/dist/rules/token/commands-show-output.js.map +0 -1
  723. package/dist/rules/token/descriptive-link-text.d.ts.map +0 -1
  724. package/dist/rules/token/descriptive-link-text.js +0 -53
  725. package/dist/rules/token/descriptive-link-text.js.map +0 -1
  726. package/dist/rules/token/fenced-code-language.d.ts.map +0 -1
  727. package/dist/rules/token/fenced-code-language.js.map +0 -1
  728. package/dist/rules/token/first-line-h1.d.ts.map +0 -1
  729. package/dist/rules/token/first-line-h1.js +0 -107
  730. package/dist/rules/token/first-line-h1.js.map +0 -1
  731. package/dist/rules/token/front-matter.d.ts.map +0 -1
  732. package/dist/rules/token/front-matter.js +0 -177
  733. package/dist/rules/token/front-matter.js.map +0 -1
  734. package/dist/rules/token/heading-increment.d.ts.map +0 -1
  735. package/dist/rules/token/heading-increment.js +0 -27
  736. package/dist/rules/token/heading-increment.js.map +0 -1
  737. package/dist/rules/token/heading-start-left.d.ts.map +0 -1
  738. package/dist/rules/token/heading-start-left.js.map +0 -1
  739. package/dist/rules/token/heading-style.d.ts.map +0 -1
  740. package/dist/rules/token/heading-style.js.map +0 -1
  741. package/dist/rules/token/helpers.d.ts +0 -313
  742. package/dist/rules/token/helpers.d.ts.map +0 -1
  743. package/dist/rules/token/helpers.js +0 -746
  744. package/dist/rules/token/helpers.js.map +0 -1
  745. package/dist/rules/token/hr-style.d.ts.map +0 -1
  746. package/dist/rules/token/hr-style.js.map +0 -1
  747. package/dist/rules/token/index.d.ts +0 -76
  748. package/dist/rules/token/index.d.ts.map +0 -1
  749. package/dist/rules/token/index.js +0 -229
  750. package/dist/rules/token/index.js.map +0 -1
  751. package/dist/rules/token/line-length.d.ts.map +0 -1
  752. package/dist/rules/token/line-length.js +0 -120
  753. package/dist/rules/token/line-length.js.map +0 -1
  754. package/dist/rules/token/link-fragments.d.ts.map +0 -1
  755. package/dist/rules/token/link-fragments.js +0 -393
  756. package/dist/rules/token/link-fragments.js.map +0 -1
  757. package/dist/rules/token/link-image-reference-definitions.d.ts.map +0 -1
  758. package/dist/rules/token/link-image-reference-definitions.js.map +0 -1
  759. package/dist/rules/token/link-image-style.d.ts.map +0 -1
  760. package/dist/rules/token/link-image-style.js +0 -131
  761. package/dist/rules/token/link-image-style.js.map +0 -1
  762. package/dist/rules/token/list-indent.d.ts.map +0 -1
  763. package/dist/rules/token/list-indent.js.map +0 -1
  764. package/dist/rules/token/list-length.d.ts.map +0 -1
  765. package/dist/rules/token/list-length.js +0 -55
  766. package/dist/rules/token/list-length.js.map +0 -1
  767. package/dist/rules/token/list-marker-space.d.ts.map +0 -1
  768. package/dist/rules/token/list-marker-space.js.map +0 -1
  769. package/dist/rules/token/markdoc-attributes.d.ts.map +0 -1
  770. package/dist/rules/token/markdoc-attributes.js +0 -269
  771. package/dist/rules/token/markdoc-attributes.js.map +0 -1
  772. package/dist/rules/token/markdoc-pairing.d.ts.map +0 -1
  773. package/dist/rules/token/markdoc-pairing.js +0 -73
  774. package/dist/rules/token/markdoc-pairing.js.map +0 -1
  775. package/dist/rules/token/markdoc-syntax.d.ts.map +0 -1
  776. package/dist/rules/token/markdoc-syntax.js +0 -119
  777. package/dist/rules/token/markdoc-syntax.js.map +0 -1
  778. package/dist/rules/token/markdoc-unknown-tag.d.ts.map +0 -1
  779. package/dist/rules/token/markdoc-unknown-tag.js +0 -64
  780. package/dist/rules/token/markdoc-unknown-tag.js.map +0 -1
  781. package/dist/rules/token/no-alt-text.d.ts.map +0 -1
  782. package/dist/rules/token/no-alt-text.js +0 -47
  783. package/dist/rules/token/no-alt-text.js.map +0 -1
  784. package/dist/rules/token/no-bare-urls.d.ts.map +0 -1
  785. package/dist/rules/token/no-bare-urls.js +0 -88
  786. package/dist/rules/token/no-bare-urls.js.map +0 -1
  787. package/dist/rules/token/no-blanks-blockquote.d.ts.map +0 -1
  788. package/dist/rules/token/no-blanks-blockquote.js.map +0 -1
  789. package/dist/rules/token/no-duplicate-heading.d.ts.map +0 -1
  790. package/dist/rules/token/no-duplicate-heading.js +0 -101
  791. package/dist/rules/token/no-duplicate-heading.js.map +0 -1
  792. package/dist/rules/token/no-duplicate-link-destinations.d.ts.map +0 -1
  793. package/dist/rules/token/no-duplicate-link-destinations.js +0 -65
  794. package/dist/rules/token/no-duplicate-link-destinations.js.map +0 -1
  795. package/dist/rules/token/no-emphasis-as-heading.d.ts.map +0 -1
  796. package/dist/rules/token/no-emphasis-as-heading.js +0 -44
  797. package/dist/rules/token/no-emphasis-as-heading.js.map +0 -1
  798. package/dist/rules/token/no-empty-headings.d.ts.map +0 -1
  799. package/dist/rules/token/no-empty-headings.js +0 -28
  800. package/dist/rules/token/no-empty-headings.js.map +0 -1
  801. package/dist/rules/token/no-empty-links.d.ts.map +0 -1
  802. package/dist/rules/token/no-empty-links.js.map +0 -1
  803. package/dist/rules/token/no-hard-tabs.d.ts.map +0 -1
  804. package/dist/rules/token/no-hard-tabs.js.map +0 -1
  805. package/dist/rules/token/no-inline-html.d.ts.map +0 -1
  806. package/dist/rules/token/no-inline-html.js +0 -45
  807. package/dist/rules/token/no-inline-html.js.map +0 -1
  808. package/dist/rules/token/no-multiple-blanks.d.ts.map +0 -1
  809. package/dist/rules/token/no-multiple-blanks.js.map +0 -1
  810. package/dist/rules/token/no-multiple-space-atx.d.ts +0 -13
  811. package/dist/rules/token/no-multiple-space-atx.d.ts.map +0 -1
  812. package/dist/rules/token/no-multiple-space-atx.js +0 -50
  813. package/dist/rules/token/no-multiple-space-atx.js.map +0 -1
  814. package/dist/rules/token/no-multiple-space-closed-atx.d.ts.map +0 -1
  815. package/dist/rules/token/no-multiple-space-closed-atx.js.map +0 -1
  816. package/dist/rules/token/no-reversed-links.d.ts.map +0 -1
  817. package/dist/rules/token/no-reversed-links.js.map +0 -1
  818. package/dist/rules/token/no-space-in-code.d.ts.map +0 -1
  819. package/dist/rules/token/no-space-in-code.js.map +0 -1
  820. package/dist/rules/token/no-space-in-emphasis.d.ts.map +0 -1
  821. package/dist/rules/token/no-space-in-emphasis.js +0 -79
  822. package/dist/rules/token/no-space-in-emphasis.js.map +0 -1
  823. package/dist/rules/token/no-space-in-links.d.ts.map +0 -1
  824. package/dist/rules/token/no-space-in-links.js.map +0 -1
  825. package/dist/rules/token/no-trailing-punctuation.d.ts.map +0 -1
  826. package/dist/rules/token/no-trailing-punctuation.js.map +0 -1
  827. package/dist/rules/token/no-trailing-spaces.d.ts.map +0 -1
  828. package/dist/rules/token/no-trailing-spaces.js.map +0 -1
  829. package/dist/rules/token/ol-prefix.d.ts.map +0 -1
  830. package/dist/rules/token/ol-prefix.js.map +0 -1
  831. package/dist/rules/token/proper-names.d.ts.map +0 -1
  832. package/dist/rules/token/proper-names.js +0 -93
  833. package/dist/rules/token/proper-names.js.map +0 -1
  834. package/dist/rules/token/reference-links-images.d.ts.map +0 -1
  835. package/dist/rules/token/reference-links-images.js.map +0 -1
  836. package/dist/rules/token/required-headings.d.ts.map +0 -1
  837. package/dist/rules/token/required-headings.js +0 -83
  838. package/dist/rules/token/required-headings.js.map +0 -1
  839. package/dist/rules/token/single-h1.d.ts.map +0 -1
  840. package/dist/rules/token/single-h1.js +0 -56
  841. package/dist/rules/token/single-h1.js.map +0 -1
  842. package/dist/rules/token/table-column-count.d.ts.map +0 -1
  843. package/dist/rules/token/table-column-count.js.map +0 -1
  844. package/dist/rules/token/table-column-style.d.ts.map +0 -1
  845. package/dist/rules/token/table-column-style.js +0 -179
  846. package/dist/rules/token/table-column-style.js.map +0 -1
  847. package/dist/rules/token/table-pipe-style.d.ts.map +0 -1
  848. package/dist/rules/token/table-pipe-style.js.map +0 -1
  849. package/dist/rules/token/ul-indent.d.ts.map +0 -1
  850. package/dist/rules/token/ul-indent.js.map +0 -1
  851. package/dist/rules/token/ul-style.d.ts.map +0 -1
  852. package/dist/rules/token/ul-style.js +0 -80
  853. package/dist/rules/token/ul-style.js.map +0 -1
  854. package/dist/rules/types.d.ts +0 -83
  855. package/dist/rules/types.d.ts.map +0 -1
  856. package/dist/rules/utils.d.ts +0 -31
  857. package/dist/rules/utils.d.ts.map +0 -1
  858. package/dist/rules/utils.js +0 -90
  859. package/dist/rules/utils.js.map +0 -1
  860. package/dist/scopes/extractor.d.ts +0 -7
  861. package/dist/scopes/extractor.d.ts.map +0 -1
  862. package/dist/scopes/extractor.js +0 -536
  863. package/dist/scopes/extractor.js.map +0 -1
  864. package/dist/scopes/selector.d.ts +0 -51
  865. package/dist/scopes/selector.d.ts.map +0 -1
  866. package/dist/scopes/selector.js +0 -121
  867. package/dist/scopes/selector.js.map +0 -1
  868. package/dist/scopes/sentences.d.ts +0 -15
  869. package/dist/scopes/sentences.d.ts.map +0 -1
  870. package/dist/scopes/sentences.js +0 -202
  871. package/dist/scopes/sentences.js.map +0 -1
  872. package/dist/scopes/types.d.ts +0 -46
  873. package/dist/scopes/types.d.ts.map +0 -1
  874. package/dist/scopes/vocabulary.d.ts +0 -16
  875. package/dist/scopes/vocabulary.d.ts.map +0 -1
  876. package/dist/scopes/vocabulary.js +0 -70
  877. package/dist/scopes/vocabulary.js.map +0 -1
  878. package/dist/types/assertions.d.ts +0 -121
  879. package/dist/types/assertions.d.ts.map +0 -1
  880. package/dist/types/reporting.d.ts +0 -32
  881. package/dist/types/reporting.d.ts.map +0 -1
  882. package/dist/types/rules.d.ts +0 -41
  883. package/dist/types/rules.d.ts.map +0 -1
  884. package/dist/types/validation.d.ts +0 -6
  885. package/dist/types/validation.d.ts.map +0 -1
  886. /package/{dist → lib}/core/auto-fix.d.ts +0 -0
  887. /package/{dist → lib}/core/directives.d.ts +0 -0
  888. /package/{dist → lib}/data/markdoc-realm-schema.d.ts +0 -0
  889. /package/{dist → lib}/data/proper-nouns.d.ts +0 -0
  890. /package/{dist → lib}/metrics/index.d.ts +0 -0
  891. /package/{dist → lib}/metrics/index.d.ts.map +0 -0
  892. /package/{dist → lib}/metrics/index.js +0 -0
  893. /package/{dist → lib}/metrics/index.js.map +0 -0
  894. /package/{dist → lib}/parser/types.d.ts +0 -0
  895. /package/{dist → lib}/parser/types.js +0 -0
  896. /package/{dist → lib}/parser/types.js.map +0 -0
  897. /package/{dist → lib}/rules/scope/capitalization.d.ts +0 -0
  898. /package/{dist → lib}/rules/scope/conditional.d.ts +0 -0
  899. /package/{dist → lib}/rules/scope/consistency.d.ts +0 -0
  900. /package/{dist → lib}/rules/scope/length.d.ts +0 -0
  901. /package/{dist → lib}/rules/scope/max-image-size.d.ts +0 -0
  902. /package/{dist → lib}/rules/scope/occurrence.d.ts +0 -0
  903. /package/{dist → lib}/rules/scope/pattern.d.ts +0 -0
  904. /package/{dist → lib}/rules/scope/repetition.d.ts +0 -0
  905. /package/{dist → lib}/rules/scope/semantic-line-breaks.d.ts +0 -0
  906. /package/{dist → lib}/rules/scope/swap.d.ts +0 -0
  907. /package/{dist → lib}/rules/token/blanks-around-fences.d.ts +0 -0
  908. /package/{dist → lib}/rules/token/blanks-around-fences.js +0 -0
  909. /package/{dist → lib}/rules/token/blanks-around-headings.d.ts +0 -0
  910. /package/{dist → lib}/rules/token/blanks-around-lists.d.ts +0 -0
  911. /package/{dist → lib}/rules/token/blanks-around-tables.d.ts +0 -0
  912. /package/{dist → lib}/rules/token/code-block-style.d.ts +0 -0
  913. /package/{dist → lib}/rules/token/code-block-style.js +0 -0
  914. /package/{dist → lib}/rules/token/code-fence-style.d.ts +0 -0
  915. /package/{dist → lib}/rules/token/code-fence-style.js +0 -0
  916. /package/{dist → lib}/rules/token/commands-show-output.d.ts +0 -0
  917. /package/{dist → lib}/rules/token/commands-show-output.js +0 -0
  918. /package/{dist → lib}/rules/token/descriptive-link-text.d.ts +0 -0
  919. /package/{dist → lib}/rules/token/emphasis-style.d.ts +0 -0
  920. /package/{dist → lib}/rules/token/emphasis-style.d.ts.map +0 -0
  921. /package/{dist → lib}/rules/token/emphasis-style.js +0 -0
  922. /package/{dist → lib}/rules/token/emphasis-style.js.map +0 -0
  923. /package/{dist → lib}/rules/token/fenced-code-language.d.ts +0 -0
  924. /package/{dist → lib}/rules/token/fenced-code-language.js +0 -0
  925. /package/{dist → lib}/rules/token/first-line-h1.d.ts +0 -0
  926. /package/{dist → lib}/rules/token/front-matter.d.ts +0 -0
  927. /package/{dist → lib}/rules/token/heading-increment.d.ts +0 -0
  928. /package/{dist → lib}/rules/token/heading-start-left.d.ts +0 -0
  929. /package/{dist → lib}/rules/token/heading-start-left.js +0 -0
  930. /package/{dist → lib}/rules/token/heading-style.d.ts +0 -0
  931. /package/{dist → lib}/rules/token/heading-style.js +0 -0
  932. /package/{dist → lib}/rules/token/hr-style.d.ts +0 -0
  933. /package/{dist → lib}/rules/token/hr-style.js +0 -0
  934. /package/{dist → lib}/rules/token/line-length.d.ts +0 -0
  935. /package/{dist → lib}/rules/token/link-fragments.d.ts +0 -0
  936. /package/{dist → lib}/rules/token/link-image-reference-definitions.d.ts +0 -0
  937. /package/{dist → lib}/rules/token/link-image-reference-definitions.js +0 -0
  938. /package/{dist → lib}/rules/token/link-image-style.d.ts +0 -0
  939. /package/{dist → lib}/rules/token/list-indent.d.ts +0 -0
  940. /package/{dist → lib}/rules/token/list-indent.js +0 -0
  941. /package/{dist → lib}/rules/token/list-length.d.ts +0 -0
  942. /package/{dist → lib}/rules/token/list-marker-space.d.ts +0 -0
  943. /package/{dist → lib}/rules/token/list-marker-space.js +0 -0
  944. /package/{dist → lib}/rules/token/markdoc-attributes.d.ts +0 -0
  945. /package/{dist → lib}/rules/token/markdoc-pairing.d.ts +0 -0
  946. /package/{dist → lib}/rules/token/markdoc-syntax.d.ts +0 -0
  947. /package/{dist → lib}/rules/token/markdoc-unknown-tag.d.ts +0 -0
  948. /package/{dist → lib}/rules/token/messages.d.ts +0 -0
  949. /package/{dist → lib}/rules/token/messages.d.ts.map +0 -0
  950. /package/{dist → lib}/rules/token/messages.js +0 -0
  951. /package/{dist → lib}/rules/token/messages.js.map +0 -0
  952. /package/{dist → lib}/rules/token/no-alt-text.d.ts +0 -0
  953. /package/{dist → lib}/rules/token/no-bare-urls.d.ts +0 -0
  954. /package/{dist → lib}/rules/token/no-blanks-blockquote.d.ts +0 -0
  955. /package/{dist → lib}/rules/token/no-blanks-blockquote.js +0 -0
  956. /package/{dist → lib}/rules/token/no-duplicate-heading.d.ts +0 -0
  957. /package/{dist → lib}/rules/token/no-duplicate-link-destinations.d.ts +0 -0
  958. /package/{dist → lib}/rules/token/no-emphasis-as-heading.d.ts +0 -0
  959. /package/{dist → lib}/rules/token/no-empty-headings.d.ts +0 -0
  960. /package/{dist → lib}/rules/token/no-empty-links.d.ts +0 -0
  961. /package/{dist → lib}/rules/token/no-empty-links.js +0 -0
  962. /package/{dist → lib}/rules/token/no-hard-tabs.d.ts +0 -0
  963. /package/{dist → lib}/rules/token/no-hard-tabs.js +0 -0
  964. /package/{dist → lib}/rules/token/no-inline-html.d.ts +0 -0
  965. /package/{dist → lib}/rules/token/no-missing-space-atx.d.ts +0 -0
  966. /package/{dist → lib}/rules/token/no-missing-space-atx.d.ts.map +0 -0
  967. /package/{dist → lib}/rules/token/no-missing-space-atx.js +0 -0
  968. /package/{dist → lib}/rules/token/no-missing-space-atx.js.map +0 -0
  969. /package/{dist → lib}/rules/token/no-missing-space-closed-atx.d.ts +0 -0
  970. /package/{dist → lib}/rules/token/no-missing-space-closed-atx.d.ts.map +0 -0
  971. /package/{dist → lib}/rules/token/no-missing-space-closed-atx.js +0 -0
  972. /package/{dist → lib}/rules/token/no-missing-space-closed-atx.js.map +0 -0
  973. /package/{dist → lib}/rules/token/no-multiple-blanks.d.ts +0 -0
  974. /package/{dist → lib}/rules/token/no-multiple-blanks.js +0 -0
  975. /package/{dist → lib}/rules/token/no-multiple-space-blockquote.d.ts +0 -0
  976. /package/{dist → lib}/rules/token/no-multiple-space-blockquote.d.ts.map +0 -0
  977. /package/{dist → lib}/rules/token/no-multiple-space-blockquote.js +0 -0
  978. /package/{dist → lib}/rules/token/no-multiple-space-blockquote.js.map +0 -0
  979. /package/{dist → lib}/rules/token/no-multiple-space-closed-atx.d.ts +0 -0
  980. /package/{dist → lib}/rules/token/no-multiple-space-closed-atx.js +0 -0
  981. /package/{dist → lib}/rules/token/no-reversed-links.d.ts +0 -0
  982. /package/{dist → lib}/rules/token/no-reversed-links.js +0 -0
  983. /package/{dist → lib}/rules/token/no-space-in-code.d.ts +0 -0
  984. /package/{dist → lib}/rules/token/no-space-in-code.js +0 -0
  985. /package/{dist → lib}/rules/token/no-space-in-emphasis.d.ts +0 -0
  986. /package/{dist → lib}/rules/token/no-space-in-links.d.ts +0 -0
  987. /package/{dist → lib}/rules/token/no-space-in-links.js +0 -0
  988. /package/{dist → lib}/rules/token/no-trailing-punctuation.d.ts +0 -0
  989. /package/{dist → lib}/rules/token/no-trailing-punctuation.js +0 -0
  990. /package/{dist → lib}/rules/token/no-trailing-spaces.d.ts +0 -0
  991. /package/{dist → lib}/rules/token/no-trailing-spaces.js +0 -0
  992. /package/{dist → lib}/rules/token/ol-prefix.d.ts +0 -0
  993. /package/{dist → lib}/rules/token/ol-prefix.js +0 -0
  994. /package/{dist → lib}/rules/token/proper-names.d.ts +0 -0
  995. /package/{dist → lib}/rules/token/reference-links-images.d.ts +0 -0
  996. /package/{dist → lib}/rules/token/reference-links-images.js +0 -0
  997. /package/{dist → lib}/rules/token/required-headings.d.ts +0 -0
  998. /package/{dist → lib}/rules/token/single-h1.d.ts +0 -0
  999. /package/{dist → lib}/rules/token/single-trailing-newline.d.ts +0 -0
  1000. /package/{dist → lib}/rules/token/single-trailing-newline.d.ts.map +0 -0
  1001. /package/{dist → lib}/rules/token/single-trailing-newline.js +0 -0
  1002. /package/{dist → lib}/rules/token/single-trailing-newline.js.map +0 -0
  1003. /package/{dist → lib}/rules/token/strong-style.d.ts +0 -0
  1004. /package/{dist → lib}/rules/token/strong-style.d.ts.map +0 -0
  1005. /package/{dist → lib}/rules/token/strong-style.js +0 -0
  1006. /package/{dist → lib}/rules/token/strong-style.js.map +0 -0
  1007. /package/{dist → lib}/rules/token/table-column-count.d.ts +0 -0
  1008. /package/{dist → lib}/rules/token/table-column-count.js +0 -0
  1009. /package/{dist → lib}/rules/token/table-column-style.d.ts +0 -0
  1010. /package/{dist → lib}/rules/token/table-pipe-style.d.ts +0 -0
  1011. /package/{dist → lib}/rules/token/table-pipe-style.js +0 -0
  1012. /package/{dist → lib}/rules/token/ul-indent.d.ts +0 -0
  1013. /package/{dist → lib}/rules/token/ul-indent.js +0 -0
  1014. /package/{dist → lib}/rules/token/ul-style.d.ts +0 -0
  1015. /package/{dist → lib}/rules/types.js +0 -0
  1016. /package/{dist → lib}/rules/types.js.map +0 -0
  1017. /package/{dist → lib}/scopes/types.js +0 -0
  1018. /package/{dist → lib}/scopes/types.js.map +0 -0
  1019. /package/{dist → lib}/types/assertions.js +0 -0
  1020. /package/{dist → lib}/types/assertions.js.map +0 -0
  1021. /package/{dist → lib}/types/index.d.ts +0 -0
  1022. /package/{dist → lib}/types/index.d.ts.map +0 -0
  1023. /package/{dist → lib}/types/index.js +0 -0
  1024. /package/{dist → lib}/types/index.js.map +0 -0
  1025. /package/{dist → lib}/types/problems.d.ts +0 -0
  1026. /package/{dist → lib}/types/problems.d.ts.map +0 -0
  1027. /package/{dist → lib}/types/problems.js +0 -0
  1028. /package/{dist → lib}/types/problems.js.map +0 -0
  1029. /package/{dist → lib}/types/reporting.js +0 -0
  1030. /package/{dist → lib}/types/reporting.js.map +0 -0
  1031. /package/{dist → lib}/types/rules.js +0 -0
  1032. /package/{dist → lib}/types/rules.js.map +0 -0
  1033. /package/{dist → lib}/types/validation.js +0 -0
  1034. /package/{dist → lib}/types/validation.js.map +0 -0
@@ -1,260 +0,0 @@
1
- import * as fs from 'fs/promises';
2
- import * as path from 'path';
3
- import picomatch from 'picomatch';
4
- import { parseMarkdown } from '../parser/index.js';
5
- import { getImageDestinations } from '../rules/token/helpers.js';
6
- const SKIP_DIRS = ['node_modules', 'dist', 'build'];
7
- export async function discoverMarkdownFiles(inputPath) {
8
- async function walkDir(dir) {
9
- const files = [];
10
- try {
11
- const entries = await fs.readdir(dir, { withFileTypes: true });
12
- for (const entry of entries) {
13
- const fullPath = path.join(dir, entry.name);
14
- if (entry.isDirectory()) {
15
- if (entry.name.startsWith('.') || SKIP_DIRS.includes(entry.name)) {
16
- continue;
17
- }
18
- files.push(...(await walkDir(fullPath)));
19
- }
20
- else if (entry.isFile() &&
21
- picomatch.isMatch(entry.name, '*.{md,markdown}', { nocase: true })) {
22
- files.push(fullPath);
23
- }
24
- }
25
- }
26
- catch {
27
- return [];
28
- }
29
- return files;
30
- }
31
- const stat = await fs.stat(inputPath);
32
- if (stat.isFile()) {
33
- return [inputPath];
34
- }
35
- else if (stat.isDirectory()) {
36
- return walkDir(inputPath);
37
- }
38
- else {
39
- return [];
40
- }
41
- }
42
- /**
43
- * Load list of changed files from either a file path or stdin
44
- */
45
- export async function loadChangedFiles(changedListPath) {
46
- // 1) Prefer explicit file path
47
- if (changedListPath && changedListPath.length > 0) {
48
- try {
49
- const content = await fs.readFile(changedListPath, 'utf8');
50
- return content
51
- .split(/\r?\n/)
52
- .map((s) => s.trim())
53
- .filter(Boolean);
54
- }
55
- catch (_err) {
56
- return [];
57
- }
58
- }
59
- // 2) Otherwise try to read from stdin if piped
60
- if (process.stdin.isTTY)
61
- return [];
62
- const chunks = [];
63
- return await new Promise((resolve) => {
64
- process.stdin.setEncoding('utf8');
65
- process.stdin.on('data', (d) => chunks.push(String(d)));
66
- process.stdin.on('end', () => {
67
- const text = chunks.join('');
68
- const lines = text
69
- .split(/\r?\n/)
70
- .map((s) => s.trim())
71
- .filter(Boolean);
72
- resolve(lines);
73
- });
74
- process.stdin.resume();
75
- });
76
- }
77
- /**
78
- * Runs `fn` over `items` with at most `limit` calls in flight at once,
79
- * returning results in the same order as `items` regardless of completion
80
- * order. Used to bound concurrency for disk I/O (e.g. lintFiles' reads)
81
- * without pulling in a workspace dependency — recheck is published
82
- * independently, so it can't depend on @redocly/shared's promiseMapLimit.
83
- */
84
- export async function mapLimit(items, limit, fn) {
85
- const results = new Array(items.length);
86
- let next = 0;
87
- async function worker() {
88
- while (next < items.length) {
89
- const index = next++;
90
- results[index] = await fn(items[index], index);
91
- }
92
- }
93
- await Promise.all(Array.from({ length: Math.min(limit, items.length) }, worker));
94
- return results;
95
- }
96
- /**
97
- * Whether any of the given rules use the max-image-size assertion, which
98
- * requires loading image metadata (file size, existence) from disk.
99
- */
100
- export function needsImageMetadata(rules) {
101
- return rules.some((rule) => Object.keys(rule.assertions).includes('max-image-size'));
102
- }
103
- /**
104
- * Extracts every local (non-`http(s)://`) image destination referenced in
105
- * `content` — both inline (`![alt](path "title")`) and reference-style
106
- * (`![alt][ref]`, `![alt][]`, `![alt]`) syntax — via `getImageDestinations`
107
- * (rules/token/helpers.ts), the SAME AST-based extraction
108
- * `rules/scope/max-image-size.ts` uses to look images up in
109
- * `ScopeRuleContext.fileMetadata.images`. Sharing one extraction pass is
110
- * load-bearing, not just tidy: the strings returned here become the exact
111
- * Map keys `loadImageMetadata` below stores on-disk stats under, and
112
- * max-image-size looks metadata up by the identical destination string it
113
- * resolves from the same tree shape — a second, independently-written
114
- * extraction (even an AST-based one) could subtly disagree on edge cases
115
- * (e.g. angle-bracket literal destinations, reference normalization) and
116
- * silently break that lookup.
117
- *
118
- * Parses `content` itself rather than accepting a pre-built tree: neither
119
- * of this function's current callers (`lintFiles` in src/index.ts,
120
- * `runCommand` in src/commands/run.ts) has already parsed the file at the
121
- * point they call this — both read raw file content and call this
122
- * immediately after, before the runner's own `parseMarkdown` pass — so
123
- * there is no cheap existing tree to thread through. This parse only runs
124
- * at all when `needsImageMetadata` finds `max-image-size` configured (see
125
- * below), bounding the extra cost to that case.
126
- *
127
- * Deliberately parsed without `{ markdoc: true }`, even when the caller's
128
- * config has the flag on. `getImageDestinations` only reads `image` tokens
129
- * (from `![alt](dest)`/`![alt][ref]`) and link-reference definitions, and the
130
- * Markdoc syntax extension hooks only on `{`, so it cannot affect where
131
- * `!`/`[`/`]`/`(` constructs start, end, or resolve. The set of destinations is
132
- * the same either way, and threading the flag through would add a parameter
133
- * here and to two public signatures to preserve something already true by
134
- * construction.
135
- */
136
- function extractImageReferences(content) {
137
- return getImageDestinations(parseMarkdown(content))
138
- .map(({ destination }) => destination)
139
- .filter((destination) => !destination.startsWith('http://') && !destination.startsWith('https://'));
140
- }
141
- /**
142
- * Cap on unique image refs processed per file by `loadImageMetadata`. Each
143
- * ref costs an `fs.stat`, so without a bound a pathological file (hundreds
144
- * of thousands of image refs) turns one lint into an unbounded stat storm.
145
- * 1,000 is far above any real document's image count. Refs beyond the cap
146
- * are OMITTED from the metadata map entirely — see the doc comment below
147
- * for why omission (not a fabricated `exists: false`) is the honest shape.
148
- */
149
- export const MAX_IMAGE_REFS_PER_FILE = 1000;
150
- /** Whether `resolved` (an absolute path) is `root` itself or inside it. */
151
- function isInsideRoot(root, resolved) {
152
- const relative = path.relative(root, resolved);
153
- return (relative === '' ||
154
- (relative !== '..' && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative)));
155
- }
156
- /**
157
- * Loads on-disk metadata (size, existence) for images referenced in a markdown
158
- * file's content, keyed by the image path as written in the source.
159
- *
160
- * Refs are confined to `root` (default: `process.cwd()`): a ref whose
161
- * resolved path escapes the root — `../` traversal above it, or an absolute
162
- * path like `/etc/passwd` — is recorded as `exists: false` WITHOUT being
163
- * stat'ed, so a hostile document can't use the linter to probe existence or
164
- * size of arbitrary files (both would otherwise leak into lint output).
165
- * Site-absolute doc refs like `/images/foo.png` land in the same bucket,
166
- * which matches the previous behavior for them observably: they used to be
167
- * stat'ed against the FILESYSTEM root, fail, and come back `exists: false`
168
- * anyway. Callers linting files outside their cwd should pass the lint root
169
- * explicitly (`lintFiles` threads its `root` option here).
170
- *
171
- * Confinement is physical, not just lexical: after the string-level check,
172
- * each surviving ref is `fs.realpath`'d and its REAL path must sit inside
173
- * the REAL root (the root's own realpath, resolved once per call). Without
174
- * this, a symlink planted INSIDE the root (`root/docs/evil.png ->
175
- * /etc/passwd`, or a symlinked directory escaping the root) passes the
176
- * lexical check and `fs.stat` follows it, leaking the target's existence
177
- * and size. Symlinks that RESOLVE inside the root keep working — legit repo
178
- * layouts symlink shared asset dirs around within the checkout. When
179
- * `realpath` throws (ENOENT for a missing file or dangling link — the
180
- * common case — or any other resolution failure), the ref falls through to
181
- * the same `fs.stat` try/catch as before: `stat` performs the identical
182
- * full path resolution, so it fails the same way and the ref reads
183
- * `exists: false` exactly as missing files always have. Cost: one extra
184
- * realpath per stat'ed image, only on the max-image-size code path.
185
- *
186
- * At most `MAX_IMAGE_REFS_PER_FILE` unique refs are processed; overflow refs
187
- * are omitted from the map rather than recorded. An absent key means "no
188
- * metadata loaded" to consumers — `max-image-size` skips refs it finds no
189
- * entry for, exactly as it skips `exists: false` entries — so omission never
190
- * fabricates a "this image is missing" fact for a ref that was simply never
191
- * checked. Duplicate refs share one entry (and one stat) and don't consume
192
- * extra cap slots.
193
- */
194
- export async function loadImageMetadata(file, content, root = process.cwd()) {
195
- const images = new Map();
196
- const baseDir = path.dirname(file);
197
- const resolvedRoot = path.resolve(root);
198
- const imageReferences = extractImageReferences(content);
199
- // The root's physical identity, resolved once per call (not per ref).
200
- // `undefined` when the root itself can't be resolved (e.g. doesn't
201
- // exist) — nothing lexically inside a nonexistent root can stat
202
- // successfully anyway, so the per-ref physical check is skipped and the
203
- // stat below reports `exists: false` on its own.
204
- let realRoot;
205
- try {
206
- realRoot = await fs.realpath(resolvedRoot);
207
- }
208
- catch {
209
- realRoot = undefined;
210
- }
211
- for (const imagePath of imageReferences) {
212
- if (images.has(imagePath)) {
213
- continue;
214
- }
215
- if (images.size >= MAX_IMAGE_REFS_PER_FILE) {
216
- break;
217
- }
218
- const fullPath = path.resolve(baseDir, imagePath);
219
- if (!isInsideRoot(resolvedRoot, fullPath)) {
220
- images.set(imagePath, { path: imagePath, size: 0, exists: false });
221
- continue;
222
- }
223
- // Physical confinement: a symlink inside the root must also RESOLVE
224
- // inside the (real) root, or stat would follow it out and leak the
225
- // target's existence/size. A realpath failure (ENOENT for missing
226
- // files and dangling links, or any other resolution error) falls
227
- // through: `fs.stat` resolves the same path the same way, fails
228
- // identically, and lands in the `exists: false` branch below —
229
- // missing files keep their exact pre-existing behavior.
230
- if (realRoot !== undefined) {
231
- try {
232
- const realPath = await fs.realpath(fullPath);
233
- if (!isInsideRoot(realRoot, realPath)) {
234
- images.set(imagePath, { path: imagePath, size: 0, exists: false });
235
- continue;
236
- }
237
- }
238
- catch {
239
- // Fall through to the stat below.
240
- }
241
- }
242
- try {
243
- const stats = await fs.stat(fullPath);
244
- images.set(imagePath, {
245
- path: imagePath,
246
- size: stats.size,
247
- exists: true,
248
- });
249
- }
250
- catch {
251
- images.set(imagePath, {
252
- path: imagePath,
253
- size: 0,
254
- exists: false,
255
- });
256
- }
257
- }
258
- return images.size > 0 ? { images } : undefined;
259
- }
260
- //# sourceMappingURL=files.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/core/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,SAAS,MAAM,WAAW,CAAC;AAIlC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,MAAM,SAAS,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpD,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,SAAiB;IAC3D,KAAK,UAAU,OAAO,CAAC,GAAW;QAChC,MAAM,KAAK,GAAa,EAAE,CAAC;QAE3B,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;Y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gBACf,IAAI,EAAE,CAAC;gBACP,MAAM,EAAE,KAAK;aACd,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAClD,CAAC"}
@@ -1,87 +0,0 @@
1
- /**
2
- * Matches one CommonMark inline code span: a backtick RUN of N backticks,
3
- * then content up to the NEXT run of exactly N backticks -- not merely "a
4
- * backtick ... a backtick" (a single-backtick-only regex treats a
5
- * multi-backtick span like ` ``configFile`` ` as two adjacent EMPTY
6
- * single-backtick pairs -- the two backticks at each end each look like
7
- * their own complete single-backtick pair -- leaving the real content
8
- * completely unrecognized in between). `(`+)` + backreference `\1`
9
- * requires the closing run to match the opening run's exact length;
10
- * `(?!`)` after `\1` rejects a run that is actually LONGER than N (e.g. a
11
- * stray extra backtick right after would mean this is not the true,
12
- * maximal closing run) -- this also correctly handles a span whose content
13
- * itself contains a SHORTER, unpaired backtick run (` ``code ` x`` `).
14
- * Content is restricted to `[^\n]` so a span can never cross a line;
15
- * callers only ever run this against single-line text.
16
- *
17
- * Shared by capitalization.ts (mask + restore, so `$`-style casing never
18
- * touches a code span's content), spelling.ts (mask, so a misspelling
19
- * check never flags identifier text), and metric.ts (strip, so readability
20
- * scoring never counts a code span's words/syllables) -- all three need
21
- * the identical CommonMark-correct span recognition, just applied
22
- * differently (mask-and-restore vs outright removal).
23
- */
24
- export declare const BACKTICK_SPAN_RE: RegExp;
25
- /**
26
- * Placeholder character `maskInlineCode` masks spans with. \0 sits outside
27
- * every word tokenizer in the codebase (title-case.ts's WORD_RE,
28
- * capitalization.ts's sentence tokenizer, spelling.ts's word regex), so a
29
- * masked span is invisible to word-based scanning -- never matched, never
30
- * capitalized, never the first/last word.
31
- */
32
- export declare const INLINE_CODE_MASK_CHAR = "\0";
33
- /**
34
- * Masks every inline code span in `text` with a SAME-LENGTH run of
35
- * INLINE_CODE_MASK_CHAR. Length-preserving on purpose: every remaining
36
- * token's offset stays aligned with the original text, so match positions
37
- * computed against the masked string are valid source positions -- and
38
- * `restoreInlineCode` can splice the original spans back purely by
39
- * position.
40
- */
41
- export declare function maskInlineCode(text: string): string;
42
- /**
43
- * Restores the inline code spans of `original` into `transformed`, a string
44
- * derived from `maskInlineCode(original)` by length-preserving transforms
45
- * only (e.g. case changes). Splices by position, not content search: the
46
- * span offsets found in `original` are still the span offsets in
47
- * `transformed` because masking and the intervening transforms never change
48
- * string length.
49
- */
50
- export declare function restoreInlineCode(original: string, transformed: string): string;
51
- /**
52
- * The half-open character ranges `[start, end)` of every inline code span
53
- * in `text`, using the same `BACKTICK_SPAN_RE` span recognition as
54
- * `maskInlineCode`/`restoreInlineCode` -- span recognition stays in exactly
55
- * one place.
56
- *
57
- * For rules that must REJECT a match inside code rather than rewrite text
58
- * (swap.ts, pattern.ts): those rules run an arbitrary user-supplied regex
59
- * (a `pattern` token, a `swap` key under `keysAreRegex`), and masking can
60
- * change what that regex matches. `maskInlineCode` substitutes a
61
- * same-length run of `\0` for a span's real characters -- and `\0` is not
62
- * whitespace, not a comma, not anything in particular. A negated class
63
- * like `[^\s,]+` treats that run as ordinary "not comma, not whitespace"
64
- * text and can match straight through it, merging text before and after
65
- * the span -- including whatever character (e.g. a comma) the class
66
- * exists to react to -- into one bogus match. A range check has no such
67
- * failure mode: the regex still runs against the genuine, unmodified text,
68
- * and a match is discarded only AFTER the fact, if its span overlaps a
69
- * code span. Use `inlineCodeRanges` + `overlapsAnyRange` for that; keep
70
- * `maskInlineCode` for rules that transform text in place and need a
71
- * length-preserving stand-in (capitalization.ts, spelling.ts).
72
- */
73
- export declare function inlineCodeRanges(text: string): Array<{
74
- start: number;
75
- end: number;
76
- }>;
77
- /**
78
- * Whether the half-open range `[start, end)` overlaps ANY of `ranges`.
79
- * Half-open, exclusive-end comparison on both sides: a match that only
80
- * touches a range's boundary -- ends exactly where the range starts, or
81
- * starts exactly where the range ends -- does NOT overlap.
82
- */
83
- export declare function overlapsAnyRange(start: number, end: number, ranges: Array<{
84
- start: number;
85
- end: number;
86
- }>): boolean;
87
- //# sourceMappingURL=inline-code.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-code.d.ts","sourceRoot":"","sources":["../../src/core/inline-code.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,gBAAgB,QAAwB,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAY/E;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAOpF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,GAC5C,OAAO,CAET"}
@@ -1,104 +0,0 @@
1
- /**
2
- * Matches one CommonMark inline code span: a backtick RUN of N backticks,
3
- * then content up to the NEXT run of exactly N backticks -- not merely "a
4
- * backtick ... a backtick" (a single-backtick-only regex treats a
5
- * multi-backtick span like ` ``configFile`` ` as two adjacent EMPTY
6
- * single-backtick pairs -- the two backticks at each end each look like
7
- * their own complete single-backtick pair -- leaving the real content
8
- * completely unrecognized in between). `(`+)` + backreference `\1`
9
- * requires the closing run to match the opening run's exact length;
10
- * `(?!`)` after `\1` rejects a run that is actually LONGER than N (e.g. a
11
- * stray extra backtick right after would mean this is not the true,
12
- * maximal closing run) -- this also correctly handles a span whose content
13
- * itself contains a SHORTER, unpaired backtick run (` ``code ` x`` `).
14
- * Content is restricted to `[^\n]` so a span can never cross a line;
15
- * callers only ever run this against single-line text.
16
- *
17
- * Shared by capitalization.ts (mask + restore, so `$`-style casing never
18
- * touches a code span's content), spelling.ts (mask, so a misspelling
19
- * check never flags identifier text), and metric.ts (strip, so readability
20
- * scoring never counts a code span's words/syllables) -- all three need
21
- * the identical CommonMark-correct span recognition, just applied
22
- * differently (mask-and-restore vs outright removal).
23
- */
24
- export const BACKTICK_SPAN_RE = /(`+)[^\n]*?\1(?!`)/g;
25
- /**
26
- * Placeholder character `maskInlineCode` masks spans with. \0 sits outside
27
- * every word tokenizer in the codebase (title-case.ts's WORD_RE,
28
- * capitalization.ts's sentence tokenizer, spelling.ts's word regex), so a
29
- * masked span is invisible to word-based scanning -- never matched, never
30
- * capitalized, never the first/last word.
31
- */
32
- export const INLINE_CODE_MASK_CHAR = '\0';
33
- /**
34
- * Masks every inline code span in `text` with a SAME-LENGTH run of
35
- * INLINE_CODE_MASK_CHAR. Length-preserving on purpose: every remaining
36
- * token's offset stays aligned with the original text, so match positions
37
- * computed against the masked string are valid source positions -- and
38
- * `restoreInlineCode` can splice the original spans back purely by
39
- * position.
40
- */
41
- export function maskInlineCode(text) {
42
- return text.replace(BACKTICK_SPAN_RE, (span) => INLINE_CODE_MASK_CHAR.repeat(span.length));
43
- }
44
- /**
45
- * Restores the inline code spans of `original` into `transformed`, a string
46
- * derived from `maskInlineCode(original)` by length-preserving transforms
47
- * only (e.g. case changes). Splices by position, not content search: the
48
- * span offsets found in `original` are still the span offsets in
49
- * `transformed` because masking and the intervening transforms never change
50
- * string length.
51
- */
52
- export function restoreInlineCode(original, transformed) {
53
- let result = '';
54
- let cursor = 0;
55
- for (const match of original.matchAll(BACKTICK_SPAN_RE)) {
56
- const start = match.index ?? 0;
57
- const end = start + match[0].length;
58
- result += transformed.slice(cursor, start);
59
- result += original.slice(start, end); // restore the masked span verbatim
60
- cursor = end;
61
- }
62
- result += transformed.slice(cursor);
63
- return result;
64
- }
65
- /**
66
- * The half-open character ranges `[start, end)` of every inline code span
67
- * in `text`, using the same `BACKTICK_SPAN_RE` span recognition as
68
- * `maskInlineCode`/`restoreInlineCode` -- span recognition stays in exactly
69
- * one place.
70
- *
71
- * For rules that must REJECT a match inside code rather than rewrite text
72
- * (swap.ts, pattern.ts): those rules run an arbitrary user-supplied regex
73
- * (a `pattern` token, a `swap` key under `keysAreRegex`), and masking can
74
- * change what that regex matches. `maskInlineCode` substitutes a
75
- * same-length run of `\0` for a span's real characters -- and `\0` is not
76
- * whitespace, not a comma, not anything in particular. A negated class
77
- * like `[^\s,]+` treats that run as ordinary "not comma, not whitespace"
78
- * text and can match straight through it, merging text before and after
79
- * the span -- including whatever character (e.g. a comma) the class
80
- * exists to react to -- into one bogus match. A range check has no such
81
- * failure mode: the regex still runs against the genuine, unmodified text,
82
- * and a match is discarded only AFTER the fact, if its span overlaps a
83
- * code span. Use `inlineCodeRanges` + `overlapsAnyRange` for that; keep
84
- * `maskInlineCode` for rules that transform text in place and need a
85
- * length-preserving stand-in (capitalization.ts, spelling.ts).
86
- */
87
- export function inlineCodeRanges(text) {
88
- const ranges = [];
89
- for (const match of text.matchAll(BACKTICK_SPAN_RE)) {
90
- const start = match.index ?? 0;
91
- ranges.push({ start, end: start + match[0].length });
92
- }
93
- return ranges;
94
- }
95
- /**
96
- * Whether the half-open range `[start, end)` overlaps ANY of `ranges`.
97
- * Half-open, exclusive-end comparison on both sides: a match that only
98
- * touches a range's boundary -- ends exactly where the range starts, or
99
- * starts exactly where the range ends -- does NOT overlap.
100
- */
101
- export function overlapsAnyRange(start, end, ranges) {
102
- return ranges.some((range) => start < range.end && range.start < end);
103
- }
104
- //# sourceMappingURL=inline-code.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inline-code.js","s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AAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACpD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;QAC/B,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAa,EACb,GAAW,EACX,MAA6C;IAE7C,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,IAAI,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC;AACxE,CAAC"}
@@ -1,32 +0,0 @@
1
- /**
2
- * Matches one line ending: CRLF (`\r\n`), lone CR (`\r`), or LF (`\n`).
3
- * Safe to share: `String.prototype.split` ignores the `g` flag/lastIndex,
4
- * and `String.prototype.match` with `g` always scans from index 0.
5
- */
6
- export declare const newLineRe: RegExp;
7
- /**
8
- * Gets the file's most common line ending, falling back to the platform
9
- * default for content with no line endings at all — the exact semantics of
10
- * upstream's `getPreferredLineEnding(input, os)`. `applyFixesToContent`
11
- * joins fixed lines with this, so an all-CRLF file round-trips through
12
- * --fix still CRLF (and a mixed-endings file is normalized to its
13
- * majority ending, as markdownlint's `applyFixes` does).
14
- */
15
- /**
16
- * Maps a 0-based character offset within `text` to a 1-based
17
- * (line, column) pair, treating CRLF, lone CR, and lone LF each as ONE
18
- * line ending — the single offset→position mapping every scope-rule
19
- * internals must use instead of hand-rolled `split('\n')` /
20
- * `lastIndexOf('\n')` arithmetic (which, on a CR-only file, keeps every
21
- * offset on line 1 with a column counted from the start of the text).
22
- *
23
- * An offset pointing INTO a CRLF pair (at its '\n') is reported as
24
- * column 1 of the following line; real callers pass match/sentence
25
- * offsets, which never start inside a line ending.
26
- */
27
- export declare function offsetToLineColumn(text: string, offset: number): {
28
- line: number;
29
- column: number;
30
- };
31
- export declare function getPreferredLineEnding(input: string): string;
32
- //# sourceMappingURL=line-endings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"line-endings.d.ts","sourceRoot":"","sources":["../../src/core/line-endings.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,eAAO,MAAM,SAAS,QAAc,CAAC;AAErC;;;;;;;GAOG;AACH;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAQjG;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAa5D"}
@@ -1,65 +0,0 @@
1
- // Ported from markdownlint's line-ending helpers (helpers/shared.cjs
2
- // `newlineRe` and helpers/helpers.cjs `getPreferredLineEnding`;
3
- // https://github.com/DavidAnson/markdownlint, MIT © David Anson).
4
- //
5
- // Everything that turns file content into per-line arrays (the runner's
6
- // ctx.lines, applyFixesToContent's working lines) must split with
7
- // `newLineRe`, never a bare '\n' — a CRLF file split on '\n' leaves a
8
- // trailing '\r' on every line, which token rules then misread as trailing
9
- // whitespace (and --fix would then mangle).
10
- import * as os from 'node:os';
11
- /**
12
- * Matches one line ending: CRLF (`\r\n`), lone CR (`\r`), or LF (`\n`).
13
- * Safe to share: `String.prototype.split` ignores the `g` flag/lastIndex,
14
- * and `String.prototype.match` with `g` always scans from index 0.
15
- */
16
- export const newLineRe = /\r\n?|\n/g;
17
- /**
18
- * Gets the file's most common line ending, falling back to the platform
19
- * default for content with no line endings at all — the exact semantics of
20
- * upstream's `getPreferredLineEnding(input, os)`. `applyFixesToContent`
21
- * joins fixed lines with this, so an all-CRLF file round-trips through
22
- * --fix still CRLF (and a mixed-endings file is normalized to its
23
- * majority ending, as markdownlint's `applyFixes` does).
24
- */
25
- /**
26
- * Maps a 0-based character offset within `text` to a 1-based
27
- * (line, column) pair, treating CRLF, lone CR, and lone LF each as ONE
28
- * line ending — the single offset→position mapping every scope-rule
29
- * internals must use instead of hand-rolled `split('\n')` /
30
- * `lastIndexOf('\n')` arithmetic (which, on a CR-only file, keeps every
31
- * offset on line 1 with a column counted from the start of the text).
32
- *
33
- * An offset pointing INTO a CRLF pair (at its '\n') is reported as
34
- * column 1 of the following line; real callers pass match/sentence
35
- * offsets, which never start inside a line ending.
36
- */
37
- export function offsetToLineColumn(text, offset) {
38
- let line = 1;
39
- let lineStart = 0;
40
- for (const match of text.slice(0, offset).matchAll(newLineRe)) {
41
- line++;
42
- lineStart = match.index + match[0].length;
43
- }
44
- return { line, column: offset - lineStart + 1 };
45
- }
46
- export function getPreferredLineEnding(input) {
47
- let cr = 0;
48
- let lf = 0;
49
- let crlf = 0;
50
- const endings = input.match(newLineRe) ?? [];
51
- for (const ending of endings) {
52
- if (ending === '\r')
53
- cr++;
54
- else if (ending === '\n')
55
- lf++;
56
- else
57
- crlf++;
58
- }
59
- if (!cr && !lf && !crlf)
60
- return os.EOL;
61
- if (lf >= crlf && lf >= cr)
62
- return '\n';
63
- return crlf >= cr ? '\r\n' : '\r';
64
- }
65
- //# sourceMappingURL=line-endings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"line-endings.js","sourceRoot":"","sources":["../../src/core/line-endings.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,gEAAgE;AAChE,kEAAkE;AAClE,EAAE;AACF,wEAAwE;AACxE,kEAAkE;AAClE,sEAAsE;AACtE,0EAA0E;AAC1E,4CAA4C;AAC5C,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAE9B;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AAErC;;;;;;;GAOG;AACH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,MAAc;IAC7D,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9D,IAAI,EAAE,CAAC;QACP,SAAS,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC5C,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,CAAC,EAAE,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAAa;IAClD,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,IAAI,EAAE,GAAG,CAAC,CAAC;IACX,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;IAC7C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,IAAI,MAAM,KAAK,IAAI;YAAE,EAAE,EAAE,CAAC;aACrB,IAAI,MAAM,KAAK,IAAI;YAAE,EAAE,EAAE,CAAC;;YAC1B,IAAI,EAAE,CAAC;IACd,CAAC;IACD,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC,GAAG,CAAC;IACvC,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,IAAI,EAAE;QAAE,OAAO,IAAI,CAAC;IACxC,OAAO,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACpC,CAAC"}
@@ -1,79 +0,0 @@
1
- import type { Fix } from '../types/index.js';
2
- import type { TokenTree } from '../parser/types.js';
3
- /**
4
- * The character `scopes/extractor.ts` blanks a markdoc tag's span with when
5
- * building prose content. A SPACE, deliberately, and not
6
- * `core/inline-code.ts`'s `\0` sentinel:
7
- *
8
- * - Recheck's prose model must read a tag's span as a GAP, and the word
9
- * tokenizers, `String.prototype.trim`, and the sentence splitter all agree on
10
- * whitespace, so a space makes every one of them treat the tag as absent.
11
- * - A user-supplied regex must NOT read it as a gap, and no sentinel can give
12
- * that: `\0` stops `\s+` from crossing a tag, but a negated class (`[^,]+`)
13
- * walks straight through it either way. Regex rules therefore have to reject
14
- * a match by RANGE, after the fact, against the unmodified text — see
15
- * `ScopedSegment.maskedRanges` and `nonProseRanges` in `rules/utils.ts`.
16
- */
17
- export declare const MARKDOC_TAG_MASK_CHAR = " ";
18
- /**
19
- * One markdoc tag's verbatim source bytes on ONE line. A block tag whose
20
- * attributes are broken across lines (`{% table\n x=1 %}`) contributes one
21
- * entry per line it covers, so every entry is a plain single-line span that a
22
- * `Fix` — itself always confined to one line — can be compared against directly.
23
- */
24
- export interface MarkdocTagSpan {
25
- /** 1-based source line. */
26
- line: number;
27
- /** 1-based, inclusive. */
28
- startColumn: number;
29
- /** 1-based, exclusive. */
30
- endColumn: number;
31
- /** The source bytes between those columns — what must survive a fix. */
32
- text: string;
33
- }
34
- /**
35
- * Every markdoc tag's source span in `content`, split per line (see
36
- * `MarkdocTagSpan`). Empty for a flag-off parse, since no `markdocTag` tokens
37
- * exist in the tree at all, so `--fix` behaves byte-identically.
38
- *
39
- * Uses `filterByTypes` rather than a raw `tree.flat.filter` so htmlFlow-reparsed
40
- * tokens are excluded on the same terms as for every other consumer: they
41
- * duplicate positions already covered by their `htmlFlow` parent, and treating a
42
- * duplicate as a protected span would block fixes on a line with no real tag.
43
- */
44
- export declare function markdocTagSpans(tree: TokenTree, content: string): MarkdocTagSpan[];
45
- export interface ProtectedFixes {
46
- /** Fixes safe to apply — tag-overlapping ones with their tags restored. */
47
- fixes: Fix[];
48
- /** Fixes that could not be made tag-safe, for the caller's skipped list. */
49
- dropped: Fix[];
50
- }
51
- /**
52
- * The choke point that keeps `--fix` from rewriting a markdoc tag's bytes.
53
- *
54
- * Prose scope content is masked (see `MARKDOC_TAG_MASK_CHAR`), which breaks the
55
- * precondition every whole-span rewriter relied on: `ScopedSegment.content` used
56
- * to be a verbatim source slice, so a rule replacing its whole span writes the
57
- * mask back over the real source and DELETES the tag. Rather than teach each such
58
- * rule to splice its own tags back, every fix from every rule passes through here
59
- * once, on its way to `applyFixesToContent`:
60
- *
61
- * - No tag on the fix's line, or no overlap with one: passes through untouched.
62
- * This is the only path a flag-off run can take, so flag-off byte-identity is
63
- * structural, not a special case.
64
- * - Overlap where the fix replaces its span with the SAME number of characters:
65
- * each overlapped tag's original bytes are spliced back at their own offsets.
66
- * Length preservation is what makes those offsets meaningful, and it is the
67
- * same contract `restoreInlineCode` (core/inline-code.ts) already relies on.
68
- * - Anything else — a length-changing replacement, a fix that cuts a tag in half,
69
- * a whole-line rewrite (`deleteCount: -1`) on a line with a tag — is DROPPED
70
- * and reported as skipped, since there is no position to splice into without
71
- * inventing one.
72
- *
73
- * A fix that turns out to change nothing once its tags are restored is dropped
74
- * too: it only matched mask characters, and letting it through would report a
75
- * byte-identical file as fixed and make `runRulesUntilStable` re-propose it on
76
- * every pass.
77
- */
78
- export declare function protectMarkdocTags(fixes: Fix[], spans: MarkdocTagSpan[], content: string): ProtectedFixes;
79
- //# sourceMappingURL=markdoc-tags.d.ts.map