@redocly/recheck 0.1.0 → 0.3.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 (595) hide show
  1. package/README.md +1023 -56
  2. package/dist/cli.js +40 -7
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/markdoc-schema.d.ts +17 -0
  5. package/dist/commands/markdoc-schema.d.ts.map +1 -0
  6. package/dist/commands/markdoc-schema.js +127 -0
  7. package/dist/commands/markdoc-schema.js.map +1 -0
  8. package/dist/commands/run.d.ts +2 -1
  9. package/dist/commands/run.d.ts.map +1 -1
  10. package/dist/commands/run.js +87 -10
  11. package/dist/commands/run.js.map +1 -1
  12. package/dist/config/load.d.ts +11 -0
  13. package/dist/config/load.d.ts.map +1 -1
  14. package/dist/config/load.js +12 -2
  15. package/dist/config/load.js.map +1 -1
  16. package/dist/config/presets/google.d.ts +3 -0
  17. package/dist/config/presets/google.d.ts.map +1 -0
  18. package/dist/config/presets/google.js +1671 -0
  19. package/dist/config/presets/google.js.map +1 -0
  20. package/dist/config/presets/inclusive-language.d.ts +3 -0
  21. package/dist/config/presets/inclusive-language.d.ts.map +1 -0
  22. package/dist/config/presets/inclusive-language.js +321 -0
  23. package/dist/config/presets/inclusive-language.js.map +1 -0
  24. package/dist/config/presets/index.d.ts +67 -0
  25. package/dist/config/presets/index.d.ts.map +1 -0
  26. package/dist/config/presets/index.js +137 -0
  27. package/dist/config/presets/index.js.map +1 -0
  28. package/dist/config/presets/markdoc.d.ts +21 -0
  29. package/dist/config/presets/markdoc.d.ts.map +1 -0
  30. package/dist/config/presets/markdoc.js +101 -0
  31. package/dist/config/presets/markdoc.js.map +1 -0
  32. package/dist/config/presets/markdown-relaxed.d.ts +3 -0
  33. package/dist/config/presets/markdown-relaxed.d.ts.map +1 -0
  34. package/dist/config/presets/markdown-relaxed.js +98 -0
  35. package/dist/config/presets/markdown-relaxed.js.map +1 -0
  36. package/dist/config/presets/markdown.d.ts +43 -0
  37. package/dist/config/presets/markdown.d.ts.map +1 -0
  38. package/dist/config/presets/markdown.js +132 -0
  39. package/dist/config/presets/markdown.js.map +1 -0
  40. package/dist/config/presets/microsoft.d.ts +3 -0
  41. package/dist/config/presets/microsoft.d.ts.map +1 -0
  42. package/dist/config/presets/microsoft.js +2268 -0
  43. package/dist/config/presets/microsoft.js.map +1 -0
  44. package/dist/config/presets/minimal.d.ts +3 -0
  45. package/dist/config/presets/minimal.d.ts.map +1 -0
  46. package/dist/config/presets/minimal.js +21 -0
  47. package/dist/config/presets/minimal.js.map +1 -0
  48. package/dist/config/presets/plain-language.d.ts +3 -0
  49. package/dist/config/presets/plain-language.d.ts.map +1 -0
  50. package/dist/config/presets/plain-language.js +351 -0
  51. package/dist/config/presets/plain-language.js.map +1 -0
  52. package/dist/config/presets/prose.d.ts +52 -0
  53. package/dist/config/presets/prose.d.ts.map +1 -0
  54. package/dist/config/presets/prose.js +138 -0
  55. package/dist/config/presets/prose.js.map +1 -0
  56. package/dist/config/schema.d.ts +128 -22
  57. package/dist/config/schema.d.ts.map +1 -1
  58. package/dist/config/schema.js +105 -21
  59. package/dist/config/schema.js.map +1 -1
  60. package/dist/config/validate.d.ts +12 -2
  61. package/dist/config/validate.d.ts.map +1 -1
  62. package/dist/config/validate.js +1200 -44
  63. package/dist/config/validate.js.map +1 -1
  64. package/dist/core/auto-fix.d.ts +8 -13
  65. package/dist/core/auto-fix.d.ts.map +1 -1
  66. package/dist/core/auto-fix.js +94 -75
  67. package/dist/core/auto-fix.js.map +1 -1
  68. package/dist/core/case-preserve.d.ts +46 -0
  69. package/dist/core/case-preserve.d.ts.map +1 -0
  70. package/dist/core/case-preserve.js +57 -0
  71. package/dist/core/case-preserve.js.map +1 -0
  72. package/dist/core/directives.d.ts +9 -0
  73. package/dist/core/directives.d.ts.map +1 -0
  74. package/dist/core/directives.js +73 -0
  75. package/dist/core/directives.js.map +1 -0
  76. package/dist/core/files.d.ts +63 -0
  77. package/dist/core/files.d.ts.map +1 -1
  78. package/dist/core/files.js +185 -0
  79. package/dist/core/files.js.map +1 -1
  80. package/dist/core/inline-code.d.ts +87 -0
  81. package/dist/core/inline-code.d.ts.map +1 -0
  82. package/dist/core/inline-code.js +104 -0
  83. package/dist/core/inline-code.js.map +1 -0
  84. package/dist/core/line-endings.d.ts +32 -0
  85. package/dist/core/line-endings.d.ts.map +1 -0
  86. package/dist/core/line-endings.js +65 -0
  87. package/dist/core/line-endings.js.map +1 -0
  88. package/dist/core/markdoc-tags.d.ts +79 -0
  89. package/dist/core/markdoc-tags.d.ts.map +1 -0
  90. package/dist/core/markdoc-tags.js +131 -0
  91. package/dist/core/markdoc-tags.js.map +1 -0
  92. package/dist/core/rule-filters.d.ts +17 -0
  93. package/dist/core/rule-filters.d.ts.map +1 -1
  94. package/dist/core/rule-filters.js +64 -0
  95. package/dist/core/rule-filters.js.map +1 -1
  96. package/dist/core/runner.d.ts +92 -3
  97. package/dist/core/runner.d.ts.map +1 -1
  98. package/dist/core/runner.js +348 -110
  99. package/dist/core/runner.js.map +1 -1
  100. package/dist/core/timing.d.ts.map +1 -1
  101. package/dist/data/markdoc-realm-schema.d.ts +3 -0
  102. package/dist/data/markdoc-realm-schema.d.ts.map +1 -0
  103. package/dist/data/markdoc-realm-schema.js +760 -0
  104. package/dist/data/markdoc-realm-schema.js.map +1 -0
  105. package/dist/data/proper-nouns.d.ts +2 -0
  106. package/dist/data/proper-nouns.d.ts.map +1 -0
  107. package/dist/data/proper-nouns.js +47 -0
  108. package/dist/data/proper-nouns.js.map +1 -0
  109. package/dist/index.d.ts +90 -0
  110. package/dist/index.d.ts.map +1 -0
  111. package/dist/index.js +152 -0
  112. package/dist/index.js.map +1 -0
  113. package/dist/metrics/formulas.d.ts +17 -0
  114. package/dist/metrics/formulas.d.ts.map +1 -0
  115. package/dist/metrics/formulas.js +70 -0
  116. package/dist/metrics/formulas.js.map +1 -0
  117. package/dist/metrics/index.d.ts +5 -0
  118. package/dist/metrics/index.d.ts.map +1 -0
  119. package/dist/metrics/index.js +3 -0
  120. package/dist/metrics/index.js.map +1 -0
  121. package/dist/metrics/statistics.d.ts +27 -0
  122. package/dist/metrics/statistics.d.ts.map +1 -0
  123. package/dist/metrics/statistics.js +56 -0
  124. package/dist/metrics/statistics.js.map +1 -0
  125. package/dist/parser/index.d.ts +18 -0
  126. package/dist/parser/index.d.ts.map +1 -0
  127. package/dist/parser/index.js +168 -0
  128. package/dist/parser/index.js.map +1 -0
  129. package/dist/parser/markdoc/extract-statics.d.ts +45 -0
  130. package/dist/parser/markdoc/extract-statics.d.ts.map +1 -0
  131. package/dist/parser/markdoc/extract-statics.js +139 -0
  132. package/dist/parser/markdoc/extract-statics.js.map +1 -0
  133. package/dist/parser/markdoc/pairing.d.ts +63 -0
  134. package/dist/parser/markdoc/pairing.d.ts.map +1 -0
  135. package/dist/parser/markdoc/pairing.js +94 -0
  136. package/dist/parser/markdoc/pairing.js.map +1 -0
  137. package/dist/parser/markdoc/schema.d.ts +85 -0
  138. package/dist/parser/markdoc/schema.d.ts.map +1 -0
  139. package/dist/parser/markdoc/schema.js +86 -0
  140. package/dist/parser/markdoc/schema.js.map +1 -0
  141. package/dist/parser/markdoc/span.d.ts +64 -0
  142. package/dist/parser/markdoc/span.d.ts.map +1 -0
  143. package/dist/parser/markdoc/span.js +729 -0
  144. package/dist/parser/markdoc/span.js.map +1 -0
  145. package/dist/parser/markdoc/structure.d.ts +28 -0
  146. package/dist/parser/markdoc/structure.d.ts.map +1 -0
  147. package/dist/parser/markdoc/structure.js +153 -0
  148. package/dist/parser/markdoc/structure.js.map +1 -0
  149. package/dist/parser/markdoc/syntax.d.ts +44 -0
  150. package/dist/parser/markdoc/syntax.d.ts.map +1 -0
  151. package/dist/parser/markdoc/syntax.js +317 -0
  152. package/dist/parser/markdoc/syntax.js.map +1 -0
  153. package/dist/parser/types.d.ts +18 -0
  154. package/dist/parser/types.d.ts.map +1 -0
  155. package/dist/parser/types.js.map +1 -0
  156. package/dist/reporter/fixes.d.ts.map +1 -1
  157. package/dist/reporter/fixes.js +22 -1
  158. package/dist/reporter/fixes.js.map +1 -1
  159. package/dist/reporter/statistics.d.ts +1 -8
  160. package/dist/reporter/statistics.d.ts.map +1 -1
  161. package/dist/reporter/statistics.js.map +1 -1
  162. package/dist/rules/registry.d.ts +15 -0
  163. package/dist/rules/registry.d.ts.map +1 -0
  164. package/dist/rules/registry.js +81 -0
  165. package/dist/rules/registry.js.map +1 -0
  166. package/dist/rules/scope/capitalization.d.ts +3 -0
  167. package/dist/rules/scope/capitalization.d.ts.map +1 -0
  168. package/dist/rules/scope/capitalization.js +163 -0
  169. package/dist/rules/scope/capitalization.js.map +1 -0
  170. package/dist/rules/scope/conditional.d.ts +3 -0
  171. package/dist/rules/scope/conditional.d.ts.map +1 -0
  172. package/dist/rules/scope/conditional.js +112 -0
  173. package/dist/rules/scope/conditional.js.map +1 -0
  174. package/dist/rules/scope/consistency.d.ts +3 -0
  175. package/dist/rules/scope/consistency.d.ts.map +1 -0
  176. package/dist/rules/scope/consistency.js +178 -0
  177. package/dist/rules/scope/consistency.js.map +1 -0
  178. package/dist/rules/scope/length.d.ts +3 -0
  179. package/dist/rules/scope/length.d.ts.map +1 -0
  180. package/dist/rules/scope/length.js +69 -0
  181. package/dist/rules/scope/length.js.map +1 -0
  182. package/dist/rules/scope/max-image-size.d.ts +3 -0
  183. package/dist/rules/scope/max-image-size.d.ts.map +1 -0
  184. package/dist/rules/scope/max-image-size.js +65 -0
  185. package/dist/rules/scope/max-image-size.js.map +1 -0
  186. package/dist/rules/scope/metric.d.ts +17 -0
  187. package/dist/rules/scope/metric.d.ts.map +1 -0
  188. package/dist/rules/scope/metric.js +216 -0
  189. package/dist/rules/scope/metric.js.map +1 -0
  190. package/dist/rules/scope/occurrence.d.ts +3 -0
  191. package/dist/rules/scope/occurrence.d.ts.map +1 -0
  192. package/dist/rules/scope/occurrence.js +48 -0
  193. package/dist/rules/scope/occurrence.js.map +1 -0
  194. package/dist/rules/scope/pattern.d.ts +3 -0
  195. package/dist/rules/scope/pattern.d.ts.map +1 -0
  196. package/dist/rules/scope/pattern.js +75 -0
  197. package/dist/rules/scope/pattern.js.map +1 -0
  198. package/dist/rules/scope/repetition.d.ts +3 -0
  199. package/dist/rules/scope/repetition.d.ts.map +1 -0
  200. package/dist/rules/scope/repetition.js +139 -0
  201. package/dist/rules/scope/repetition.js.map +1 -0
  202. package/dist/rules/scope/semantic-line-breaks.d.ts +3 -0
  203. package/dist/rules/scope/semantic-line-breaks.d.ts.map +1 -0
  204. package/dist/rules/scope/semantic-line-breaks.js +213 -0
  205. package/dist/rules/scope/semantic-line-breaks.js.map +1 -0
  206. package/dist/rules/scope/spelling.d.ts +27 -0
  207. package/dist/rules/scope/spelling.d.ts.map +1 -0
  208. package/dist/rules/scope/spelling.js +227 -0
  209. package/dist/rules/scope/spelling.js.map +1 -0
  210. package/dist/rules/scope/swap.d.ts +3 -0
  211. package/dist/rules/scope/swap.d.ts.map +1 -0
  212. package/dist/rules/scope/swap.js +149 -0
  213. package/dist/rules/scope/swap.js.map +1 -0
  214. package/dist/rules/scope/title-case.d.ts +46 -0
  215. package/dist/rules/scope/title-case.d.ts.map +1 -0
  216. package/dist/rules/scope/title-case.js +301 -0
  217. package/dist/rules/scope/title-case.js.map +1 -0
  218. package/dist/rules/token/blanks-around-fences.d.ts +3 -0
  219. package/dist/rules/token/blanks-around-fences.d.ts.map +1 -0
  220. package/dist/rules/token/blanks-around-fences.js +44 -0
  221. package/dist/rules/token/blanks-around-fences.js.map +1 -0
  222. package/dist/rules/token/blanks-around-headings.d.ts +3 -0
  223. package/dist/rules/token/blanks-around-headings.d.ts.map +1 -0
  224. package/dist/rules/token/blanks-around-headings.js +108 -0
  225. package/dist/rules/token/blanks-around-headings.js.map +1 -0
  226. package/dist/rules/token/blanks-around-lists.d.ts +3 -0
  227. package/dist/rules/token/blanks-around-lists.d.ts.map +1 -0
  228. package/dist/rules/token/blanks-around-lists.js +56 -0
  229. package/dist/rules/token/blanks-around-lists.js.map +1 -0
  230. package/dist/rules/token/blanks-around-tables.d.ts +3 -0
  231. package/dist/rules/token/blanks-around-tables.d.ts.map +1 -0
  232. package/dist/rules/token/blanks-around-tables.js +42 -0
  233. package/dist/rules/token/blanks-around-tables.js.map +1 -0
  234. package/dist/rules/token/code-block-style.d.ts +3 -0
  235. package/dist/rules/token/code-block-style.d.ts.map +1 -0
  236. package/dist/rules/token/code-block-style.js +30 -0
  237. package/dist/rules/token/code-block-style.js.map +1 -0
  238. package/dist/rules/token/code-fence-style.d.ts +3 -0
  239. package/dist/rules/token/code-fence-style.d.ts.map +1 -0
  240. package/dist/rules/token/code-fence-style.js +35 -0
  241. package/dist/rules/token/code-fence-style.js.map +1 -0
  242. package/dist/rules/token/commands-show-output.d.ts +3 -0
  243. package/dist/rules/token/commands-show-output.d.ts.map +1 -0
  244. package/dist/rules/token/commands-show-output.js +38 -0
  245. package/dist/rules/token/commands-show-output.js.map +1 -0
  246. package/dist/rules/token/descriptive-link-text.d.ts +3 -0
  247. package/dist/rules/token/descriptive-link-text.d.ts.map +1 -0
  248. package/dist/rules/token/descriptive-link-text.js +53 -0
  249. package/dist/rules/token/descriptive-link-text.js.map +1 -0
  250. package/dist/rules/token/emphasis-style.d.ts +3 -0
  251. package/dist/rules/token/emphasis-style.d.ts.map +1 -0
  252. package/dist/rules/token/emphasis-style.js +51 -0
  253. package/dist/rules/token/emphasis-style.js.map +1 -0
  254. package/dist/rules/token/fenced-code-language.d.ts +3 -0
  255. package/dist/rules/token/fenced-code-language.d.ts.map +1 -0
  256. package/dist/rules/token/fenced-code-language.js +35 -0
  257. package/dist/rules/token/fenced-code-language.js.map +1 -0
  258. package/dist/rules/token/first-line-h1.d.ts +3 -0
  259. package/dist/rules/token/first-line-h1.d.ts.map +1 -0
  260. package/dist/rules/token/first-line-h1.js +107 -0
  261. package/dist/rules/token/first-line-h1.js.map +1 -0
  262. package/dist/rules/token/heading-increment.d.ts +3 -0
  263. package/dist/rules/token/heading-increment.d.ts.map +1 -0
  264. package/dist/rules/token/heading-increment.js +27 -0
  265. package/dist/rules/token/heading-increment.js.map +1 -0
  266. package/dist/rules/token/heading-start-left.d.ts +3 -0
  267. package/dist/rules/token/heading-start-left.d.ts.map +1 -0
  268. package/dist/rules/token/heading-start-left.js +31 -0
  269. package/dist/rules/token/heading-start-left.js.map +1 -0
  270. package/dist/rules/token/heading-style.d.ts +3 -0
  271. package/dist/rules/token/heading-style.d.ts.map +1 -0
  272. package/dist/rules/token/heading-style.js +41 -0
  273. package/dist/rules/token/heading-style.js.map +1 -0
  274. package/dist/rules/token/helpers.d.ts +313 -0
  275. package/dist/rules/token/helpers.d.ts.map +1 -0
  276. package/dist/rules/token/helpers.js +746 -0
  277. package/dist/rules/token/helpers.js.map +1 -0
  278. package/dist/rules/token/hr-style.d.ts +3 -0
  279. package/dist/rules/token/hr-style.d.ts.map +1 -0
  280. package/dist/rules/token/hr-style.js +28 -0
  281. package/dist/rules/token/hr-style.js.map +1 -0
  282. package/dist/rules/token/index.d.ts +75 -0
  283. package/dist/rules/token/index.d.ts.map +1 -0
  284. package/dist/rules/token/index.js +226 -0
  285. package/dist/rules/token/index.js.map +1 -0
  286. package/dist/rules/token/line-length.d.ts +3 -0
  287. package/dist/rules/token/line-length.d.ts.map +1 -0
  288. package/dist/rules/token/line-length.js +120 -0
  289. package/dist/rules/token/line-length.js.map +1 -0
  290. package/dist/rules/token/link-fragments.d.ts +3 -0
  291. package/dist/rules/token/link-fragments.d.ts.map +1 -0
  292. package/dist/rules/token/link-fragments.js +145 -0
  293. package/dist/rules/token/link-fragments.js.map +1 -0
  294. package/dist/rules/token/link-image-reference-definitions.d.ts +3 -0
  295. package/dist/rules/token/link-image-reference-definitions.d.ts.map +1 -0
  296. package/dist/rules/token/link-image-reference-definitions.js +50 -0
  297. package/dist/rules/token/link-image-reference-definitions.js.map +1 -0
  298. package/dist/rules/token/link-image-style.d.ts +3 -0
  299. package/dist/rules/token/link-image-style.d.ts.map +1 -0
  300. package/dist/rules/token/link-image-style.js +131 -0
  301. package/dist/rules/token/link-image-style.js.map +1 -0
  302. package/dist/rules/token/list-indent.d.ts +3 -0
  303. package/dist/rules/token/list-indent.d.ts.map +1 -0
  304. package/dist/rules/token/list-indent.js +60 -0
  305. package/dist/rules/token/list-indent.js.map +1 -0
  306. package/dist/rules/token/list-length.d.ts +3 -0
  307. package/dist/rules/token/list-length.d.ts.map +1 -0
  308. package/dist/rules/token/list-length.js +55 -0
  309. package/dist/rules/token/list-length.js.map +1 -0
  310. package/dist/rules/token/list-marker-space.d.ts +3 -0
  311. package/dist/rules/token/list-marker-space.d.ts.map +1 -0
  312. package/dist/rules/token/list-marker-space.js +52 -0
  313. package/dist/rules/token/list-marker-space.js.map +1 -0
  314. package/dist/rules/token/markdoc-attributes.d.ts +3 -0
  315. package/dist/rules/token/markdoc-attributes.d.ts.map +1 -0
  316. package/dist/rules/token/markdoc-attributes.js +269 -0
  317. package/dist/rules/token/markdoc-attributes.js.map +1 -0
  318. package/dist/rules/token/markdoc-pairing.d.ts +3 -0
  319. package/dist/rules/token/markdoc-pairing.d.ts.map +1 -0
  320. package/dist/rules/token/markdoc-pairing.js +73 -0
  321. package/dist/rules/token/markdoc-pairing.js.map +1 -0
  322. package/dist/rules/token/markdoc-syntax.d.ts +3 -0
  323. package/dist/rules/token/markdoc-syntax.d.ts.map +1 -0
  324. package/dist/rules/token/markdoc-syntax.js +119 -0
  325. package/dist/rules/token/markdoc-syntax.js.map +1 -0
  326. package/dist/rules/token/markdoc-unknown-tag.d.ts +3 -0
  327. package/dist/rules/token/markdoc-unknown-tag.d.ts.map +1 -0
  328. package/dist/rules/token/markdoc-unknown-tag.js +64 -0
  329. package/dist/rules/token/markdoc-unknown-tag.js.map +1 -0
  330. package/dist/rules/token/messages.d.ts +4 -0
  331. package/dist/rules/token/messages.d.ts.map +1 -0
  332. package/dist/rules/token/messages.js +20 -0
  333. package/dist/rules/token/messages.js.map +1 -0
  334. package/dist/rules/token/no-alt-text.d.ts +3 -0
  335. package/dist/rules/token/no-alt-text.d.ts.map +1 -0
  336. package/dist/rules/token/no-alt-text.js +47 -0
  337. package/dist/rules/token/no-alt-text.js.map +1 -0
  338. package/dist/rules/token/no-bare-urls.d.ts +3 -0
  339. package/dist/rules/token/no-bare-urls.d.ts.map +1 -0
  340. package/dist/rules/token/no-bare-urls.js +88 -0
  341. package/dist/rules/token/no-bare-urls.js.map +1 -0
  342. package/dist/rules/token/no-blanks-blockquote.d.ts +3 -0
  343. package/dist/rules/token/no-blanks-blockquote.d.ts.map +1 -0
  344. package/dist/rules/token/no-blanks-blockquote.js +39 -0
  345. package/dist/rules/token/no-blanks-blockquote.js.map +1 -0
  346. package/dist/rules/token/no-duplicate-heading.d.ts +3 -0
  347. package/dist/rules/token/no-duplicate-heading.d.ts.map +1 -0
  348. package/dist/rules/token/no-duplicate-heading.js +101 -0
  349. package/dist/rules/token/no-duplicate-heading.js.map +1 -0
  350. package/dist/rules/token/no-duplicate-link-destinations.d.ts +3 -0
  351. package/dist/rules/token/no-duplicate-link-destinations.d.ts.map +1 -0
  352. package/dist/rules/token/no-duplicate-link-destinations.js +65 -0
  353. package/dist/rules/token/no-duplicate-link-destinations.js.map +1 -0
  354. package/dist/rules/token/no-emphasis-as-heading.d.ts +3 -0
  355. package/dist/rules/token/no-emphasis-as-heading.d.ts.map +1 -0
  356. package/dist/rules/token/no-emphasis-as-heading.js +44 -0
  357. package/dist/rules/token/no-emphasis-as-heading.js.map +1 -0
  358. package/dist/rules/token/no-empty-headings.d.ts +3 -0
  359. package/dist/rules/token/no-empty-headings.d.ts.map +1 -0
  360. package/dist/rules/token/no-empty-headings.js +28 -0
  361. package/dist/rules/token/no-empty-headings.js.map +1 -0
  362. package/dist/rules/token/no-empty-links.d.ts +3 -0
  363. package/dist/rules/token/no-empty-links.d.ts.map +1 -0
  364. package/dist/rules/token/no-empty-links.js +67 -0
  365. package/dist/rules/token/no-empty-links.js.map +1 -0
  366. package/dist/rules/token/no-hard-tabs.d.ts +3 -0
  367. package/dist/rules/token/no-hard-tabs.d.ts.map +1 -0
  368. package/dist/rules/token/no-hard-tabs.js +76 -0
  369. package/dist/rules/token/no-hard-tabs.js.map +1 -0
  370. package/dist/rules/token/no-inline-html.d.ts +3 -0
  371. package/dist/rules/token/no-inline-html.d.ts.map +1 -0
  372. package/dist/rules/token/no-inline-html.js +45 -0
  373. package/dist/rules/token/no-inline-html.js.map +1 -0
  374. package/dist/rules/token/no-missing-space-atx.d.ts +3 -0
  375. package/dist/rules/token/no-missing-space-atx.d.ts.map +1 -0
  376. package/dist/rules/token/no-missing-space-atx.js +36 -0
  377. package/dist/rules/token/no-missing-space-atx.js.map +1 -0
  378. package/dist/rules/token/no-missing-space-closed-atx.d.ts +3 -0
  379. package/dist/rules/token/no-missing-space-closed-atx.d.ts.map +1 -0
  380. package/dist/rules/token/no-missing-space-closed-atx.js +45 -0
  381. package/dist/rules/token/no-missing-space-closed-atx.js.map +1 -0
  382. package/dist/rules/token/no-multiple-blanks.d.ts +3 -0
  383. package/dist/rules/token/no-multiple-blanks.d.ts.map +1 -0
  384. package/dist/rules/token/no-multiple-blanks.js +35 -0
  385. package/dist/rules/token/no-multiple-blanks.js.map +1 -0
  386. package/dist/rules/token/no-multiple-space-atx.d.ts +13 -0
  387. package/dist/rules/token/no-multiple-space-atx.d.ts.map +1 -0
  388. package/dist/rules/token/no-multiple-space-atx.js +50 -0
  389. package/dist/rules/token/no-multiple-space-atx.js.map +1 -0
  390. package/dist/rules/token/no-multiple-space-blockquote.d.ts +3 -0
  391. package/dist/rules/token/no-multiple-space-blockquote.d.ts.map +1 -0
  392. package/dist/rules/token/no-multiple-space-blockquote.js +43 -0
  393. package/dist/rules/token/no-multiple-space-blockquote.js.map +1 -0
  394. package/dist/rules/token/no-multiple-space-closed-atx.d.ts +3 -0
  395. package/dist/rules/token/no-multiple-space-closed-atx.d.ts.map +1 -0
  396. package/dist/rules/token/no-multiple-space-closed-atx.js +19 -0
  397. package/dist/rules/token/no-multiple-space-closed-atx.js.map +1 -0
  398. package/dist/rules/token/no-reversed-links.d.ts +3 -0
  399. package/dist/rules/token/no-reversed-links.d.ts.map +1 -0
  400. package/dist/rules/token/no-reversed-links.js +52 -0
  401. package/dist/rules/token/no-reversed-links.js.map +1 -0
  402. package/dist/rules/token/no-space-in-code.d.ts +3 -0
  403. package/dist/rules/token/no-space-in-code.d.ts.map +1 -0
  404. package/dist/rules/token/no-space-in-code.js +75 -0
  405. package/dist/rules/token/no-space-in-code.js.map +1 -0
  406. package/dist/rules/token/no-space-in-emphasis.d.ts +3 -0
  407. package/dist/rules/token/no-space-in-emphasis.d.ts.map +1 -0
  408. package/dist/rules/token/no-space-in-emphasis.js +79 -0
  409. package/dist/rules/token/no-space-in-emphasis.js.map +1 -0
  410. package/dist/rules/token/no-space-in-links.d.ts +3 -0
  411. package/dist/rules/token/no-space-in-links.d.ts.map +1 -0
  412. package/dist/rules/token/no-space-in-links.js +48 -0
  413. package/dist/rules/token/no-space-in-links.js.map +1 -0
  414. package/dist/rules/token/no-trailing-punctuation.d.ts +3 -0
  415. package/dist/rules/token/no-trailing-punctuation.d.ts.map +1 -0
  416. package/dist/rules/token/no-trailing-punctuation.js +38 -0
  417. package/dist/rules/token/no-trailing-punctuation.js.map +1 -0
  418. package/dist/rules/token/no-trailing-spaces.d.ts +3 -0
  419. package/dist/rules/token/no-trailing-spaces.d.ts.map +1 -0
  420. package/dist/rules/token/no-trailing-spaces.js +89 -0
  421. package/dist/rules/token/no-trailing-spaces.js.map +1 -0
  422. package/dist/rules/token/ol-prefix.d.ts +3 -0
  423. package/dist/rules/token/ol-prefix.d.ts.map +1 -0
  424. package/dist/rules/token/ol-prefix.js +70 -0
  425. package/dist/rules/token/ol-prefix.js.map +1 -0
  426. package/dist/rules/token/proper-names.d.ts +3 -0
  427. package/dist/rules/token/proper-names.d.ts.map +1 -0
  428. package/dist/rules/token/proper-names.js +93 -0
  429. package/dist/rules/token/proper-names.js.map +1 -0
  430. package/dist/rules/token/reference-links-images.d.ts +3 -0
  431. package/dist/rules/token/reference-links-images.d.ts.map +1 -0
  432. package/dist/rules/token/reference-links-images.js +36 -0
  433. package/dist/rules/token/reference-links-images.js.map +1 -0
  434. package/dist/rules/token/required-headings.d.ts +3 -0
  435. package/dist/rules/token/required-headings.d.ts.map +1 -0
  436. package/dist/rules/token/required-headings.js +83 -0
  437. package/dist/rules/token/required-headings.js.map +1 -0
  438. package/dist/rules/token/single-h1.d.ts +3 -0
  439. package/dist/rules/token/single-h1.d.ts.map +1 -0
  440. package/dist/rules/token/single-h1.js +56 -0
  441. package/dist/rules/token/single-h1.js.map +1 -0
  442. package/dist/rules/token/single-trailing-newline.d.ts +3 -0
  443. package/dist/rules/token/single-trailing-newline.d.ts.map +1 -0
  444. package/dist/rules/token/single-trailing-newline.js +25 -0
  445. package/dist/rules/token/single-trailing-newline.js.map +1 -0
  446. package/dist/rules/token/strong-style.d.ts +3 -0
  447. package/dist/rules/token/strong-style.d.ts.map +1 -0
  448. package/dist/rules/token/strong-style.js +51 -0
  449. package/dist/rules/token/strong-style.js.map +1 -0
  450. package/dist/rules/token/table-column-count.d.ts +3 -0
  451. package/dist/rules/token/table-column-count.d.ts.map +1 -0
  452. package/dist/rules/token/table-column-count.js +44 -0
  453. package/dist/rules/token/table-column-count.js.map +1 -0
  454. package/dist/rules/token/table-column-style.d.ts +3 -0
  455. package/dist/rules/token/table-column-style.d.ts.map +1 -0
  456. package/dist/rules/token/table-column-style.js +179 -0
  457. package/dist/rules/token/table-column-style.js.map +1 -0
  458. package/dist/rules/token/table-pipe-style.d.ts +3 -0
  459. package/dist/rules/token/table-pipe-style.d.ts.map +1 -0
  460. package/dist/rules/token/table-pipe-style.js +54 -0
  461. package/dist/rules/token/table-pipe-style.js.map +1 -0
  462. package/dist/rules/token/ul-indent.d.ts +3 -0
  463. package/dist/rules/token/ul-indent.d.ts.map +1 -0
  464. package/dist/rules/token/ul-indent.js +72 -0
  465. package/dist/rules/token/ul-indent.js.map +1 -0
  466. package/dist/rules/token/ul-style.d.ts +3 -0
  467. package/dist/rules/token/ul-style.d.ts.map +1 -0
  468. package/dist/rules/token/ul-style.js +80 -0
  469. package/dist/rules/token/ul-style.js.map +1 -0
  470. package/dist/rules/types.d.ts +81 -0
  471. package/dist/rules/types.d.ts.map +1 -0
  472. package/dist/rules/types.js +2 -0
  473. package/dist/rules/types.js.map +1 -0
  474. package/dist/rules/utils.d.ts +29 -0
  475. package/dist/rules/utils.d.ts.map +1 -0
  476. package/dist/{assertions → rules}/utils.js +27 -0
  477. package/dist/rules/utils.js.map +1 -0
  478. package/dist/scopes/extractor.d.ts +7 -0
  479. package/dist/scopes/extractor.d.ts.map +1 -0
  480. package/dist/scopes/extractor.js +475 -0
  481. package/dist/scopes/extractor.js.map +1 -0
  482. package/dist/scopes/selector.d.ts +51 -0
  483. package/dist/scopes/selector.d.ts.map +1 -0
  484. package/dist/scopes/selector.js +121 -0
  485. package/dist/scopes/selector.js.map +1 -0
  486. package/dist/scopes/sentences.d.ts +15 -0
  487. package/dist/scopes/sentences.d.ts.map +1 -0
  488. package/dist/scopes/sentences.js +124 -0
  489. package/dist/scopes/sentences.js.map +1 -0
  490. package/dist/scopes/types.d.ts +44 -0
  491. package/dist/scopes/types.d.ts.map +1 -0
  492. package/dist/scopes/types.js +2 -0
  493. package/dist/scopes/types.js.map +1 -0
  494. package/dist/scopes/vocabulary.d.ts +16 -0
  495. package/dist/scopes/vocabulary.d.ts.map +1 -0
  496. package/dist/scopes/vocabulary.js +70 -0
  497. package/dist/scopes/vocabulary.js.map +1 -0
  498. package/dist/types/assertions.d.ts +95 -32
  499. package/dist/types/assertions.d.ts.map +1 -1
  500. package/dist/types/problems.d.ts +4 -5
  501. package/dist/types/problems.d.ts.map +1 -1
  502. package/dist/types/rules.d.ts +4 -6
  503. package/dist/types/rules.d.ts.map +1 -1
  504. package/examples/appendices/google.appendix.yaml +91 -0
  505. package/examples/appendices/inclusive-language.appendix.yaml +61 -0
  506. package/examples/appendices/microsoft.appendix.yaml +99 -0
  507. package/examples/appendices/plain-language.appendix.yaml +88 -0
  508. package/examples/google.yaml +1525 -0
  509. package/examples/inclusive-language.yaml +304 -0
  510. package/examples/microsoft.yaml +1542 -0
  511. package/examples/plain-language.yaml +325 -0
  512. package/package.json +49 -16
  513. package/presets/google/PROVENANCE.md +1022 -0
  514. package/presets/google/sources.json +192 -0
  515. package/presets/inclusive-language/PROVENANCE.md +174 -0
  516. package/presets/inclusive-language/sources.json +107 -0
  517. package/presets/microsoft/PROVENANCE.md +1555 -0
  518. package/presets/microsoft/sources.json +494 -0
  519. package/presets/plain-language/PROVENANCE.md +364 -0
  520. package/presets/plain-language/sources.json +108 -0
  521. package/dist/assertions/bullet-style.d.ts +0 -3
  522. package/dist/assertions/bullet-style.d.ts.map +0 -1
  523. package/dist/assertions/bullet-style.js +0 -60
  524. package/dist/assertions/bullet-style.js.map +0 -1
  525. package/dist/assertions/index.d.ts +0 -21
  526. package/dist/assertions/index.d.ts.map +0 -1
  527. package/dist/assertions/index.js +0 -30
  528. package/dist/assertions/index.js.map +0 -1
  529. package/dist/assertions/max-image-size.d.ts +0 -3
  530. package/dist/assertions/max-image-size.d.ts.map +0 -1
  531. package/dist/assertions/max-image-size.js +0 -73
  532. package/dist/assertions/max-image-size.js.map +0 -1
  533. package/dist/assertions/max-line-length.d.ts +0 -3
  534. package/dist/assertions/max-line-length.d.ts.map +0 -1
  535. package/dist/assertions/max-line-length.js +0 -68
  536. package/dist/assertions/max-line-length.js.map +0 -1
  537. package/dist/assertions/no-broken-fragment-links.d.ts +0 -3
  538. package/dist/assertions/no-broken-fragment-links.d.ts.map +0 -1
  539. package/dist/assertions/no-broken-fragment-links.js +0 -79
  540. package/dist/assertions/no-broken-fragment-links.js.map +0 -1
  541. package/dist/assertions/no-duplicate-headings.d.ts +0 -3
  542. package/dist/assertions/no-duplicate-headings.d.ts.map +0 -1
  543. package/dist/assertions/no-duplicate-headings.js +0 -66
  544. package/dist/assertions/no-duplicate-headings.js.map +0 -1
  545. package/dist/assertions/no-hard-tabs.d.ts +0 -3
  546. package/dist/assertions/no-hard-tabs.d.ts.map +0 -1
  547. package/dist/assertions/no-hard-tabs.js +0 -63
  548. package/dist/assertions/no-hard-tabs.js.map +0 -1
  549. package/dist/assertions/no-trailing-spaces.d.ts +0 -3
  550. package/dist/assertions/no-trailing-spaces.d.ts.map +0 -1
  551. package/dist/assertions/no-trailing-spaces.js +0 -72
  552. package/dist/assertions/no-trailing-spaces.js.map +0 -1
  553. package/dist/assertions/pattern.d.ts +0 -3
  554. package/dist/assertions/pattern.d.ts.map +0 -1
  555. package/dist/assertions/pattern.js +0 -39
  556. package/dist/assertions/pattern.js.map +0 -1
  557. package/dist/assertions/semantic-line-breaks.d.ts +0 -3
  558. package/dist/assertions/semantic-line-breaks.d.ts.map +0 -1
  559. package/dist/assertions/semantic-line-breaks.js +0 -152
  560. package/dist/assertions/semantic-line-breaks.js.map +0 -1
  561. package/dist/assertions/swap.d.ts +0 -3
  562. package/dist/assertions/swap.d.ts.map +0 -1
  563. package/dist/assertions/swap.js +0 -39
  564. package/dist/assertions/swap.js.map +0 -1
  565. package/dist/assertions/utils.d.ts +0 -8
  566. package/dist/assertions/utils.d.ts.map +0 -1
  567. package/dist/assertions/utils.js.map +0 -1
  568. package/dist/core/scope-parser.d.ts +0 -26
  569. package/dist/core/scope-parser.d.ts.map +0 -1
  570. package/dist/core/scope-parser.js +0 -110
  571. package/dist/core/scope-parser.js.map +0 -1
  572. package/dist/files.d.ts +0 -2
  573. package/dist/files.d.ts.map +0 -1
  574. package/dist/files.js +0 -39
  575. package/dist/files.js.map +0 -1
  576. package/dist/load-config.d.ts +0 -25
  577. package/dist/load-config.d.ts.map +0 -1
  578. package/dist/load-config.js +0 -104
  579. package/dist/load-config.js.map +0 -1
  580. package/dist/load.d.ts +0 -25
  581. package/dist/load.d.ts.map +0 -1
  582. package/dist/load.js +0 -112
  583. package/dist/load.js.map +0 -1
  584. package/dist/scope.d.ts +0 -26
  585. package/dist/scope.d.ts.map +0 -1
  586. package/dist/scope.js +0 -110
  587. package/dist/scope.js.map +0 -1
  588. package/dist/types.d.ts +0 -109
  589. package/dist/types.d.ts.map +0 -1
  590. package/dist/types.js.map +0 -1
  591. package/dist/validate.d.ts +0 -31
  592. package/dist/validate.d.ts.map +0 -1
  593. package/dist/validate.js +0 -154
  594. package/dist/validate.js.map +0 -1
  595. /package/dist/{types.js → parser/types.js} +0 -0
package/README.md CHANGED
@@ -1,12 +1,19 @@
1
- # Recheck - Content Linting Tool
1
+ # Recheck
2
2
 
3
- A modern, production-ready content linter for markdown files with configurable rules and built-in content quality checks.
3
+ Recheck combines a **markdown linter** (structure/format — full markdownlint rule parity: 53 built-in rules with auto-fix) and a **prose linter** (style/voice — Vale-style scopes like `sentence`/`paragraph`/`heading` with `swap`/`pattern`/`repetition`/`consistency`/`capitalization` rules) in **one tool with one simple YAML config** — replacing a markdownlint + Vale combo with one line:
4
+
5
+ ```yaml
6
+ extends: [recheck/markdown, recheck/prose]
7
+ ```
8
+
9
+ Recheck is also built to be **embedded by other tools**: it exposes a library-first API (`parseMarkdown`, `extractScopes`, `lintContent`, `lintFiles`, `runRules` — see [Library API](#library-api)) so tools like Redocly CLI's `lint` command can add markdown and prose linting too, including linting markdown strings embedded inside API descriptions.
4
10
 
5
11
  ## Features
6
12
 
7
13
  ✅ **Modern Scope-Based Architecture**
8
- - File-first processing with semantic scope parsing
9
- - Support for `sentence`, `paragraph`, `heading`, `code`, `default`, `raw`, and `all` scopes
14
+ - File-first processing: each file is parsed once into a [micromark](https://github.com/micromark/micromark) AST, then segmented into scopes
15
+ - Full scope vocabulary: `all`, `raw`, `summary` (alias: `default`), `sentence`, `paragraph`, `heading` (+ `heading.h1`-`h6`), `code`, `list-item`, `blockquote`, `table.header`, `table.cell`, `markdoc.tag`, `frontmatter`, `html`, `comment`, `alt`, `link`
16
+ - Selector syntax for precise targeting: `~` negates a term, `&` joins terms into a conjunction — e.g. `scope: ['~blockquote & ~heading']`
10
17
  - Vale-compatible scope notation (e.g., `heading.h1`, `heading.h2`)
11
18
  - Efficient rule indexing for fast processing at scale
12
19
 
@@ -43,6 +50,8 @@ pnpm install
43
50
  pnpm build
44
51
  ```
45
52
 
53
+ **Contributing to Recheck itself** (build-cache problems, `pnpm parity`'s required `--corpus` flag, the `generate-examples.mjs`/`oxfmt` coupling) is covered in [CONTRIBUTING.md](CONTRIBUTING.md), not here — this README is for people adopting Recheck as a linter.
54
+
46
55
  ## Usage
47
56
 
48
57
  ### Validate Configuration
@@ -70,6 +79,23 @@ node dist/cli.js run . --severity error
70
79
  # Show all enabled rules (info and above)
71
80
  node dist/cli.js run . --severity info
72
81
 
82
+ # Work one rule at a time. This helps you clear a large list of findings.
83
+ # Give the name that the report shows, or the full config key. Use the flag
84
+ # more than one time for more than one rule. A rule from a namespace other
85
+ # than `recheck/` keeps that namespace: use `google/passive-voice`.
86
+ node dist/cli.js run . --rule semantic-line-breaks
87
+ node dist/cli.js run . -r us-spelling -r recheck/oxford-comma
88
+
89
+ # ...and its inverse, to silence a rule you have already triaged
90
+ node dist/cli.js run . --exclude-rule semantic-line-breaks
91
+
92
+ # Use --rule with --fix to clear one rule's findings across all documents
93
+ node dist/cli.js run . --rule semantic-line-breaks --fix
94
+
95
+ # A name that matches no rule in your config is an error, not an empty run:
96
+ # a misspelled filter that reported "no issues" would look the same as a
97
+ # clean document set. The error message lists the rules your config loaded.
98
+
73
99
  # Output formats (table is default)
74
100
  node dist/cli.js run . --output table # Human-readable table (default)
75
101
  node dist/cli.js run . --output json # Structured JSON for CI
@@ -79,7 +105,9 @@ node dist/cli.js run . --output github-actions # GitHub Actions annotations (in
79
105
  # Show detailed statistics
80
106
  node dist/cli.js run . --stats
81
107
 
82
- # Auto-fix safe issues (trailing spaces, bullet style, hard tabs)
108
+ # Auto-fix safe issues (35 fixable rules total: swap + semantic-line-breaks
109
+ # natively, plus 33 of the 53 markdownlint-parity rules — see the rule table
110
+ # under "Markdownlint parity" below for the full per-rule breakdown)
83
111
  node dist/cli.js run . --fix
84
112
 
85
113
  # Combine auto-fix with statistics
@@ -103,6 +131,52 @@ node dist/cli.js run . --changed-only --changed-list changed.txt
103
131
  git diff --name-only origin/main... | node dist/cli.js run . --changed-only
104
132
  ```
105
133
 
134
+ ## Library API
135
+
136
+ The CLI is a thin wrapper around a public library API, published from `packages/recheck`'s `dist/index.js`. This is the intended integration point for embedding Recheck in another tool (a build step, an editor extension, or another CLI like Redocly CLI's `lint`) rather than shelling out:
137
+
138
+ ```ts
139
+ import { lintContent, lintFiles } from '@redocly/recheck';
140
+
141
+ // A config is a flat map of `recheck/<rule>` -> rule definition — the same
142
+ // shape a YAML config file resolves to once `extends` presets are expanded.
143
+ // Load from YAML (via `loadConfig`, which resolves `extends` for you) or
144
+ // build one programmatically, as here:
145
+ const config = {
146
+ 'recheck/no-hard-tabs': {
147
+ severity: 'error' as const,
148
+ message: 'Hard tabs',
149
+ assertions: { 'no-hard-tabs': {} },
150
+ },
151
+ };
152
+
153
+ // Lint an in-memory string — no file I/O. Useful for linting markdown that
154
+ // isn't on disk, e.g. a `description` field pulled out of an OpenAPI document.
155
+ const problems = await lintContent('# Title\n\nSome *text*.\n', config);
156
+
157
+ // Lint files from disk, optionally writing auto-fixes back:
158
+ const { problems: fileProblems, fixedFiles } = await lintFiles(['README.md'], config, {
159
+ fix: true,
160
+ });
161
+ ```
162
+
163
+ Key exports:
164
+
165
+ - **`parseMarkdown(content, options?)`** — parses a markdown string into a micromark-based token tree, once. Every other API in this list builds on this tree rather than re-parsing. `options.markdoc` is a boolean here: `true` also tokenizes `{% ... %}` Markdoc tag spans into `markdocTag` tokens, and `false` or omitted gives you the same tree as passing no options at all. The [object form](#markdoc-aware-linting-markdoc-true) (`{ schema, extend }`) is a config-file concept only — it resolves down to this boolean before any file is parsed, and `ParseOptions.markdoc` does not accept it.
166
+ - **`extractScopes(tree, content)`** — segments a parsed token tree into Vale-style scopes (`sentence`, `paragraph`, `heading`, `list-item`, `blockquote`, `table.cell`, etc.) for prose/style rules to run against.
167
+ - **`lintContent(content, config, opts?)`** — lints a single in-memory markdown string against a config; no disk access. Rules that need on-disk facts (e.g. `max-image-size`) require `opts.metadata` to be supplied by the caller.
168
+ - **`lintFiles(paths, config, opts?)`** — lints markdown files from disk; pass `{ fix: true }` to also write auto-fixes back, looping lint → fix → re-lint until the file converges.
169
+ Files that can't be read are skipped (with a console warning) and reported in the returned `skippedFiles` (`{ path, reason }[]`), so callers can detect incomplete coverage programmatically.
170
+ `opts.root` sets the lint root that image-metadata loading is confined to (default `process.cwd()`) — image refs resolving outside it are treated as missing without touching the disk.
171
+ `opts.maxProblems` caps the total problems collected: once a file's lint pushes the run to the cap, later files aren't linted at all and the returned `truncated` flag is set.
172
+ - **`runRules(files, rules)`** — the lower-level engine entry point for callers that already have a `NormalizedRule[]` (e.g. from `loadConfig`) and want to run against an explicit in-memory file list, bypassing `lintFiles`'s own config loading/validation. Under `{ fix: true }` its `RunResult` separates the fixes that genuinely landed (`fixes`) from proposals dropped by overlap resolution (`skippedFixes`).
173
+ - **`applyFixesToContent(content, fixes)`** — applies `Fix` edits to a string, preserving the file's own line endings (CRLF files stay CRLF). Returns `{ content, applied, skipped }`: every input fix is classified as genuinely applied or skipped (overlapping edits, out-of-range lines), so callers can report what actually changed rather than every proposal.
174
+ - **`computeTextStatistics(prose)`** — computes word/sentence/syllable/character/complex-word counts for a plain prose string (not markdown — extract prose from a scope first). Sentence counting reuses `splitSentences` internally, so it agrees with the rest of the engine on sentence boundaries. Tokenization is ASCII-only by design (accented or non-Latin letters don't count as word characters), so readability scores are meaningful for English prose.
175
+ - **`computeReadability(formula, stats)`** — scores a `TextStatistics` object with one of six standard readability formulas: `flesch-reading-ease`, `flesch-kincaid-grade`, `gunning-fog`, `smog`, `coleman-liau`, `automated-readability`. Returns `0` (rather than `NaN`/`Infinity`) when `stats.words` or `stats.sentences` is `0`.
176
+ - **`TECHNICAL_PROPER_NOUNS`** — the [built-in technical proper-noun vocabulary](#built-in-technical-proper-noun-vocabulary) `capitalization`/`spelling` consume by default; re-exported so you can read it or build your own tooling around the same list.
177
+
178
+ This is exactly the surface a host tool needs to add both markdown-structure linting and prose/style linting to content it already has in memory — for example, linting the markdown inside an OpenAPI `description` field without writing it to a temp file first.
179
+
106
180
  ## Configuration Format
107
181
 
108
182
  Configuration uses a modern `assertions`-based format with `severity` levels and flexible scope targeting:
@@ -149,20 +223,18 @@ recheck/config-line-length:
149
223
  appliesTo:
150
224
  - "docs/config/**" # Only apply to config documentation
151
225
  assertions:
152
- max-line-length:
153
- max: 100
154
- ignoreCodeBlocks: true
226
+ line-length:
227
+ lineLength: 100
228
+ codeBlocks: false
155
229
 
156
- recheck/bullet-style-dash:
230
+ recheck/ul-style-dash:
157
231
  severity: error
158
232
  message: "Use '-' for unordered list bullets."
159
- autoFixable: true # Safe for auto-fix
160
233
  excludes:
161
234
  - "**/examples/**" # Allow mixed styles in examples
162
235
  assertions:
163
- bullet-style:
164
- style: '-'
165
- normalizeNested: true
236
+ ul-style:
237
+ style: dash
166
238
  ```
167
239
 
168
240
  ## Exceptions
@@ -220,9 +292,52 @@ recheck/us-spelling:
220
292
  recheck/no-trailing-spaces:
221
293
  exceptions:
222
294
  files: ["**/generated/**", "CHANGELOG.md"]
223
- lines: ["```", "Code example:", "// prettier-ignore"]
295
+ lines: ["```", "Code example:", "// formatter-ignore"]
224
296
  ```
225
297
 
298
+ ## Inline Directives
299
+
300
+ Beyond config-level `exceptions`, individual Markdown files can silence rules
301
+ inline with HTML comments — the same mechanism ESLint/Vale users expect. A
302
+ directive names rules by their **short name** (`oxford-comma`) or **full
303
+ name** (`recheck/oxford-comma`) — both work. A directive is inert inside a
304
+ fenced code block (it has to be real, parsed HTML, not just matching text).
305
+
306
+ ```markdown
307
+ <!-- recheck-disable -->
308
+ Everything below this point is unchecked, for every rule.
309
+ <!-- recheck-enable -->
310
+ Checking resumes here.
311
+
312
+ <!-- recheck-disable oxford-comma us-spelling -->
313
+ Only these two rules are off from here on.
314
+ <!-- recheck-enable oxford-comma -->
315
+ us-spelling is still off; oxford-comma is back on.
316
+
317
+ <!-- recheck-disable-next-line oxford-comma -->
318
+ This one line is exempt from oxford-comma; the rest of the file isn't.
319
+
320
+ <!-- recheck-disable-file -->
321
+ Nothing in this file is linted at all, no matter where this comment sits.
322
+ ```
323
+
324
+ The five forms:
325
+
326
+ | Directive | Effect |
327
+ |---|---|
328
+ | `<!-- recheck-disable -->` | Disables **all** rules from this line to the end of the file, or until a matching `recheck-enable`. |
329
+ | `<!-- recheck-disable rule… -->` | Disables only the **listed** rules from this line on (same end conditions). |
330
+ | `<!-- recheck-enable -->` | Re-enables all rules (or, with rule names, only the listed ones) from this line on. |
331
+ | `<!-- recheck-disable-next-line -->` | Disables all rules (or, with rule names, only the listed ones) for exactly the next line. |
332
+ | `<!-- recheck-disable-file -->` | Disables every rule for the whole file, regardless of where the comment appears. |
333
+
334
+ Rule naming: list one or more rules space-separated, by short name
335
+ (`oxford-comma`) or full name (`recheck/oxford-comma`) — both work on every
336
+ form that accepts names; omitting names targets every rule. Naming a rule
337
+ that isn't configured produces a warning (`recheck-directive`, severity
338
+ `warn`) pointing at the directive's line — useful for catching a typo in
339
+ the disabled rule name — but disables nothing.
340
+
226
341
  ## Rule Types and Assertions
227
342
 
228
343
  ### Assertion Types
@@ -230,7 +345,10 @@ recheck/no-trailing-spaces:
230
345
  Rules are defined using `assertions` that specify their behavior:
231
346
 
232
347
  #### Swap Assertions (`swap`)
233
- Text replacement with configurable options:
348
+ Text replacement with configurable options.
349
+ **Fixable**: each match is replaced with its pair's value, with the matched text's own casing applied to the replacement -- an all-lowercase match inserts the replacement as configured, a Capitalized match capitalizes just the replacement's first word, and an ALL-CAPS match (2+ letters) uppercases the whole replacement; any other (mixed-case) casing is left as configured, since it carries no reliable intent to infer. This matters most with `ignoreCase: true`: without it, a sentence-initial `'Behaviour'` would be fixed to literal `'behavior'`, silently lowercasing the start of the sentence -- with it, it fixes to `'Behavior'`. (With `keysAreRegex: true`, casing is inferred from the MATCHED text, not the regex key, so this applies uniformly to regex keys too.)
350
+ When two pairs' matches overlap in the source (a compound key together with the shorter keys it contains), the longest match wins and is reported and fixed as one span.
351
+
234
352
  ```yaml
235
353
  assertions:
236
354
  swap:
@@ -241,6 +359,18 @@ assertions:
241
359
  behavior: behaviour
242
360
  ```
243
361
 
362
+ | Option | Type | Required | Description |
363
+ | --- | --- | --- | --- |
364
+ | `pairs` | `object` | Yes | Find → replace entries: each key is searched for in the segment's content and reported/fixed with its value. Keys must be non-empty strings; values must be strings. |
365
+ | `ignoreCase` | `boolean` | No | Matches keys case-insensitively. Default `false`. |
366
+ | `wordBoundary` | `boolean` | No | Wraps each key in `\b...\b` so only whole words match. Default `false`. |
367
+ | `keysAreRegex` | `boolean` | No | Keys are literal text by default; set `true` to treat each key as a regex (for example, `favou?rite` matches both spellings). An invalid regex key is ignored and matches nothing; the rule's other pairs still apply. Default `false`. |
368
+ | `includeCode` | `boolean` | No | Matches inside inline code spans (`` `like this` ``) are skipped by default, so a pair like `master: primary` doesn't fire inside `` `git checkout master` ``. Set `true` to scan inline code too. Default `false`. |
369
+
370
+ A missing or empty `pairs`, an empty-string key, a non-string replacement value, or an unknown option key under `swap` is a validation error.
371
+
372
+ The rule's `message` gets two positional `%s` substitutions, in this order: **1st = the replacement, 2nd = the matched text** — with the pair `utilize: use`, the message `'Use "%s" instead of "%s".'` renders as `'Use "use" instead of "utilize".'`
373
+
244
374
  #### Pattern Assertions (`pattern`)
245
375
  Regex-based pattern matching:
246
376
  ```yaml
@@ -251,33 +381,523 @@ assertions:
251
381
  - '^\\w*ing.*'
252
382
  ```
253
383
 
254
- #### Built-in Assertions
255
- Predefined content checks with typed options:
256
- - `max-line-length` - Line length enforcement
257
- - `no-trailing-spaces` - Trailing whitespace detection ✅ **Auto-fixable**
258
- - `bullet-style` - Unordered list bullet consistency ✅ **Auto-fixable**
259
- - `semantic-line-breaks` - Semantic line break validation
260
- - `no-hard-tabs` - Hard tab detection ✅ **Auto-fixable**
261
- - `no-duplicate-headings` - Duplicate heading detection
262
- - `no-broken-fragment-links` - Broken link fragment detection
384
+ | Option | Type | Required | Description |
385
+ | --- | --- | --- | --- |
386
+ | `tokens` | `string[]` | Yes | Regex patterns matched against each segment's content. An invalid regex is caught and silently produces zero problems rather than crashing the run. |
387
+ | `ignoreCase` | `boolean` | No | Matches every token case-insensitively. Default `false`. |
388
+ | `includeCode` | `boolean` | No | Matches inside inline code spans (`` `like this` ``) are skipped by default, so a token like `master` doesn't fire inside `` `git checkout master` ``. Set `true` to scan inline code too. Default `false`. |
389
+
390
+ #### Occurrence Assertions (`occurrence`)
391
+ Vale-parity `occurrence` check: counts regex matches within each scoped segment and flags the segment when the count falls outside `[min, max]`. `min: 1` with no `max` acts as an existence check — it flags a segment where the pattern is missing entirely.
392
+
393
+ ```yaml
394
+ assertions:
395
+ occurrence:
396
+ pattern: '[.!?]'
397
+ max: 3
398
+ ```
399
+
400
+ | Option | Type | Required | Description |
401
+ | --- | --- | --- | --- |
402
+ | `pattern` | `string` | Yes | Regex matched against each segment's content (whole segment, not per-line). |
403
+ | `min` | `number` | At least one of `min`/`max` | Minimum allowed match count; fewer matches is a violation. `min: 1` with no `max` reads as "the pattern must be present". |
404
+ | `max` | `number` | At least one of `min`/`max` | Maximum allowed match count; more matches is a violation. |
405
+ | `ignoreCase` | `boolean` | No | Matches `pattern` case-insensitively. Default `false`. |
406
+
407
+ Omitting both `min` and `max` is a validation error — an occurrence assertion with no bound can never report anything. An unknown option key under `occurrence` is likewise a validation error.
408
+
409
+ The rule's `message` gets two positional `%s` substitutions, in this order: **1st = the actual match count, 2nd = the bound that was violated** (`min` or `max`, whichever applied), e.g. `'Too many sentences (%s found, max %s).'` → `'Too many sentences (4 found, max 3).'`. Not fixable (detection-only): a count-based violation has no single match position to anchor an edit to.
410
+
411
+ #### Repetition Assertions (`repetition`)
412
+ Vale-parity `repetition` check: flags an adjacent repeated word — two tokens matching `pattern`, separated only by whitespace (which may include a single hard-wrap newline), so `'the theory'` is not flagged (different words) but `'the the'` and a hard-wrapped `'the\nthe rest'` are. **Fixable**: collapses the pair back to one occurrence, keeping the FIRST token's casing/text (so `'The the'` fixes to `'The'`, not `'the'`).
413
+
414
+ ```yaml
415
+ assertions:
416
+ repetition:
417
+ ignoreCase: true # default
418
+ ```
419
+
420
+ | Option | Type | Required | Description |
421
+ | --- | --- | --- | --- |
422
+ | `pattern` | `string` | No | Regex used to tokenize each segment's content. Default `\w+`. |
423
+ | `ignoreCase` | `boolean` | No | Compares adjacent tokens case-insensitively. Default **`true`** — unlike every other assertion's case-sensitive default, since `'The the'` is the overwhelmingly common typo this check exists to catch. Set `false` to require an exact-case repeat. |
424
+
425
+ An unknown option key under `repetition` is a validation error, as is a non-string `pattern` or a non-boolean `ignoreCase`; both options are optional, so an empty `repetition: {}` is valid.
426
+
427
+ The rule's `message` gets one positional `%s` substitution: the repeated word itself, e.g. `'Repeated word "%s".'` → `'Repeated word "the".'`. Fix idempotency holds under repeated `--fix` passes: `'the the the'` converges to `'the'`.
428
+
429
+ #### Consistency Assertions (`consistency`)
430
+ Vale-parity `consistency` check: each `either` entry declares one alternative group — the key and the value are the two variants (both matched as literals with word boundaries, like `swap` keys). Whichever variant appears **first in the file (by source order)** wins file-wide; every later occurrence of the other variant is flagged. **Fixable**: each later occurrence is replaced with the winning variant **literally as written in `either`** — unlike `swap`, the losing match's own casing is not preserved here (with `ignoreCase: true`, a later `'Behaviour'` in a `behavior`-first document fixes to `'behavior'`).
431
+
432
+ ```yaml
433
+ assertions:
434
+ consistency:
435
+ either:
436
+ behavior: behaviour
437
+ color: colour
438
+ ```
439
+
440
+ | Option | Type | Required | Description |
441
+ | --- | --- | --- | --- |
442
+ | `either` | `object` | Yes | Map of variant pairs; key and value are the two alternatives of one group. Each pair gets its own independent first-seen winner. Must be non-empty. |
443
+ | `ignoreCase` | `boolean` | No | Matches variants case-insensitively (so `'Behaviour'` counts as an occurrence of `behaviour`). Default `false`. |
444
+
445
+ Omitting `either`, leaving it empty, or giving it non-string or empty-string keys or values is a validation error — a consistency assertion with no variant pairs can never report anything, and an empty-string key would otherwise reach the scan loop as a zero-width regex that never terminates. An unknown option key under `consistency` is likewise a validation error.
446
+
447
+ Matches from overlapping scopes (e.g. `scope: [paragraph, sentence]`, where every sentence segment sits inside its paragraph segment) are deduplicated by source position before the winner is decided, so each occurrence is counted — and fixed — exactly once.
448
+
449
+ The rule's `message` gets two positional `%s` substitutions, in this order: **1st = the offending (later) match, 2nd = the first-seen winner**, e.g. `'Inconsistent spelling: "%s" conflicts with first-seen "%s".'` → `'Inconsistent spelling: "behaviour" conflicts with first-seen "behavior".'`.
450
+
451
+ #### Conditional Assertions (`conditional`)
452
+ Vale-parity `conditional` check: if `first` (a regex pattern) matches anywhere within the rule's scoped segments, `second` (a regex pattern) must exist **somewhere in the whole file** — checked against the full raw file content, not just the rule's own scope, so a `second` match sitting inside a code block still satisfies a rule scoped to `paragraph`. When `second` is absent file-wide, every `first` match becomes its own problem, at its exact source position. **Detection-only** (not fixable) — there is no single well-defined edit that would "introduce" `second`.
453
+
454
+ ```yaml
455
+ assertions:
456
+ conditional:
457
+ first: '\bTODO\b'
458
+ second: '\bDONE\b'
459
+ ```
460
+
461
+ | Option | Type | Required | Description |
462
+ | --- | --- | --- | --- |
463
+ | `first` | `string` | Yes | Regex; if it matches anywhere in the rule's scoped segments, `second` is required. Non-empty. |
464
+ | `second` | `string` | Yes | Regex; must match somewhere in the whole file content once `first` has matched. Non-empty. |
465
+ | `ignoreCase` | `boolean` | No | Matches both `first` and `second` case-insensitively. Default `false`. |
466
+
467
+ Unlike `swap`/`consistency`'s escaped-literal variants, `first` and `second` are raw user regex patterns (like `pattern`'s `tokens`). Missing, empty, or non-string `first`/`second` is a validation error, as is an unknown option key or a non-boolean `ignoreCase` — but `first`/`second` are **not** validated as compilable regexes at config-load time; an invalid regex in either one silently produces zero problems at runtime instead (same convention as `pattern`).
468
+
469
+ Matches from overlapping scopes (e.g. `scope: [paragraph, sentence]`) are deduplicated by source position, so each occurrence of `first` is reported exactly once.
470
+
471
+ The rule's `message` gets two positional `%s` substitutions, in this order: **1st = the offending `first` match, 2nd = the `second` pattern that was never introduced**, e.g. `'"%s" appears but "%s" was never introduced.'` → `'"TODO" appears but "DONE" was never introduced.'`.
472
+
473
+ #### Capitalization Assertions (`capitalization`)
474
+ Vale-parity `capitalization` check: flags (and — for four of its `match` values — fixes) a scoped segment whose text doesn't already match the required casing. `match` is one of `$title`, `$sentence`, `$lower`, `$upper`, or else a **custom regex** the whole segment text must satisfy.
475
+
476
+ ```yaml
477
+ assertions:
478
+ capitalization:
479
+ match: $title
480
+ style: chicago # optional, default 'ap' — only affects $title
481
+ exceptions: [GitHub, iPhone]
482
+ ```
483
+
484
+ | Option | Type | Required | Description |
485
+ | --- | --- | --- | --- |
486
+ | `match` | `string` | Yes | `$title`, `$sentence`, `$lower`, `$upper`, or a regex the whole segment text must satisfy. Non-empty. |
487
+ | `style` | `'ap' \| 'chicago'` | No | Stopword list `$title` uses (see below). Default `'ap'`. Accepted alongside any `match`, but only has an effect on `$title` — a documented no-op elsewhere, not a validation error. |
488
+ | `exceptions` | `string[]` | No | Words (or phrases — see below) kept in their EXACT as-written casing from this list, everywhere they appear — including the first/last word — overriding every other rule. Unioned with the [built-in technical proper-noun vocabulary](#built-in-technical-proper-noun-vocabulary) unless `builtinVocabulary: false`. |
489
+ | `builtinVocabulary` | `boolean` | No | Default `true`. Whether [`TECHNICAL_PROPER_NOUNS`](#built-in-technical-proper-noun-vocabulary) is unioned into `exceptions`. Set `false` for a closed vocabulary of only this rule's own `exceptions`. |
490
+
491
+ An `exceptions` entry containing whitespace or a dot (e.g. `Node.js`, `VS Code`) is matched as a whole PHRASE against the segment text — case-insensitively but otherwise literally, longest-match-first when phrases overlap — and preserved verbatim, instead of being looked up per word.
492
+
493
+ Unknown option keys, a missing/empty `match`, an invalid `style`, a non-string-array `exceptions`, or a non-boolean `builtinVocabulary` are all validation errors.
494
+
495
+ **`$title`** — AP or Chicago title case, implemented in `rules/scope/title-case.ts`'s `apTitleCase`/`chicagoTitleCase`:
496
+ - The first and last word are **always** capitalized, regardless of any stopword list.
497
+ - A hyphenated compound (e.g. `well-known`) runs **each hyphen part** through the same stopword test a standalone word gets for the active style — `well-known` → `Well-Known`, but `editor-in-chief` → `Editor-in-Chief` (`in` is a stopword in both styles). The compound's first part always capitalizes when the compound opens the title, and its last part always capitalizes when the compound closes the title — e.g. `the new state-of-the-art` → `The New State-of-the-Art` (changed from the original simplification by product decision during execution, 2026-07-27).
498
+ - A word already in ALL-CAPS (2+ letters, e.g. an acronym like `API`) is left exactly as written.
499
+ - **AP** (default) lowercases articles (`a`, `an`, `the`), coordinating conjunctions (`and`, `but`, `or`, `nor`, `for`, `so`, `yet`), and prepositions of **3 letters or fewer** (`at`, `by`, `in`, `of`, `off`, `on`, `out`, `to`, `up`, `via`).
500
+ - **Chicago** lowercases the same articles/conjunctions, plus **every** preposition regardless of length (the short ones above, plus `about`, `above`, `across`, `after`, `against`, `along`, `among`, `around`, `before`, `behind`, `below`, `between`, `during`, `through`, `toward`, `under`, `until`, `with`, `within`, `without`) — e.g. Chicago lowercases `'...walking through the park'` → `'...walking through the Park'`, where AP capitalizes `Through`.
501
+
502
+ **`$sentence`** — only the first word is capitalized; every other word is lowercased unless it's an `exceptions` entry (as-written) or already ALL-CAPS (left alone).
503
+
504
+ **Word position counts a phrase exception as one word.** A *phrase* exception (one containing whitespace or a dot, like `Node.js` or `VS Code` — see the phrase-matching note above) is a single atomic token in the word sequence the `$`-styles case: it's emitted in its exact as-written form, and it **occupies a position**, so it never changes which word counts as first or last. With `exceptions: [VS Code]`, the already-correctly-cased heading `## VS Code actions for teams` produces no finding under `$sentence` (`actions` is the second word, not the first), and `## a guide to Node.js` becomes `## A Guide to Node.js` under `$title`/AP (`Node.js` is the last word, so `to` is a mid-title stopword and stays lowercase). Single-word exceptions (e.g. `GitHub`) behave as they always have — resolved by lookup rather than position.
505
+
506
+ This used to be a bug, tracked as [Redocly/redocly#25610](https://github.com/Redocly/redocly/issues/25610) and fixed since: phrase exceptions were previously *masked out* of the text before word position was computed, which made a leading phrase promote the next word to sentence-initial under `$sentence` (`## VS Code actions for teams` was flagged, and under `fix: true` rewritten to `## VS Code Actions for teams`) and made a trailing phrase promote the preceding word to last-word position under `$title` (`a guide to Node.js` → `A Guide To Node.js`). If you had worked around it by rephrasing headings or by swapping in a custom regex `match`, neither is needed any more. See `rules/scope/title-case.ts`'s `recaseWords` for the tokenization that replaced the masking.
507
+
508
+ **`$lower`** / **`$upper`** — the whole segment must be all-lowercase / all-uppercase respectively; no exceptions/ALL-CAPS carve-out (unconditional, matching Vale's own `$lower`/`$upper`).
509
+
510
+ **Custom regex** — the whole segment text must satisfy the pattern. **Detection-only**: unlike the four `$`-styles, a failing regex is flagged but never auto-fixed, even though the rule itself is registered fixable. Like `pattern`'s `tokens`, an invalid regex is caught and silently produces zero problems rather than crashing the run.
511
+
512
+ **Inline code is frozen.** A backtick-delimited span in the segment text (e.g. a heading like `'the `configFile` option'`) is treated like an exception: its content is never flagged or rewritten by any of the four `$`-styles, even if it would otherwise land on the first/last word.
513
+
514
+ **Fixable** for `$title`/`$sentence`/`$lower`/`$upper` only, one segment-wide edit per flagged segment. A **multi-line** segment (e.g. a soft-wrapped paragraph) is skipped entirely under these four styles — neither a problem nor a fix — since a `Fix` can only rewrite a single line; a custom regex `match` has no such restriction and still checks (and reports) multi-line segments, since it never produces a fix regardless of segment span.
515
+
516
+ The rule's `message` gets two positional `%s` substitutions, in this order: **1st = the segment's own text (first line only), 2nd = the `match` value itself** (e.g. `'$title'`, or the literal regex source for custom-regex mode), e.g. `'"%s" should use %s capitalization.'` → `'"the great escape" should use $title capitalization.'`.
517
+
518
+ #### Metric Assertions (`metric`)
519
+ Scores the document's prose with one of six published readability formulas and flags the file once when the score falls outside `[min, max]`.
520
+
521
+ ```yaml
522
+ assertions:
523
+ metric:
524
+ formula: flesch-reading-ease
525
+ min: 30
526
+ ```
527
+
528
+ | Option | Type | Required | Description |
529
+ | --- | --- | --- | --- |
530
+ | `formula` | `string` | Yes | One of `flesch-reading-ease`, `flesch-kincaid-grade`, `gunning-fog`, `smog`, `coleman-liau`, `automated-readability`. |
531
+ | `min` | `number` | At least one of `min`/`max` | Minimum acceptable score; a lower score is a violation. |
532
+ | `max` | `number` | At least one of `min`/`max` | Maximum acceptable score; a higher score is a violation. |
533
+
534
+ Omitting both `min` and `max`, an unrecognized `formula`, or an unknown option key are all validation errors — a metric assertion with no bound can never report anything, and an unrecognized formula would otherwise reach the scoring engine's own exhaustive-switch failure at lint time instead of at config validation.
535
+
536
+ **Always summary-scoped.** Unlike every other assertion above, `metric` does not honor a configurable `scope:` — readability is a property of the WHOLE document's prose, not something a selector could sensibly narrow (a readability score isn't meaningful for one paragraph in isolation the way an `occurrence` count is). Config validation forces every `metric` rule to `scope: summary` — the canonical all-prose scope: `paragraph`, `heading` (all levels), `list-item`, `blockquote`, `table.cell`, and `table.header` text (`code`, `frontmatter`, `html`, `comment`, `alt`, and `link` content is never counted). Omit `scope` on a `metric` rule (or write `scope: summary` explicitly); configuring any other scope prints a warning (`metric is always summary-scoped; ignoring configured scope ...`) and applies `summary` behavior anyway. Text from overlapping segments (e.g. a list nested inside a blockquote) is deduplicated by source position, same as `consistency`/`conditional` above.
537
+
538
+ **Non-prose stripping.** Before scoring, each segment's text also has Markdoc tag-marker spans (`{% tag attr="x" %}`, `{% /tag %}`, and the `{%- ... -%}` trim variant) and backtick-delimited inline code spans stripped out — neither is readable prose, and both otherwise skew word/syllable counts. Prose between two block-tag markers still counts (only the marker spans themselves are removed); a paragraph consisting only of tag markers contributes nothing. Multi-backtick delimiters (`` ``like this`` ``) are handled conservatively as a simple open-run/close-run pair match, not a full CommonMark-correct implementation.
539
+
540
+ **Detection-only** (not fixable) — there is no single edit that would "fix" a readability score. Reports at most **one** problem per file, always at `line: 1, column: 1` (there is no single source position a whole-document score belongs to) — never divided by zero: a file with no prose at all (empty, or only code/frontmatter) is never flagged, regardless of `min`/`max`.
541
+
542
+ The rule's `message` is substituted against up to **four** values, in this order: **1st = the formula name, 2nd = the computed score, 3rd = `min` (or `-∞` if unset), 4th = `max` (or `∞` if unset)** — e.g. the internal fallback `'Readability (%s) is %s; expected between %s and %s.'` → `'Readability (flesch-reading-ease) is 42.1; expected between 60 and ∞.'`. The `message` validation cap is per-assertion: a `metric` rule's `message` may use up to **4** `%s` placeholders (one per value above), while every other assertion stays capped at 2. Fewer placeholders than values is fine — substitution is positional, so a 2-slot message receives the leading values (formula name, then score).
543
+
544
+ <!-- recheck-disable-next-line no-gerund-headings -->
545
+ #### Spelling Assertions (`spelling`)
546
+ Vale-parity `spelling` check (detection-only): tokenizes each scoped segment's text into words and flags any word an [nspell](https://github.com/wooorm/nspell)/Hunspell speller doesn't recognize, with up to three suggested corrections.
547
+
548
+ ```yaml
549
+ assertions:
550
+ spelling:
551
+ vocab: [Redocly, Reunite]
552
+ ignore: ['\bAcme\w*']
553
+ ```
554
+
555
+ | Option | Type | Required | Description |
556
+ | --- | --- | --- | --- |
557
+ | `dictionary` | `string` | No | Base path (WITHOUT the `.aff`/`.dic` extension) to a custom Hunspell dictionary pair, e.g. `dictionary: dict/custom` reads `dict/custom.aff` and `dict/custom.dic`. Resolved relative to `process.cwd()` (where the CLI is invoked from) unless absolute. Omit to use the bundled default English dictionary. |
558
+ | `vocab` | `string[]` | No | Extra known-good words, matched case-insensitively; never flagged even when the speller itself doesn't recognize them (product names, jargon, etc.). Unioned with the [built-in technical proper-noun vocabulary](#built-in-technical-proper-noun-vocabulary) unless `builtinVocabulary: false`. |
559
+ | `ignore` | `string[]` | No | Regex patterns; a token matching ANY of them is never flagged, e.g. `['\bAcme\w*']` to allow every inflection of a brand name. An invalid pattern is silently ignored, same convention as `pattern`'s `tokens`. |
560
+ | `builtinVocabulary` | `boolean` | No | Default `true`. Whether [`TECHNICAL_PROPER_NOUNS`](#built-in-technical-proper-noun-vocabulary) is unioned into the accepted-word set alongside `vocab`. A multi-token entry (`Node.js`, `VS Code`) is split into its individual words, each accepted separately — correct for a per-word spell check, unlike `capitalization`'s whole-phrase matching. Set `false` for a closed vocabulary of only this rule's own `vocab`. |
561
+
562
+ All options are optional — an empty `spelling: {}` is valid (default dictionary, no extra vocabulary, no ignore patterns, built-in vocabulary on). Unknown option keys, a non-string/empty-string `dictionary`, a `vocab`/`ignore` entry that isn't a non-empty string, or a non-boolean `builtinVocabulary` are all validation errors.
563
+
564
+ **Optional peer dependencies — install to enable.** `nspell` and its default dictionary (`dictionary-en`) are **optional peer dependencies**: installing `@redocly/recheck` itself pulls in **neither**. Enable `spelling` with:
565
+
566
+ ```bash
567
+ npm i nspell dictionary-en
568
+ ```
569
+
570
+ ...or, if every `spelling` rule in your config sets its own `dictionary` path, you only need the speller itself (the bundled dictionary is never touched):
571
+
572
+ ```bash
573
+ npm i nspell
574
+ ```
575
+
576
+ If a config enables `spelling` without the required peer(s) installed, `recheck validate` fails with an actionable error naming the exact command above — never a bare `Cannot find module 'nspell'` surfacing for the first time at lint time.
577
+
578
+ **Dictionaries load lazily.** Neither `nspell` nor `dictionary-en` is imported unless some rule in your config actually has a `spelling` assertion — a config without one never touches either package, at either `validate` or lint time. The loaded speller (including the ~500KB parsed dictionary) is cached per dictionary source for the process's lifetime, so every file/rule sharing the same `dictionary` (or the shared default) reuses one instance rather than reloading it per call.
579
+
580
+ **Word tokenization.** Words are matched with `/\p{L}+(?:['’]\p{L}+)?/gu` — Unicode letter runs, with an optional apostrophe-joined suffix so contractions (`don't`, `it's`) tokenize as one word. A token is skipped (never checked) when it's in `vocab` (case-insensitively), matches any `ignore` pattern, is ALL-CAPS (2+ letters, e.g. an acronym) — matching the same ALL-CAPS carve-out `$title`/`$sentence` capitalization use — or is digit-adjacent (see below). Because `\p{L}` can never match a digit, a token touching one is never captured WHOLE by the tokenizer in the first place: a digit-adjacent identifier like `config2` still splits into a letter-only fragment (`config`) as its own regex match. Rather than checking that fragment like any other word, a digit-adjacency guard looks at the character immediately before and after each match and skips it when either neighbor is a digit — so common digit-bearing identifiers (`sha256` → `sha`, `utf8` → `utf`, `oauth2` → `oauth`, `es6` → `es`, `log4j` → both `log` and `j`, `2fast` → `fast`) are no longer flagged as false-positive misspellings. This mitigates, but doesn't eliminate, every false positive from the tokenizer's inability to capture digits at all — a token entirely surrounded by non-digit characters is still checked normally, so a genuine misspelling elsewhere in the same sentence is still flagged.
581
+
582
+ **Code is never spell-checked, by construction of scope segmentation — not something this assertion special-cases.** A fenced or indented code block is its own `scope: 'code'` segment, entirely distinct from `paragraph`/`heading`/etc.; scoping `spelling` to prose (the common case, e.g. `scope: paragraph` or an array of prose scopes) means `ctx.segments` never contains one. A backtick-delimited **inline** code span, though, remains embedded as raw text inside a prose segment's own content (verified directly against the extractor) — those spans are masked out before tokenizing, the same length-preserving technique `capitalization`'s backtick-span freezing uses, so positions of any remaining flagged word stay exact. Scoping `spelling` to `all`/`raw` (or leaving `scope` at its default) checks the whole raw file, literal code included — same default-scope behavior every other native assertion (`swap`, `pattern`, ...) has.
583
+
584
+ **Detection-only** — no `fix`. The rule's `message` gets two positional `%s` substitutions, in this order: **1st = the unrecognized word, 2nd = a suggestion suffix** — either `''` (zero suggestions) or `' — did you mean: a, b, c?'` (one to three, comma-joined) — e.g. the internal fallback `'Unknown word "%s"%s'` → `'Unknown word "wrold" — did you mean: wold, world?'`.
585
+
586
+ #### Built-in technical proper-noun vocabulary
587
+
588
+ `capitalization` and `spelling` both ship a built-in list of common technical/product proper nouns — `TECHNICAL_PROPER_NOUNS`, exported from `@redocly/recheck`'s public API (`import { TECHNICAL_PROPER_NOUNS } from '@redocly/recheck'`) so you can read or extend it yourself. It exists so a config that turns on sentence-case headings or spelling doesn't immediately need to hand-list the same 15+ mixed-case technology names every project already has to deal with (`OpenAPI`, `npm`, `Node.js`, `VS Code`, ...).
589
+
590
+ **On by default**, per rule:
591
+ - `capitalization` unions it into `exceptions` (so a listed name keeps its as-written casing under every `$`-style, including `$sentence`).
592
+ - `spelling` unions it into `vocab` (so those words are never reported as misspellings), splitting any multi-token entry into its individual words first — a per-word spell check has no way to accept a whole phrase atomically the way `capitalization`'s phrase matching does.
593
+ - Either union is opted out of independently with that rule's own `builtinVocabulary: false`, restoring strict pre-built-in behavior (a closed vocabulary of only what you list yourself).
594
+ - Your own `exceptions`/`vocab` on the same rule **compose** with the built-ins rather than replacing them — unlike a preset-shipped list on the same rule key, which a same-key override *would* replace entirely (see [`extends` presets](#extends-presets) above). This is exactly how [`recheck/prose`](#extends-presets)'s `capitalization` rule gets its protection for common technical nouns without shipping any `exceptions` of its own.
595
+
596
+ **Multi-token entries work.** An entry containing a dot or whitespace (`Node.js`, `VS Code`, `Visual Studio Code`, `GitHub Actions`, `Google Cloud`, `Azure DevOps`) is matched by `capitalization` as a whole phrase against the segment text (longest-match-first, case-insensitive but otherwise literal) and preserved verbatim — not looked up per word, which is what a single-token entry like `GitHub` still gets.
597
+
598
+ **Inclusion bar** (why an entry is — or isn't — in the list, and the bar to clear before proposing one): an entry qualifies if it's an unambiguous technology, product, or company name whose exception listing wouldn't *weaken* capitalization/spelling checks — concretely, its lowercase form must not be a legitimate English word in its own right. That covers ordinary Title-Case brand names (`Android`, `Kubernetes`, `Redocly`) just as much as entries with an internal capital (`OpenAPI`, `GraphQL`), a dot (`Node.js`), or forced lowercase (`npm`) — `$sentence` lowercases every non-first word regardless of how "ordinary" its casing looks, so plain Title-Case names need protection too. Excluded, deliberately:
599
+ - **Pure ALL-CAPS acronyms** (`JWT`, `YAML`) — already handled structurally by the ALL-CAPS carve-out both `capitalization` and `spelling` apply, so listing them adds maintenance for no behavior change. Note this is narrower than "looks like an acronym": `OAuth` and `AsyncAPI` are mixed-case, not pure ALL-CAPS, and are in the list.
600
+ - **Terms with legitimate lowercase prose usage** — generic English (`cloud`, `apps`), words that are ALSO ordinary English words even though they're Redocly product names too (`Realm`, `Replay`, `Respect` — listing them would force-capitalize ordinary usage like "we respect your privacy"; `Node` — the common technical noun, superseded by the `Node.js` phrase entry for the platform specifically), and — caught by a later audit, not the original pass — ordinary brand-shaped words with a real dictionary meaning (`Chrome`, `Markdown`, `Postman`, `Prettier`, `Safari`, `Swagger`, `Windows`; see `src/data/proper-nouns.ts`'s header for each one's disqualifying lowercase usage). A few real dictionary words (`Android`, `Docker`, `TypeScript`) were judged rare enough in ordinary lowercase usage to keep anyway — a documented, deliberate risk-acceptance, not an oversight. List your own such names in your rule's own `exceptions`/`vocab`, which compose with this list as described above.
601
+
602
+ Two automated tests in `src/data/__tests__/proper-nouns.test.ts` enforce this: one checks every entry's shape against the bar above — no pure ALL-CAPS, and, mechanically, no single-token entry whose lowercase form the REAL spelling dictionary (`dictionary-en`/`nspell`, the same pair `spelling` loads at runtime) accepts as a legitimate English word, unless it's named in an explicit accepted-risk allowlist — plus alphabetization and no duplicates. A round-trip guard separately drives every entry through the real `capitalization` and `spelling` rules and fails the suite if any entry can't actually be protected — the list can't silently regress into decoration.
603
+
604
+ #### Length Assertions (`length`)
605
+ Recheck-original, detection-only check: measures each scoped segment's size — in characters, words, or sentences — and flags a segment whose measurement falls outside `[min, max]`. Unlike `metric` (always whole-document), `length` honors whatever `scope` the rule configures — e.g. `scope: alt` to cap image alt text, or `scope: sentence` to cap sentence length in words. [`recheck/google`](#extends-presets) ships this for the guide's stated "fewer than 26 words per sentence" limit (`google/sentence-length`); Microsoft's 150-character alt-text cap is the other published example of this shape.
606
+
607
+ ```yaml
608
+ assertions:
609
+ length:
610
+ unit: characters
611
+ max: 150
612
+ ```
613
+
614
+ | Option | Type | Required | Description |
615
+ | --- | --- | --- | --- |
616
+ | `unit` | `'characters' \| 'words' \| 'sentences'` | Yes | What `min`/`max` count: raw character length, whitespace-delimited words (the same tokenizer `metric` uses for its own word counts — see `metrics/statistics.ts`'s `tokenizeWords`), or sentences via the shared `splitSentences` sentence-boundary logic (`scopes/sentences.ts`). |
617
+ | `min` | `number` | At least one of `min`/`max` | Minimum allowed size; a smaller segment is a violation. |
618
+ | `max` | `number` | At least one of `min`/`max` | Maximum allowed size; a larger segment is a violation. |
619
+
620
+ Omitting both `min` and `max`, a missing/unrecognized `unit`, or an unknown option key are all validation errors — same reasoning as `occurrence`/`metric` above. An inverted range (`min` > `max`) is also an error.
621
+
622
+ **Detection-only** (not fixable) — there is no single edit that would resize a segment to fit. Reports at most one problem per flagged segment, at the segment's own `startLine`/`startColumn`.
623
+
624
+ The rule's `message` gets three positional `%s` substitutions, in this order: **1st = the segment's measured size, 2nd = the unit name, 3rd = the bound that was violated** (`min` or `max`, whichever applied), e.g. the internal fallback `'Segment is %s %s; at most %s allowed'` → `'Segment is 151 characters; at most 150 allowed'`. The message validation cap for `length` is **3** placeholders (one per value above), same reasoning as `metric`'s 4-cap.
625
+
626
+ #### Built-in Prose Assertions
627
+ Beyond `swap`, `pattern`, `occurrence`, `repetition`, `consistency`, `conditional`, `capitalization`, `metric`, `spelling`, and `length` above, Recheck ships a small set of native prose/format checks:
628
+ - `semantic-line-breaks` - Semantic line break validation ✅ **Fixable**
629
+ - `max-image-size` - Oversized image detection
630
+
631
+ Three of the assertions above (`repetition`, `consistency`, `capitalization`) are bundled, pre-configured, in the [`recheck/prose`](#extends-presets) preset, and `capitalization`/`length` are also used by [`recheck/google`](#extends-presets) (sentence-case headings and list items, and a sentence-length cap); the remaining four (`occurrence`, `conditional`, `metric`, `spelling`) are documented [opt-ins](#opt-in-prose-assertions) with copy-paste snippets, not shipped in any preset by default.
632
+
633
+ ### Recheck-original structural rules
634
+
635
+ Seven rules have no markdownlint counterpart, so they sit outside the 53-rule parity set
636
+ (and outside the parity comparison). All seven are **detection-only** (`fix: false`). The
637
+ canonical list is `RECHECK_ORIGINAL_TOKEN_RULE_NAMES` in `src/rules/token/index.ts`.
638
+
639
+ The table below covers five of them. The other two — `markdoc-unknown-tag` and
640
+ `markdoc-attributes` — need a tag schema to check anything, so they are documented with
641
+ the [`recheck/markdoc`](#extends-presets) preset instead.
642
+
643
+ | Rule | Flags | Why |
644
+ |---|---|---|
645
+ | `no-empty-headings` | A heading whose text content is empty (`# `, or markup that renders to nothing such as `## <span></span>`) | An empty heading still lands in the document outline and in screen-reader heading navigation. Inline code counts as content, so `` # `config.yaml` `` is fine. |
646
+ | `no-duplicate-link-destinations` | The second and later links to one destination when the link **text** differs from the first occurrence's | Screen-reader users listing a page's links hear one target described inconsistently; the texts also drift apart over time. Repeating the *same* text for the same destination is ordinary prose and is not flagged. Resolves reference links through their definition. |
647
+ | `list-length` | A list (ordered or unordered) with fewer than `min` items (default 2) or more than `max` items (no default — unbounded unless set) | A single-item list usually reads better as a plain sentence, and a very long list asks readers to hold too many parallel items in mind. Every list is evaluated independently, including nested sublists — a short sublist is flagged even when its parent list is long enough. |
648
+ | `markdoc-syntax` | A grammar-level Markdoc tag error — a malformed span, an unquoted "bareword" attribute/primary value, or a close tag carrying attributes | These are invalid under real Markdoc's own grammar regardless of any tag schema, so the rule fires on custom/unknown tags and under `schema: false` alike. See the [`recheck/markdoc`](#extends-presets) preset bullet below for the full behavior and a config example. |
649
+ | `markdoc-pairing` | An unclosed, orphaned, or interleaved (crossed) Markdoc tag pair, or a schema-declared self-closing tag written with a close it must not have | Same grammar-level scope as `markdoc-syntax` — see the [`recheck/markdoc`](#extends-presets) preset bullet below. |
650
+
651
+ The first three rules are **opt-in — not shipped in any preset**; configure them
652
+ individually as shown below.
653
+
654
+ `markdoc-syntax` and `markdoc-pairing` work the other way around: they ship only inside
655
+ the [`recheck/markdoc`](#extends-presets) preset, and both need `markdoc: true` (or the
656
+ object form) to ever see a Markdoc tag token. Naming either rule key on its own, without
657
+ the flag, validates but can never report anything — and you get no warning about it,
658
+ because the stale-config warning fires on `extends` containing `"recheck/markdoc"`
659
+ (`warnStaleMarkdocPreset` in `config/validate.ts`), not on individual rule keys. The
660
+ preset bullet below covers both rules' full behavior with the flag on, plus a config
661
+ example.
662
+
663
+ ```yaml
664
+ recheck/empty-headings:
665
+ severity: error
666
+ message: 'Headings should have text content.'
667
+ assertions:
668
+ no-empty-headings: {}
669
+
670
+ recheck/link-text-consistency:
671
+ severity: warn
672
+ message: 'Link destination "%s" is already linked by different text.'
673
+ assertions:
674
+ no-duplicate-link-destinations: {}
675
+
676
+ recheck/list-length:
677
+ severity: warn
678
+ message: 'List has %s item(s).'
679
+ assertions:
680
+ list-length: { min: 2, max: 10 }
681
+ ```
682
+
683
+ For markdown structure/format rules (headings, lists, links, tables, whitespace, and 49 more), see [Markdownlint parity](#markdownlint-parity) below — `no-trailing-spaces`, `no-hard-tabs`, `line-length`, `ul-style` (bullet style), `no-duplicate-heading`, and `link-fragments` are all part of that 53-rule set, not this native list. (`max-line-length`, `bullet-style`, `no-duplicate-headings`, and `no-broken-fragment-links` were pre-parity native ids for those same rules; they were removed rather than kept as aliases — see [Migrating from markdownlint](#migrating-from-markdownlint).)
263
684
 
264
685
  ### Enhanced Scope Support
265
686
 
266
- The `scope` field supports arrays and specific targeting:
687
+ The `scope` field supports a string, an array (OR'd together), and a `~negation` / `&`-conjunction
688
+ selector syntax:
267
689
  ```yaml
268
- scope: all # Apply to all content
269
- scope: heading # Apply to all headings
690
+ scope: all # Apply to all content (default)
691
+ scope: raw # Apply to raw file content, bypassing scope segmentation
692
+ scope: summary # Apply to the document's prose: paragraph, heading, list-item, blockquote, and table-cell text (alias: default)
270
693
  scope: sentence # Apply to sentences only
271
694
  scope: paragraph # Apply to paragraphs only
695
+ scope: heading # Apply to all headings
272
696
  scope: code # Apply to code blocks only
273
- scope: default # Apply to default content (excludes code/comments)
274
- scope: raw # Apply to raw file content
697
+ scope: list-item # Apply to list item text
698
+ scope: blockquote # Apply to blockquote text
699
+ scope: table.header # Apply to table header cells
700
+ scope: table.cell # Apply to table body cells
701
+ scope: markdoc.tag # Apply to Markdoc tag spans (`{% ... %}`), requires markdoc: true
702
+ scope: frontmatter # Apply to YAML frontmatter
703
+ scope: html # Apply to raw HTML blocks
704
+ scope: comment # Apply to HTML comments
705
+ scope: alt # Apply to image alt text
706
+ scope: link # Apply to link text
275
707
  scope: # Apply to specific heading levels
276
708
  - heading.h1
277
709
  - heading.h2
278
710
  - heading.h3
711
+ scope: # Selector syntax: '~' negates, '&' conjoins
712
+ - "~blockquote & ~heading"
713
+ ```
714
+
715
+ ### Markdoc-aware linting (`markdoc: true`)
716
+
717
+ Opt-in — off by default, since Liquid/Jinja templates use the same `{% %}` delimiters and would otherwise get mistokenized as Markdoc:
718
+
719
+ ```yaml
720
+ markdoc: true # shorthand for `{ schema: 'realm' }`
721
+ ```
722
+
723
+ Writing *about* Markdoc syntax rather than using it (docs like this one, a tutorial, a changelog entry)? Wrap the literal `{% ... %}` in a code span — `` `{% partial /%}` `` — instead of leaving it bare in prose. Code spans never tokenize as Markdoc tags whether the flag is on or off, so that's the escape hatch.
724
+
725
+ #### Object form: choosing or extending the tag schema
726
+
727
+ `markdoc: true` is shorthand for the common case. The object form adds two things the
728
+ boolean can't express: turning the schema-aware checks off while keeping tag tokenization,
729
+ and layering a project's own custom tags over the built-in schema.
730
+
731
+ ```yaml
732
+ markdoc:
733
+ schema: realm # required -- 'realm' (the built-in schema below) or `false`; there is no default if this key is omitted
734
+ extend: # optional: your own tags, merged over the base schema
735
+ tags:
736
+ myCustomTag:
737
+ selfClosing: true
738
+ attributes:
739
+ level:
740
+ type: string
741
+ enum: [info, warning, danger]
742
+ required: true
279
743
  ```
280
744
 
745
+ - **`schema: realm`** — the same built-in schema `markdoc: true` uses: `@markdoc/markdoc`'s
746
+ own built-in tags composed with `@redocly/theme`'s tag definitions. It's generated from a
747
+ theme build rather than hand-written, and a test fails if it drifts out of sync (see
748
+ [CONTRIBUTING.md](CONTRIBUTING.md) for the regeneration command). This is what most
749
+ projects want, and what the four [`recheck/markdoc`](#extends-presets) rules validate
750
+ against by default.
751
+ - **`schema: false`** — tokenization and tag **pairing** still run, so `markdoc.tag` scope,
752
+ prose-scope exclusion, fix protection, and `markdoc-syntax`/`markdoc-pairing`'s
753
+ grammar-level checks all still work. Only the two schema-dependent rules
754
+ (`markdoc-unknown-tag`, `markdoc-attributes`) go inert, since there's no schema left for
755
+ "unknown tag" or "missing required attribute" to mean anything against. Use this if you
756
+ write Markdoc tags but don't have (or don't want) a schema to validate them against.
757
+ - **`extend.tags`** — merges your own tag definitions over the base schema. On a name
758
+ collision the merge is a **whole-tag replace**, matching how Markdoc's own config
759
+ composition works, not a per-attribute deep merge. Declare your project's custom tags
760
+ here (for example, a docs site's own `@theme/markdoc/schema.ts` overrides) so
761
+ `markdoc-unknown-tag` and `markdoc-attributes` validate against your real tag surface
762
+ instead of flagging every custom tag as unknown. Under `schema: false` there is no base
763
+ to merge over, so `extend` does nothing.
764
+ - **`extend.tagsFile`** — the same tag-definition surface as `extend.tags`, but sourced from
765
+ a separate YAML file instead of written inline into `recheck.yaml`. This is the shape
766
+ [`recheck markdoc-schema`](#generating-a-tagsfile-recheck-markdoc-schema) below generates,
767
+ so a project with tags defined in TypeScript (a `@theme/markdoc/schema.ts` module, say)
768
+ never hand-transcribes them into YAML.
769
+ ```yaml
770
+ markdoc:
771
+ schema: realm
772
+ extend:
773
+ tagsFile: ./recheck-markdoc-tags.yaml
774
+ ```
775
+ - **Resolution**: the path is resolved relative to the directory containing the
776
+ `recheck.yaml`/`recheck.yml` that names it — never the process's current working
777
+ directory — so `tagsFile: ./tags.yaml` always reads the file next to that config,
778
+ wherever `recheck` is invoked from.
779
+ - **Precedence**: tags merge in the order built-in schema → `tagsFile` → inline
780
+ `extend.tags`, each layer a whole-tag replace on a name collision (same rule as
781
+ `extend.tags` above). `tags` and `tagsFile` can both be set on the same `extend` block;
782
+ `extend` with neither key is rejected by config validation as a likely no-op.
783
+ - **Errors are fatal to the whole run, not a silent markdoc downgrade.** A `tagsFile` that
784
+ doesn't exist, isn't valid YAML, isn't a YAML map, or contains a tag entry with an
785
+ invalid shape all fail `recheck run`/`recheck validate` outright
786
+ (`Configuration validation failed!`, the same failure every other structurally-invalid
787
+ config produces) — markdoc checking is never quietly switched off while the rest of the
788
+ config keeps running.
789
+
790
+ Turning `markdoc` on (either form) changes how every prose rule sees a Markdoc tag, not just `markdoc.tag` (above):
791
+
792
+ - **Prose scopes exclude the tag itself.** `paragraph`, `heading`, `list-item`, `blockquote`, and `table.header`/`table.cell` all blank a tag's own `{% ... %}` span out of their content before any rule runs — a `swap`/`pattern`/`capitalization` match can't fire on the tag's syntax, and a `length`/`metric` count doesn't include it. The blanking is position-preserving (same-width spaces, never a deletion), so real text on either side of a tag keeps its exact line and column.
793
+ - **A segment with no prose left isn't emitted at all.** A heading or table cell whose entire text IS a tag (`# {% #anchor %}`) produces no `heading.h1`/`table.cell` segment — there's nothing for a heading or cell rule to check, so none fires on it.
794
+ - **`--fix` never rewrites a Markdoc tag's bytes.** Every proposed fix is checked against the document's tag spans before it's applied: one that doesn't touch a tag goes through untouched, one that fully covers a tag with a same-length replacement gets the tag spliced back in, and anything that would change a tag's length or split it in half is withheld instead — a withheld fix is reported (`skippedFixes` in the [Library API](#library-api)), not silently swallowed.
795
+ - **Two CommonMark constructs Markdoc doesn't have stop being recognized.** Markdoc's own tokenizer disables indented code blocks and setext headings (the `Title\n===\n` underline form) unconditionally, which is how Realm renders, so `markdoc: true` disables them too — and only while the flag is on:
796
+ - A 4+-space-indented block that would otherwise be an indented code block parses as ordinary content instead: a paragraph, list, or fence, whichever the un-indented text would have produced. This shows up most with a block-positioned tag followed immediately by more indented lines, and with genuinely indented example text. Realm renders both as prose, so matching that is the intent.
797
+ - A text line immediately followed by a `---`/`===` line, with no blank line between, no longer forms a heading. This also fixes a common false positive: a tag on its own line (`{% table %}`, say) directly followed by a `---` line is ordinary Markdoc table-row syntax, but without the flag it reads as a setext heading whose text is the tag itself. With the flag on, the tag is its own token and can't merge into a paragraph that `---` would complete.
798
+ - Practical effect: on documents using either construct, expect `heading-style`, `blanks-around-headings`, `capitalization`, and `code-block-style` findings to shift when you first turn the flag on. They are moving to match how Markdoc actually renders, not regressing.
799
+
800
+ ### Generating a tagsFile: `recheck markdoc-schema`
801
+
802
+ Projects that define their own Markdoc tags in TypeScript — a `@theme/markdoc/schema.ts`
803
+ module exporting a `tags` map, the shape both `docs/realm` and `docs/intranet` use in this
804
+ monorepo — can generate an `extend.tagsFile` YAML file from it instead of hand-transcribing
805
+ each tag's schema:
806
+
807
+ ```bash
808
+ recheck markdoc-schema --from path/to/schema.ts --out recheck-markdoc-tags.yaml
809
+ ```
810
+
811
+ - **`--from <path>`** (repeatable) — a project schema module to extract tags from, resolved
812
+ relative to the current working directory. The module must export `tags` (named or on a
813
+ `default` object) mapping tag name to a Markdoc tag config; only the statically-checkable
814
+ facets (`selfClosing`, and each attribute's `type`/`required`/`default`/`enum`) are
815
+ extracted — anything richer (a custom attribute class, a `validate()` function) is written
816
+ out as `dynamic: true`, the same reduction the built-in `realm` schema goes through. Pass
817
+ `--from` more than once to merge several modules; an identical tag definition repeated
818
+ across modules is fine, but two modules disagreeing about the same tag's shape fails the
819
+ command rather than letting flag order silently pick one.
820
+ - **`--out <path>`** — where to write the generated YAML, resolved relative to the current
821
+ working directory. The file opens with a generated-file header naming its source module(s)
822
+ and the exact command to regenerate it.
823
+ - **`--check`** — verifies the output file matches what a fresh generation would produce,
824
+ without writing it: exits `0` and prints `<path> is up to date.` when it matches, exits `1`
825
+ and prints a one-line diagnosis (file missing, or stale) otherwise. This is what a CI drift
826
+ check should call — see this repo's own wiring below.
827
+
828
+ **TypeScript sources need a loader.** `recheck markdoc-schema` dynamic-`import()`s each
829
+ `--from` module directly; running the command under plain `node` against a `.ts` module
830
+ fails with an actionable one-line error naming the fix, rather than a raw stack trace:
831
+
832
+ ```
833
+ could not import "path/to/schema.ts" — TypeScript sources need a loader, e.g.: pnpm exec tsx
834
+ node_modules/.bin/recheck markdoc-schema … (Cannot find module '<a module your schema
835
+ imports>' imported from '<path to your schema.ts>')
836
+ ```
837
+
838
+ (wrapped above for line length; the real message is one line. The parenthetical is Node's
839
+ own error and its shape varies: for a schema whose extensionless internal imports plain
840
+ `node` cannot resolve — the common case — the "imported from" path is your schema file
841
+ itself; for a `--from` path that doesn't exist at all it is recheck's own command module.)
842
+
843
+ Run it through `tsx` instead (directly, or via a package script that already wraps it, like
844
+ this repo's `recheck:markdoc-tags` below) — a plain `.js` schema module needs no loader and
845
+ works under either.
846
+
847
+ **Experimental, pending a canonical manifest.** This command is an interim bridge, not a
848
+ long-term source of truth: [issue #25666](https://github.com/Redocly/redocly/issues/25666)
849
+ tracks Realm itself emitting one canonical, statics-only Markdoc tag/schema manifest, which
850
+ would let this generator (and its drift check) retire in favor of reading that manifest
851
+ directly. Until then, `recheck markdoc-schema` is the supported way to keep a project's
852
+ `tagsFile` in sync with its real tag schema modules.
853
+
854
+ #### Worked example: this repo's own setup
855
+
856
+ This monorepo's root `recheck.yaml` uses `extend.tagsFile` to pull in the custom tags from
857
+ both `docs/realm` and `docs/intranet`'s own `@theme/markdoc/schema.ts` modules:
858
+
859
+ ```yaml
860
+ markdoc:
861
+ schema: realm
862
+ extend:
863
+ tagsFile: ./recheck-markdoc-tags.yaml
864
+ ```
865
+
866
+ The committed `recheck-markdoc-tags.yaml` is generated, not hand-written — its header names
867
+ the exact regenerate command:
868
+
869
+ ```
870
+ # Generated file — do not hand-edit.
871
+ # Source module(s): ../../docs/realm/@theme/markdoc/schema.ts, ../../docs/intranet/@theme/markdoc/schema.ts
872
+ # Regenerate: recheck markdoc-schema --from ../../docs/realm/@theme/markdoc/schema.ts --from ../../docs/intranet/@theme/markdoc/schema.ts --out ../../recheck-markdoc-tags.yaml
873
+ ```
874
+
875
+ The root `package.json` wraps that same invocation in one script, run from
876
+ `packages/recheck` via `tsx` (the schema modules are TypeScript source, see above):
877
+
878
+ ```bash
879
+ pnpm run recheck:markdoc-tags # regenerate recheck-markdoc-tags.yaml
880
+ pnpm run recheck:markdoc-tags --check # verify it's current; exits 1 on drift
881
+ ```
882
+
883
+ **Do not add `--` before `--check`.** `pnpm run recheck:markdoc-tags -- --check` looks
884
+ equivalent but isn't: the script itself already ends in `pnpm --filter @redocly/recheck exec
885
+ tsx dist/cli.js markdoc-schema …`, and pnpm's own `--` forwarding through that nested `exec`
886
+ makes yargs read `--check` as a positional argument instead of the `--check` flag — the
887
+ command then silently regenerates the file and always exits `0`, defeating the whole point
888
+ of a drift check. Always call it as `pnpm run recheck:markdoc-tags --check`, with no extra
889
+ `--`.
890
+
891
+ CI runs exactly that check on every PR, as its own step in
892
+ `.github/workflows/recheck.yml` (after the package is built):
893
+
894
+ ```yaml
895
+ - name: Markdoc tags file is current
896
+ run: pnpm run recheck:markdoc-tags --check
897
+ ```
898
+
899
+ If it fails, regenerate locally with `pnpm run recheck:markdoc-tags` and commit the result.
900
+
281
901
  ### Rule Severity Levels
282
902
 
283
903
  Rules can be configured with different severity levels:
@@ -289,10 +909,322 @@ Rules can be configured with different severity levels:
289
909
 
290
910
  ### Auto-Fix Safety
291
911
 
292
- Only rules marked with `autoFixable: true` can be automatically corrected:
912
+ Fixability is declared by each assertion, not by config — a rule can be automatically corrected if and only if its assertion implements a `fix()`.
913
+ The `autoFixable` config key was removed — rules declare fixability; use `fix: false` to opt out. A config that still sets `autoFixable` now fails validation with an unknown-property error.
914
+ To opt a rule out of auto-fixing, set `fix: false` on it instead.
915
+
916
+ The `enabled` config key was likewise removed — it was schema-legal but never actually consulted by the engine (use `severity: off` to disable a rule). A config that still sets `enabled` now fails validation with an unknown-property error.
917
+
918
+ - ✅ **Fixable native assertions**: `swap`, `semantic-line-breaks`, `repetition`, `consistency`, `capitalization` (except its custom-regex `match` mode, which is always detection-only)
919
+ - ❌ **Not fixable native assertions**: `pattern`, `max-image-size`, `occurrence`, `conditional`, `metric`, `spelling`
920
+ - Of the 53 markdownlint-parity rules, 33 are fixable — see the [rule table](#markdownlint-parity) for the full per-rule breakdown (includes `no-trailing-spaces`, `no-hard-tabs`, `ul-style`, and more).
921
+
922
+ ## Markdownlint parity
923
+
924
+ Recheck ports all 53 of [markdownlint](https://github.com/DavidAnson/markdownlint)'s built-in rules (MD001-MD060, minus retired ids) as native `assertions`, verified against upstream by a differential parity harness (see [Parity with markdownlint](#parity-with-markdownlint) below). Enable the full set with one line:
925
+
926
+ ```yaml
927
+ extends: [recheck/markdown]
928
+ ```
929
+
930
+ Each rule is available as its own `recheck/<name>` assertion id, so you can also enable a subset directly:
931
+
932
+ ```yaml
933
+ recheck/heading-increment:
934
+ severity: error
935
+ message: 'Heading levels should only increment by one level at a time.'
936
+ assertions:
937
+ heading-increment: {}
938
+ ```
939
+
940
+ | Rule name | MD id | Fixable |
941
+ | --- | --- | --- |
942
+ | `heading-increment` | MD001 | No |
943
+ | `heading-style` | MD003 | No |
944
+ | `ul-style` | MD004 | Yes |
945
+ | `list-indent` | MD005 | Yes |
946
+ | `ul-indent` | MD007 | Yes |
947
+ | `no-trailing-spaces` | MD009 | Yes |
948
+ | `no-hard-tabs` | MD010 | Yes |
949
+ | `no-reversed-links` | MD011 | Yes |
950
+ | `no-multiple-blanks` | MD012 | Yes |
951
+ | `line-length` | MD013 | No |
952
+ | `commands-show-output` | MD014 | Yes |
953
+ | `no-missing-space-atx` | MD018 | Yes |
954
+ | `no-multiple-space-atx` | MD019 | Yes |
955
+ | `no-missing-space-closed-atx` | MD020 | Yes |
956
+ | `no-multiple-space-closed-atx` | MD021 | Yes |
957
+ | `blanks-around-headings` | MD022 | Yes |
958
+ | `heading-start-left` | MD023 | Yes |
959
+ | `no-duplicate-heading` | MD024 | No |
960
+ | `single-h1` | MD025 | No |
961
+ | `no-trailing-punctuation` | MD026 | Yes |
962
+ | `no-multiple-space-blockquote` | MD027 | Yes |
963
+ | `no-blanks-blockquote` | MD028 | No |
964
+ | `ol-prefix` | MD029 | Yes |
965
+ | `list-marker-space` | MD030 | Yes |
966
+ | `blanks-around-fences` | MD031 | Yes |
967
+ | `blanks-around-lists` | MD032 | Yes |
968
+ | `no-inline-html` | MD033 | No |
969
+ | `no-bare-urls` | MD034 | Yes |
970
+ | `hr-style` | MD035 | No |
971
+ | `no-emphasis-as-heading` | MD036 | No |
972
+ | `no-space-in-emphasis` | MD037 | Yes |
973
+ | `no-space-in-code` | MD038 | Yes |
974
+ | `no-space-in-links` | MD039 | Yes |
975
+ | `fenced-code-language` | MD040 | No |
976
+ | `first-line-h1` | MD041 | No |
977
+ | `no-empty-links` | MD042 | No |
978
+ | `required-headings` | MD043 | No |
979
+ | `proper-names` | MD044 | Yes |
980
+ | `no-alt-text` | MD045 | No |
981
+ | `code-block-style` | MD046 | No |
982
+ | `single-trailing-newline` | MD047 | Yes |
983
+ | `code-fence-style` | MD048 | No |
984
+ | `emphasis-style` | MD049 | Yes |
985
+ | `strong-style` | MD050 | Yes |
986
+ | `link-fragments` | MD051 | Yes |
987
+ | `reference-links-images` | MD052 | No |
988
+ | `link-image-reference-definitions` | MD053 | Yes |
989
+ | `link-image-style` | MD054 | Yes |
990
+ | `table-pipe-style` | MD055 | No |
991
+ | `table-column-count` | MD056 | No |
992
+ | `blanks-around-tables` | MD058 | Yes |
993
+ | `descriptive-link-text` | MD059 | No |
994
+ | `table-column-style` | MD060 | Yes |
995
+
996
+ *(53 rules, 33 fixable.
997
+ Generated from the built rule registry — `dist/rules/token/index.js`'s `allTokenRules`, cross-referenced against `benchmarks/parity/rule-map.mjs` for MD ids.)*
998
+
999
+ ### `extends` presets
1000
+
1001
+ Recheck ships nine built-in presets, referenced by id under `extends:`. Presets are applied in listed order, then your own rule keys are merged on top — **your config always wins**: a rule key you define overrides the same key from a preset, and per-assertion options you set override just that assertion's preset options (other preset options for the same rule are preserved).
1002
+
1003
+ There is one exception. A rule may attach a milder severity to some of its own reports, and your config can't escalate those: `recheck/markdoc-attributes` reports unknown attributes at `warn` no matter what severity you give the rule (see the `recheck/markdoc` bullet below). `severity: 'off'` still works as expected — it disables the rule entirely, so no reports of any severity.
1004
+
1005
+ - **`recheck/markdown`** — the full 53-rule set from the table above, all at `severity: error` with upstream-faithful default options. Equivalent to markdownlint's `{ default: true }`.
1006
+ - **`recheck/markdown-relaxed`** — mirrors markdownlint's own `style/relaxed.json`: the same 53 rules, with `no-trailing-spaces`, `no-hard-tabs`, `no-multiple-blanks`, `no-multiple-space-blockquote`, `no-blanks-blockquote`, `line-length`, `ul-indent`, `no-inline-html`, `no-bare-urls`, `fenced-code-language`, and `first-line-h1` turned off.
1007
+ - **`recheck/minimal`** — a small, high-signal set: `no-trailing-spaces`, `no-hard-tabs`, `single-trailing-newline`, `no-reversed-links`, `no-empty-links`.
1008
+ - **`recheck/prose`** — Recheck's Vale-parity starter set, all at `severity: warn`: `repetition` (default options), `consistency` (one US spelling enforced file-wide for `behavior`/`color`/`license`/`organize` vs. their British spellings, matched with `ignoreCase: true` so a capitalized, sentence-initial variant like `Colour` still counts), and `capitalization` (`$sentence`, `scope: heading` only, `fix: false`, no preset-level `exceptions` — see below). All three are scoped to prose segments — `repetition` and `consistency` to `summary` (the document's prose: paragraph, heading, list-item, blockquote, and table-cell text), `capitalization` to headings — so the preset never flags (and `--fix` never rewrites) code samples or frontmatter. `extends: [recheck/markdown, recheck/prose]` is the one-liner that replaces a markdownlint + Vale combo. See [Opt-in prose assertions](#opt-in-prose-assertions) below for three more prose assertions that exist but are deliberately **not** in this preset.
1009
+ - **`recheck/markdoc`** — four Recheck-original rules that check Markdoc tag syntax itself (`{% tag attr="value" %}`) rather than prose or markdownlint parity. All four are `fix: false`.
1010
+ - `recheck/markdoc-syntax` (`error`) — malformed spans, unquoted "bareword" values, and close tags carrying attributes.
1011
+ - `recheck/markdoc-pairing` (`error`) — unclosed, orphaned, or crossed tag pairs, and a self-closing tag written without a slash or given a close tag it shouldn't have.
1012
+ - `recheck/markdoc-unknown-tag` (`warn`, because custom tags are common) — a tag name the schema doesn't declare.
1013
+ - `recheck/markdoc-attributes` (mixed) — a missing required attribute, an enum or type violation, and a duplicate attribute report at `error`; an unknown attribute name, whether named or a stray positional value, always reports at `warn`. That `warn` is set per report by the rule itself, so it wins over the rule's configured severity: setting the rule to `severity: error` does not escalate those reports. Only `severity: 'off'` removes them, by disabling the rule.
1014
+
1015
+ **These rules only fire when Markdoc tokenization is also on.** Set `markdoc: true` (or the object form, see below) alongside `extends: [recheck/markdoc]`. Extending the preset without the flag validates, but prints a console warning that the four rules can never report. The flag stays an explicit opt-in because Liquid and Jinja templates use the same `{% %}` delimiters for unrelated syntax, so Recheck never assumes it.
1016
+ - **`recheck/google`** — Google's developer documentation style guide (https://developers.google.com/style), CC BY 4.0, synced 2026-07-29. 99 rules covering heading/list/table/link structure, sentence-case headings, sentence length, voice and contractions, plain language, product naming, compound word forms, and inclusive/precise-language terminology — all derived from the *live* guide (see `packages/recheck/presets/google/PROVENANCE.md` for the rule -> source page -> quote -> verdict table, including everything considered and NOT shipped, and why). `extends: [recheck/google]` is a one-line adoption of Google's style; combine with `recheck/markdown` for full structural linting too. Rule ids are namespaced `google/<rule>` (not `recheck/<rule>`) so they never collide with the markdownlint-parity or other style-guide presets. Structural/mechanical rules (heading hierarchy, list mechanics, alt-text presence, sentence length) are `severity: error`; every word-choice, terminology, and punctuation-convention rule is `severity: warn`. See `packages/recheck/presets/google/sources.json` for the fetched-page hashes. **Adopting this preset has a real, measured performance cost — roughly 2.7× the standard `recheck/markdown`-only profile's lint time on a docs-sized document set** — see [Performance](#performance) below (Phase 4) before turning it on in CI.
1017
+ - **`recheck/microsoft`** — the Microsoft Writing Style Guide (https://learn.microsoft.com/en-us/style-guide/welcome/), CC BY 4.0 (via the guide's backing GitHub repository's LICENSE file — no `learn.microsoft.com` page states the licence itself, see `packages/recheck/presets/microsoft/PROVENANCE.md`), synced 2026-07-30. 93 rules covering heading/list/table/alt-text structure, the guide's own numeric thresholds (paragraph length, list length, comma density, alt-text length), its signature "use contractions" rule, US spelling, bias-free and people-first terminology, and a large A-Z terminology word list — all derived from the *live* guide and checked against four independent verification passes (~490 rules/entries across ~340 page fetches), with every Tier-1 pair anchored or demoted to detection-only wherever it was found capable of rewriting correct prose. Rule ids are namespaced `microsoft/<rule>`. Structural rules and the A-Z word list's three unconditional tiers are `severity: error`; voice, punctuation-convention, and UI-terminology rules are `severity: warn`. Audience-conditional and UI-conditional entries (Microsoft's own "Tier 4") are never enforced, and developer-audience carve-outs relevant to API documentation (`header`, `context menu`, `disk`, `directory`) are excluded rather than misfiring on Redocly's own docs — see `packages/recheck/presets/microsoft/PROVENANCE.md` for the full table, every excluded candidate, and why. Unlike `recheck/google` (which allows `click`), this preset bans all input-specific UI verbs (`click`, `press`, `hit`) in favor of `select` — the sharpest divergence between the two guides. See `packages/recheck/presets/microsoft/sources.json` for the fetched-page hashes.
1018
+ - **`recheck/inclusive-language`** — composable, guide-agnostic: the *intersection* of `recheck/google` and `recheck/microsoft`'s inclusive/bias-free/ableist/accessibility content — terminology both flagship guides independently state should be avoided (`slave`, `master/slave`, `blacklist`/`whitelist`, `DMZ`, `grayed-out`, `he/she`, `normal person`/`healthy person`, `suffering from`/`victim of`, `differently abled`, `crippled`, `nuke`). All `warn` severity, all detection-only. Needed no new web fetch — every term was already confirmed against a live page by five existing verification reports; see `packages/recheck/presets/inclusive-language/PROVENANCE.md` for the report → row → term table and every single-guide term left out on purpose. Layer it onto either flagship or onto `recheck/prose`: `extends: [recheck/google, recheck/inclusive-language]`. **Because it's built as an intersection, every one of its 11 rules is already shipped by at least one flagship's own preset** (measured: 7 of 11 duplicate a `google/*` finding on the same span when stacked onto `recheck/google` alone, 6 of 11 duplicate a `microsoft/*` finding when stacked onto `recheck/microsoft` alone — see `packages/recheck/presets/inclusive-language/PROVENANCE.md`'s "Duplicate-finding audit"). Its full, zero-duplicate value is realized standalone, with `recheck/prose`, or on a project using neither flagship; stacked onto exactly one flagship it still fills that flagship's own gaps, but expect a majority of its findings to be reported twice.
1019
+ - **`recheck/plain-language`** — composable, derived from the *live* US federal plain-language guidance (`digital.gov/guides/plain-language`; public domain, no attribution constraint). Smaller than a first read of the old `plainlanguage.gov` site would suggest: that site is now dead and redirects to a much thinner overview, so there's no sentence-length or readability-`metric` rule (`metric` stays a documented [opt-in](#opt-in-prose-assertions), unchanged) — only paragraph length (the one family with real, quotable numbers), filler/wordy phrases, complex-word substitutes, redundant pairs, double negatives, and jargon-to-plain examples. **`shall` is never flagged** — it's a defined RFC 2119 normative keyword used throughout specs and API docs, exactly what Recheck lints; `implement` and `command` carry the identical technical-sense collision and are excluded the same way. All `warn`/`error` (paragraph-length ceiling only) severity, all detection-only. `in order to` and `utilize`/`utilization` are deliberately NOT shipped despite being live, verbatim guide content — both flagships already ship the identical pair, so keeping them here would only ever produce a duplicate finding, never new coverage (measured: this cut duplicate findings on the same fixture from 6 to 3 against `recheck/google`, and from 5 to 3 against `recheck/microsoft`). The 3 that remain are an accepted paragraph-length overlap with `recheck/microsoft` (two independently-sourced numbers, not the same fact restated) and a coincidental substring collision with `use-contractions`, not content duplication. See `packages/recheck/presets/plain-language/PROVENANCE.md` for every rule's source quote, every family considered and left out, and the full duplicate-finding audit.
1020
+
1021
+ **All four of the presets above — `recheck/google`, `recheck/microsoft`,
1022
+ `recheck/inclusive-language`, and `recheck/plain-language` — are
1023
+ detection-only by design, not by omission: no rule in any of them
1024
+ auto-fixes, ever.**
1025
+ This is enforced structurally (`fix: false` on every rule, set once by a
1026
+ loop at the end of each preset's builder function) and guarded by a test
1027
+ that reads the live preset object and fails if a future rule change ever
1028
+ makes one fixable again — see `preset-google.test.ts`'s and
1029
+ `preset-microsoft.test.ts`'s "is detection-only" describe blocks, and
1030
+ `preset-composition.test.ts`'s list-driven version covering all four.
1031
+ `recheck/google` and `recheck/microsoft` once had fixable rules. Every
1032
+ attempt to define a safe subset of them found the fixes corrupting
1033
+ genuinely correct prose, in every category previously believed safe:
1034
+ spelling (Hemingway's correctly spelled *A Moveable Feast* → "A Movable
1035
+ Feast"), hyphenation ("read only the introduction" → "read-only the
1036
+ introduction"), and at least one outright inversion of meaning ("No SQL is
1037
+ used here" → "NoSQL is used here"). A rule's *category* does not predict
1038
+ fix safety at this scale: a style guide states intent while
1039
+ `swap`/`consistency`/`pattern` match tokens, and narrowing which
1040
+ categories count as "safe" doesn't close that gap. Detection is
1041
+ unaffected — every rule still runs and reports, and you apply the fix
1042
+ yourself with the judgment style guidance has always required. This is the
1043
+ same reason Vale, the tool these presets replace, never shipped this class
1044
+ of bug. See the "Detection-only" sections of
1045
+ `packages/recheck/presets/google/PROVENANCE.md` and
1046
+ `packages/recheck/presets/microsoft/PROVENANCE.md` for the full history.
1047
+
1048
+ The heading rule uses **sentence case** *(changed from AP title case by product decision 2026-07-29: Redocly's own guide, Google, and Microsoft all mandate sentence case)*.
1049
+ Two details make that default safe out of the box:
1050
+
1051
+ - **The [built-in technical proper-noun vocabulary](#built-in-technical-proper-noun-vocabulary)** — `TECHNICAL_PROPER_NOUNS` — is unioned into `exceptions` by `capitalization` itself (default `builtinVocabulary: true`), so this preset doesn't ship its own copy: `$sentence` still won't flag `OpenAPI`, `GitHub`, `macOS`, and the rest of that list out of the box. It's a common-vocabulary floor, not a full brand list — extend it with your own product/company names via this rule's own `exceptions`, which **compose** with the built-ins rather than replacing them (unlike a preset-shipped list, which a same-key override would have replaced entirely).
1052
+ - **`fix: false`** — a sentence-case auto-fix would lowercase any proper noun the built-ins and your own `exceptions` don't cover, silently damaging content. Set `fix: true` on your own `recheck/capitalization` key (or drop the key) once your exceptions list covers your vocabulary.
1053
+
1054
+ ```yaml
1055
+ extends:
1056
+ - recheck/markdown-relaxed
1057
+
1058
+ # Your own overrides win over the preset:
1059
+ recheck/line-length:
1060
+ severity: warn
1061
+ assertions:
1062
+ line-length:
1063
+ lineLength: 120
1064
+ ```
1065
+
1066
+ Multiple presets can be listed; later presets in the list override earlier ones for the same rule key, before your own top-level rule keys are merged in last.
1067
+
1068
+ ### Tuning a preset
1069
+
1070
+ Adopting a whole style-guide preset doesn't mean accepting every rule at its shipped severity. Because your own config's rule keys always win over a preset's (see above), you can turn individual rules off, downgrade them, or silence single occurrences — all verified against a live build, not just read from source:
1071
+
1072
+ ```yaml
1073
+ extends: [recheck/markdown, recheck/microsoft]
1074
+
1075
+ microsoft/az-navigation:
1076
+ severity: off # turn a rule off entirely
1077
+
1078
+ microsoft/heading-sentence-case:
1079
+ severity: warn # downgrade an error to a warning (this rule ships at error)
1080
+ ```
1081
+
1082
+ Or silence one occurrence instead of the whole rule, with an inline directive (works on any rule, from any preset — see [Inline Directives](#inline-directives) above):
1083
+
1084
+ ```markdown
1085
+ <!-- recheck-disable-next-line microsoft/az-navigation -->
1086
+ Click the hot link to continue.
1087
+
1088
+ <!-- recheck-disable microsoft/az-navigation -->
1089
+ ...several occurrences here are all silenced...
1090
+ <!-- recheck-enable microsoft/az-navigation -->
1091
+
1092
+ <!-- recheck-disable-file -->
1093
+ ```
1094
+
1095
+ **The sharp edge:** merging a user override on top of a preset rule happens per *assertion id*, not per option inside it. Setting a partial override on a bundled `swap` or `pattern` rule doesn't just change the one option you named — it **replaces that assertion object entirely**, silently discarding everything else it carried. For example:
1096
+
1097
+ ```yaml
1098
+ microsoft/spelling-hyphenation:
1099
+ assertions:
1100
+ swap:
1101
+ ignoreCase: false
1102
+ ```
1103
+
1104
+ drops the preset's whole `pairs` map along with it, and the config then fails validation outright (verified against this exact rule on a live build):
1105
+
1106
+ ```
1107
+ Rule "microsoft/spelling-hyphenation": swap requires a "pairs" object mapping find -> replace strings
1108
+ ```
293
1109
 
294
- - ✅ **Safe Rules**: `no-trailing-spaces`, `bullet-style`, `no-hard-tabs`
295
- - ❌ **Unsafe Rules**: `max-line-length`, `semantic-line-breaks`, `no-duplicate-headings`
1110
+ So today, to reject just one term out of a bundled `swap`/`pattern` rule, your options are: turn the whole rule off, restate its entire `pairs`/`tokens` yourself, or inline-disable each occurrence as shown above. Two assertion types already have a real per-term escape hatch that doesn't hit this edge: `capitalization`'s `exceptions` (an array of allowed terms that **composes** with the built-in technical-proper-noun vocabulary and anything else you add, rather than replacing it) and `spelling`'s `ignore`. A per-term opt-out for `swap`/`pattern` is a known follow-up, not shipped yet.
1111
+
1112
+ ### Example configs
1113
+
1114
+ `packages/recheck/examples/{google,microsoft,inclusive-language,plain-language}.yaml` are ready-to-copy configs for the four style-guide presets, generated by `pnpm examples:generate` (`packages/recheck/scripts/generate-examples.mjs`) so they can never drift from the preset they document — a test (`src/config/__tests__/examples-drift.test.ts`) byte-compares each on-disk file against a fresh render and fails, naming the file, if either the preset or the file's own hand-maintained appendix (`examples/appendices/<name>.appendix.yaml`) changes without regenerating.
1115
+
1116
+ Each file has four parts, in this order:
1117
+
1118
+ 1. **An attribution header** — source, license, and sync date, as YAML comments (mirrors that preset's `PROVENANCE.md`).
1119
+ 2. **`# What to paste`** — the actual adoption cost: a two-to-four-line `extends` block. This is the only part most readers need; everything below it is supporting material, not something to copy.
1120
+ 3. **`# How to tune it`** — override patterns verified to work today (turn a rule off, downgrade its severity, inline-disable one occurrence with an HTML comment), plus a documented sharp edge: overriding one option on a bundled `swap`/`pattern` rule's `assertions` **replaces that assertion entirely**, silently discarding options like a `pairs` map you didn't restate (merging is per *assertion id*, not per option) — restate the whole map, turn the rule off, or use an inline directive instead. `capitalization`'s `exceptions` and `spelling`'s `ignore` are the two assertion types that already have a real per-term escape hatch; an equivalent for `swap`/`pattern` is a known follow-up, not shipped yet.
1121
+ 4. **`# Full expansion (reference)`** — the preset's entire resolved rule set (alphabetized), so a reader can see exactly what they're adopting without running the tool. Every value here is identical to what the `extends` block above already resolves to, so copying this section too is redundant, not broken — it's for reading, not pasting.
1122
+
1123
+ A hand-maintained appendix is appended verbatim after part 4: NOISY candidates the guide states but the preset doesn't enforce (shown as the rule they'd be if shipped, commented out, with a one-line false-positive note each) and a checklist of guide content that needs a human, not a linter (NOT-ENFORCEABLE — active voice, missing-Oxford-comma detection, and similar).
1124
+
1125
+ ### Opt-in prose assertions
1126
+
1127
+ `recheck/prose` (above) intentionally ships only `repetition`, `consistency`, and `capitalization` — a small, broadly-applicable default. Three more Vale-parity/native assertions exist (see [Assertion Types](#assertion-types) above for full per-option tables) but are **not shipped in any preset**, because their thresholds, patterns, or dictionaries are inherently project-specific rather than having one right-for-everyone default: `conditional`, `metric`, `spelling`. (`length` and `occurrence` used to be entries here; neither is an opt-in any more — [`recheck/google`](#extends-presets) ships `length` directly for the guide's sentence-length limit, and [`recheck/microsoft`](#extends-presets) ships `occurrence` directly for the guide's comma-density rule, so neither one's default bounds are "no one right answer" any more.) Add any of the three by copying its rule below into your own config, alongside `extends: [recheck/prose]`:
1128
+
1129
+ ```yaml
1130
+ extends: [recheck/markdown, recheck/prose]
1131
+
1132
+ # conditional: if "TBD" appears, a tracking-issue link must exist somewhere in the file.
1133
+ recheck/tbd-needs-tracking-link:
1134
+ severity: warn
1135
+ message: '"%s" appears but "%s" was never introduced.'
1136
+ assertions:
1137
+ conditional:
1138
+ first: '\bTBD\b'
1139
+ second: 'https://github\.com/\S+/issues/\d+'
1140
+
1141
+ # metric: flag prose below a Flesch reading-ease floor (higher score = easier to read).
1142
+ # The message's four slots are positional: formula, score, min, max (see "Metric Assertions").
1143
+ recheck/readability-floor:
1144
+ severity: warn
1145
+ message: 'Readability (%s) is %s; expected between %s and %s.'
1146
+ assertions:
1147
+ metric:
1148
+ formula: flesch-reading-ease
1149
+ min: 30
1150
+
1151
+ # spelling: requires the optional `nspell`/`dictionary-en` peers -- see
1152
+ # "Spelling Assertions" above for the install command.
1153
+ recheck/us-spelling-check:
1154
+ severity: warn
1155
+ message: 'Unknown word "%s"%s'
1156
+ assertions:
1157
+ spelling:
1158
+ vocab: [Redocly, Reunite]
1159
+ ```
1160
+
1161
+ Each snippet's `severity`, `message`, `scope`, and `exceptions` are yours to adjust — see [Rule Types and Assertions](#rule-types-and-assertions) for every option each assertion accepts, and [Inline Directives](#inline-directives) to silence any one of them on a specific line or file with an HTML comment instead of turning it off entirely.
1162
+
1163
+ ### Migrating from markdownlint
1164
+
1165
+ A markdownlint config maps onto Recheck almost 1:1 — `extends` a preset, then override individual rules by their Recheck name (same short name markdownlint uses, e.g. `line-length` for MD013) under `assertions`:
1166
+
1167
+ ```yaml
1168
+ extends:
1169
+ - recheck/markdown
1170
+
1171
+ recheck/line-length:
1172
+ severity: warn
1173
+ message: 'Keep lines under %s characters.'
1174
+ assertions:
1175
+ line-length:
1176
+ lineLength: 120
1177
+ codeBlocks: false
1178
+
1179
+ recheck/ul-style:
1180
+ severity: off
1181
+ ```
1182
+
1183
+ **Renamed legacy assertion ids — old ids are no longer accepted.** A handful of ids from Recheck's pre-parity native rules were converged onto their markdownlint-parity replacements.
1184
+ These four were removed outright, not kept as aliases: using the old id in a config now fails validation with an `unknown assertion type "<old>"` error, and the config must be updated to the new id:
1185
+
1186
+ | Old id (removed) | Use instead |
1187
+ | --- | --- |
1188
+ | `max-line-length` | `line-length` (MD013) |
1189
+ | `bullet-style` | `ul-style` (MD004) |
1190
+ | `no-duplicate-headings` | `no-duplicate-heading` (MD024) |
1191
+ | `no-broken-fragment-links` | `link-fragments` (MD051) |
1192
+
1193
+ Two other ids are **upstream markdownlint's own alternate rule names**, not a Recheck deprecation — these remain permanent, warning-free aliases and require no config change:
1194
+
1195
+ | Upstream synonym | Canonical id |
1196
+ | --- | --- |
1197
+ | `first-line-heading` | `first-line-h1` (MD041) |
1198
+ | `single-title` | `single-h1` (MD025) |
1199
+
1200
+ **Two intentional behavior changes** vs. plain markdownlint defaults, both on rules that predate the parity port and kept their exact ids:
1201
+
1202
+ - **`no-trailing-spaces` (MD009)** now exempts lines with *exactly 2* trailing spaces by default (a markdown hard line break), instead of flagging all trailing whitespace. Set `strict: true` to restore the old flag-everything behavior (matches markdownlint's default).
1203
+ - **`no-hard-tabs` (MD010)**'s `spacesPerTab` option now defaults to `1` (matching markdownlint's own upstream default) — Recheck's earlier, pre-parity native rule had defaulted this to `2`. If you were relying on that old default, set `spacesPerTab: 2` explicitly.
1204
+
1205
+ Token-rule options aren't individually schema-validated, so an option name a rule doesn't recognize (e.g. a leftover `checkExternalFiles` on `link-fragments`, from the old `no-broken-fragment-links` rule, which never implemented it either) is silently ignored — it has no effect, and produces no warning or error.
1206
+
1207
+ ### Known differences from markdownlint
1208
+
1209
+ - **Inline HTML-comment disable directives are not supported**, for example:
1210
+
1211
+ ```html
1212
+ <!-- markdownlint&#45;disable -->
1213
+ ```
1214
+
1215
+ (dash HTML-escaped above so this very README doesn't trip markdownlint's own directive scanner — markdownlint recognizes these directives even inside fenced code, so the literal syntax can't appear here unescaped). Markdownlint's HTML-comment-based per-line/per-region rule toggles (`markdownlint-disable`, `markdownlint-disable-next-line`, `markdownlint-enable`, etc.) are a distinct engine feature, not a rule port, and Recheck doesn't parse them today. Use config-level `exceptions` (file/line patterns) or `excludes`/`appliesTo` to achieve the same effect. Native support is a possible future addition; no decision has been made yet.
1216
+
1217
+ ### Parity with markdownlint
1218
+
1219
+ The 53 ported rules are checked against upstream markdownlint by a differential harness (`pnpm parity`, `benchmarks/parity/run-parity.mjs`): the harness lints the same real-world document set with both Recheck (via a config translated from markdownlint's option surface) and markdownlint itself, then set-diffs the findings. As of this writing it reports **zero unexplained differences** across:
1220
+
1221
+ - `mdn-content` (MDN Web Docs, ~14.5k files)
1222
+ - `electron` (Electron's docs + repo markdown)
1223
+ - `monorepo-docs` (this monorepo's own `docs/` tree)
1224
+
1225
+ on both the `default` profile (full `recheck/markdown` preset vs. markdownlint `{ default: true }`) and a `rebilly` profile (a real third-party `.markdownlint.yaml` translated to Recheck config). A small, explicitly documented allowlist (`benchmarks/parity/allowlist.json`) covers the one known permanent engine-surface gap — inline `markdownlint-disable` directives (see [Known differences](#known-differences-from-markdownlint) above) — scoped to the exact rules it can affect (MD010, MD011, MD033, MD059). Everything else matches exactly.
1226
+
1227
+ **`pnpm parity` requires `--corpus`** — running it bare exits `2` with a usage error (`Usage: node benchmarks/parity/run-parity.mjs --corpus <name> [--profile default|rebilly] [--rules MD001,MD013]`) rather than running against a default document set. Always pass a document-set name, e.g. `pnpm parity --corpus monorepo-docs --profile default`.
296
1228
 
297
1229
  ## GitHub Actions Integration
298
1230
 
@@ -315,8 +1247,8 @@ node dist/cli.js run docs --output github-actions --annotations-limit 20
315
1247
  The GitHub Actions format produces annotations that GitHub automatically displays as inline comments:
316
1248
 
317
1249
  ```
318
- ::error title=recheck/no-trailing-spaces,file=docs/guide.md,line=42,col=15,endColumn=18::Remove trailing spaces.
319
- ::warning title=recheck/bullet-style-dash,file=docs/api.md,line=23,col=1,endColumn=2::Use '-' for unordered list bullets.
1250
+ ::error title=recheck/no-trailing-spaces,file=docs/guide.md,line=42,col=15,endColumn=18::Trailing spaces
1251
+ ::warning title=recheck/ul-style,file=docs/api.md,line=23,col=1,endColumn=2::Unordered list style
320
1252
  ```
321
1253
 
322
1254
  ### GitHub Actions Limits
@@ -342,25 +1274,58 @@ This creates both inline file annotations AND summary comments when combined wit
342
1274
 
343
1275
  ## Performance
344
1276
 
345
- The new architecture delivers excellent performance:
1277
+ Recheck's file-first, parse-once architecture is benchmarked directly against `markdownlint`'s own library API (`benchmarks/run-markdownlint.mjs`) on the same corpora, using `pnpm bench` (see `benchmarks/bench.mjs`):
346
1278
 
347
- - ✅ **Small Projects**: ~15ms for single files
348
- - ✅ **Medium Projects**: ~50-100ms for 10-50 files
349
- - ✅ **Large Projects**: Successfully processes 300+ files with 1,000+ issues
350
- - ✅ **Scalable**: File-first architecture with rule indexing optimizes for large repositories
1279
+ - **Phase 1** (10 native scope rules vs. markdownlint's default rules, `monorepo-docs` document set, 953 files): recheck **0.91×** markdownlint's median time (3219ms vs. 3521ms) — see `benchmarks/results/phase1-ast-core.json` / `baseline-markdownlint.json`.
1280
+ - **Phase 2** (all 53 markdownlint-parity rules via `extends: [recheck/markdown]` vs. markdownlint's `{ default: true }`, equivalent rule sets):
1281
+ - `monorepo-docs` (954 files): recheck 4468ms vs. markdownlint 3755ms — **1.19×**.
1282
+ - `mdn-content` (14,515 files, a real-world OSS document set): recheck 41839ms vs. markdownlint 34548ms — **1.21×**.
1283
+
1284
+ Both Phase 2 numbers sit comfortably inside the ±40% parity gate (recheck's median must fall within `[0.6×, 1.4×]` of markdownlint's on an equivalent rule set) enforced by:
1285
+
1286
+ ```bash
1287
+ pnpm bench --subject benchmarks/run-recheck-mdl-preset.mjs --corpus monorepo-docs --record <label>
1288
+ pnpm bench --subject benchmarks/run-markdownlint.mjs --corpus monorepo-docs --record <label>
1289
+ ```
1290
+
1291
+ Recheck trades a bit of the Phase 1 constant-factor lead for full rule-count parity (53 rules vs. 10) — still within budget, and the shared AST-parse-once architecture means adding prose/style rules on top costs little extra, since markdown structure parsing is already paid for.
1292
+
1293
+ - **Phase 3** (prose profile — the standard Phase 2 rule set vs. that same set plus the Vale-parity prose additions, `monorepo-docs` document set, the same set on both sides):
1294
+ - Standard profile (`recheck-mdl-preset.yaml`, `extends: [recheck/markdown]`, 53 rules, `run-recheck-mdl-preset.mjs`, 965 files): **4072ms** median — **-8.9% vs the Phase 2 recording** (`phase2-parity-recheck`, 4468ms, 954 files), i.e. no regression from the Phase 3 rule-registry additions, since the standard profile doesn't exercise any of them (the small speedup is run-to-run variance plus the document-set size difference, not an optimization claim).
1295
+ - Prose profile (`recheck-prose-bench.yaml`, `extends: [recheck/markdown, recheck/prose]` plus one opt-in `occurrence` rule and one opt-in `conditional` rule, 58 rules, `run-recheck-prose.mjs`, same 965 files): **4547ms** median — **+11.7%** vs. the standard profile above, for the five added prose/scope rules (`repetition`, `consistency`, `capitalization`, and the two opt-ins). Comfortably under the "investigate if >2x standard" threshold; no pathological per-rule cost found. There is no hard pass/fail gate for this profile (new profile, first recording) — these numbers establish its baseline.
1296
+ - Measured 2026-07-27 (local time; the result JSONs record the UTC date `2026-07-28`, so the file dates and this measurement date differ by design, not by error) at commit `27a8b6feb10` (immediately prior to the commit that added this benchmark profile), on an Apple M2 Max / Darwin 24.6.0 / Node v23.7.0 machine; single 3-run session, not a statistically rigorous multi-session average — treat the deltas as directional, not precise. `pnpm bench --subject <script> --corpus monorepo-docs --runs 3 --record <label>` (median of 3 timed runs after 1 warm-up); recorded to `benchmarks/results/phase3-prose-standard.json` / `phase3-prose-profile.json`. A `--corpus self` (2-file) smoke pair recorded to `phase3-prose-standard-self.json` / `phase3-prose-profile-self.json` proves the harness/subject-script mechanics end-to-end but isn't large enough to be a meaningful timing signal on its own.
1297
+
1298
+ - **Phase 4** (refreshed standard/prose figures plus the new `recheck/google` profile, `monorepo-docs` document set, the same set across all three, 968 files — the document set grew by 3 files since the Phase 3 recording):
1299
+ - Standard profile (same config as Phase 2/3, `recheck-mdl-preset.yaml`, 53 rules): **4350ms** median (runs 4341/4350/4369ms — 28ms spread, 0.6% of median: a tight, trustworthy measurement). This refreshes — and for current comparisons supersedes — Phase 3's `4072ms`/965-file recording; the ~7% difference is within normal session-to-session noise (different process/cache/scheduler state), not a regression, and there is still no rule-registry change that would affect this profile.
1300
+ - Prose profile (same config as Phase 3, `recheck-prose-bench.yaml`, 58 rules): **4801ms** median (runs 4599/4801/4840ms — 241ms spread, 5.0% of median) — **+10.4%** vs. the refreshed standard profile above. This is the requested refresh of the Phase 3 prose figures, which the `capitalization` default's AP-title-case → sentence-case change (2026-07-29, see [`extends` presets](#extends-presets) below) made marginally stale, since this profile's `capitalization` rule is exactly what that change touched. The new delta (+10.4%) is close to Phase 3's original (+11.7%); given the 5.0% run-to-run spread observed here, treat both numbers as directionally consistent, not as proof of a precise change in cost — same posture Phase 3 itself took.
1301
+ - **`recheck/google` profile** (new — `recheck-google-bench.yaml`, `extends: [recheck/markdown, recheck/google]`, 152 rules total: the same 53-rule structural set plus all 99 rules `recheck/google` ships, `run-recheck-google.mjs`, same 968 files): **11792ms** median (runs 11628/11792/12164ms — 536ms spread, 4.5% of median).
1302
+ - **This profile is substantially more expensive than either profile above: roughly 2.7× (~+171%) the standard profile's median time**, a materially different result from the ~1.1–1.2× range Phase 2/3 established for the markdownlint-parity and Vale-parity workloads. This is recorded as a **new baseline on its own terms, not a regression against the standard-profile's ±40% parity gate** — that gate applies only to `recheck/markdown` vs. markdownlint's equivalent rule set (Phase 2, unaffected by this preset's addition) and was never meant to bound a ~99-rule prose-preset workload layered on top of it. The number is reported as measured, without tuning the preset to improve it.
1303
+ - The ~171% delta is far larger than the ≤5% run-to-run spread measured on all three profiles this session, so the *direction and rough magnitude* of "the Google preset costs several times more than the structural set alone" is trustworthy; the precise "171%" is not — this is a single 3-run-median session on one developer machine, not a statistically rigorous benchmark. Read it as "roughly 2.5–3×," not as a number with two decimal digits of meaning.
1304
+ - **What this means for adopters**: turning on `extends: [recheck/google]` roughly triples per-run lint time on a docs-sized document set (968 files: ~4.3s → ~11.8s). That is a real, user-facing cost, stated here so it is visible before adoption rather than discovered later in CI — projects sensitive to CI duration should budget for it explicitly (e.g., a separate, non-blocking job, or a scheduled run) rather than assuming `recheck/google` is free to layer on top of `recheck/markdown`.
1305
+ - Measured 2026-07-30 at commit `7c50caaaf05` (immediately prior to the commit that adds this benchmark profile), on the same Apple M2 Max / Darwin 24.6.0 / Node v23.7.0 machine as Phase 1–3; single 3-run session per profile (1 warm-up + 3 timed runs), same caveats as Phase 3 — treat deltas as directional, not precise. `pnpm bench --subject <script> --corpus monorepo-docs --runs 3 --record <label>`; recorded to `benchmarks/results/phase4-google-standard.json` / `phase4-google-prose-refresh.json` / `phase4-google-profile.json`.
1306
+
1307
+ - **Markdoc parse cost** (`parseMarkdown` in isolation — no rules, no config validation — flag off vs. flag on, `monorepo-docs` document set, 981 files, `run-recheck-parse.mjs` / `run-recheck-parse-markdoc.mjs`): flag off **2825ms** median (runs 2784/2825/2966ms) vs. flag on **2896ms** median (runs 2864/2896/3101ms) — **+2.5%**. That gap is smaller than the ~240–280ms run-to-run spread on either side, so read it as "no measurable parse-time cost from turning `markdoc: true` on" rather than a precise 2.5% overhead; the number is reported as measured. This is its own baseline row — there is no earlier "parse only, flag off" recording to compare against — and it is deliberately not gated against the ±40% markdownlint-parity budget above, which covers the 53-rule structural comparison and never sets this flag. Measured 2026-08-02 at commit `db8df4378ff`, on the same Apple M2 Max / Darwin 24.6.0 / Node v23.7.0 machine as the phases above; single 3-run session per side. `pnpm bench --subject benchmarks/run-recheck-parse.mjs --corpus monorepo-docs --runs 3 --record <label>` (and the `-markdoc` sibling script for the flag-on side); recorded to `benchmarks/results/markdoc-parse-cost-flag-off.json` / `markdoc-parse-cost-flag-on.json`.
1308
+ - ✅ **Scalable**: File-first architecture with rule indexing optimizes for large repositories; the same micromark AST backs both markdown-structure rules and prose-scope rules, so combining both rule families costs one parse, not two.
351
1309
 
352
1310
  ## Dependencies
353
1311
 
354
1312
  ### Runtime Dependencies
355
- - `ajv` + `ajv-formats` - JSON Schema validation
1313
+ - `@redocly/ajv` + `ajv-formats` - JSON Schema validation
356
1314
  - `js-yaml` - YAML configuration parsing
357
1315
  - `yargs` - CLI interface
358
1316
  - `colorette` - Terminal colors
359
1317
  - `picomatch` - File pattern matching
1318
+ - `micromark` + `micromark-extension-directive`, `micromark-extension-frontmatter`, `micromark-extension-gfm-autolink-literal`, `micromark-extension-gfm-footnote`, `micromark-extension-gfm-table`, `micromark-extension-math` - the markdown parser (and its GFM/frontmatter/directive/math extensions) backing the shared token tree that both markdown-structure and prose/scope rules run against
1319
+ - `string-width` - measures the display width of strings containing wide/ambiguous-width or ANSI-styled characters, for CLI table output alignment
1320
+
1321
+ ### Optional Peer Dependencies
1322
+ - `nspell` + `dictionary-en` - Hunspell-compatible spell checker (and its bundled English dictionary) backing the `spelling` assertion (see [Spelling Assertions](#spelling-assertions-spelling) above). **Not installed by installing `@redocly/recheck`** — both are declared `optional: true` in `peerDependenciesMeta`, loaded lazily via dynamic `import()` only when a config actually enables `spelling`. Run `npm i nspell dictionary-en` to enable it (or just `npm i nspell` if every `spelling` rule supplies its own `dictionary` path).
360
1323
 
361
1324
  ### Development Dependencies
362
1325
  - `vitest` - Modern testing framework
363
1326
  - `typescript` - Type checking and compilation
1327
+ - `markdownlint` - upstream reference implementation, used by the differential parity harness (`pnpm parity`) and its own smoke tests, not by Recheck itself at runtime
1328
+ - `nspell` + `dictionary-en` - pinned here too (see Optional Peer Dependencies above) so this package's own test suite can exercise the real speller against real dictionary data
364
1329
  - `@types/*` - TypeScript definitions
365
1330
 
366
1331
  ## Example Output
@@ -379,16 +1344,16 @@ The new architecture delivers excellent performance:
379
1344
  Checking rule: no-gerund-headings...
380
1345
  Checking rule: oxford-comma...
381
1346
  Checking rule: no-trailing-spaces...
382
- Checking rule: bullet-style-dash...
1347
+ Checking rule: ul-style...
383
1348
  Checking rule: semantic-line-breaks...
384
1349
  Checking rule: no-hard-tabs...
385
- Checking rule: no-duplicate-headings...
1350
+ Checking rule: no-duplicate-heading...
386
1351
 
387
1352
  📋 Found 1086 issue(s):
388
1353
 
389
1354
  us-spelling README.md:68:5 Use the US spelling "color" instead of British "colour".
390
- no-trailing-spaces README.md:15:42 Remove trailing spaces.
391
- bullet-style-dash docs/guide.md:22:1 Use '-' for unordered list bullets.
1355
+ no-trailing-spaces README.md:15:42 Trailing spaces
1356
+ ul-style docs/guide.md:22:1 Unordered list style
392
1357
 
393
1358
  65 error(s)
394
1359
  1021 warning(s)
@@ -410,7 +1375,7 @@ bullet-style-dash docs/guide.md:22:1 Use '-' for unordered list bullets
410
1375
  "info": 0,
411
1376
  "total": 65
412
1377
  },
413
- "recheck/bullet-style-dash": {
1378
+ "recheck/ul-style": {
414
1379
  "errors": 1021,
415
1380
  "warnings": 0,
416
1381
  "info": 0,
@@ -420,14 +1385,14 @@ bullet-style-dash docs/guide.md:22:1 Use '-' for unordered list bullets
420
1385
  },
421
1386
  "issues": [
422
1387
  {
423
- "file": "../../docs/public/branding/index.md",
1388
+ "file": "../../docs/realm/branding/index.md",
424
1389
  "line": 13,
425
1390
  "column": 22,
426
1391
  "text": "Use the brand guidelines when applying Redocly brand",
427
1392
  "match": " ",
428
1393
  "ruleName": "recheck/no-trailing-spaces",
429
1394
  "severity": "error",
430
- "message": "Remove trailing spaces."
1395
+ "message": "Trailing spaces"
431
1396
  }
432
1397
  ]
433
1398
  }
@@ -435,11 +1400,11 @@ bullet-style-dash docs/guide.md:22:1 Use '-' for unordered list bullets
435
1400
 
436
1401
  ## What's Working Now
437
1402
 
438
- - ✅ **Modern Architecture**: File-first processing with scope-based rule application
1403
+ - ✅ **Modern Architecture**: File-first processing — each file is parsed once into a micromark AST, then segmented into scopes for rule application
439
1404
  - ✅ **Vale Compatibility**: Scope notation compatible with Vale linter
440
1405
  - ✅ **Swap Rules**: Find and replace text patterns with word boundaries and case sensitivity
441
1406
  - ✅ **Pattern Rules**: Regex matching with precise scope filtering
442
- - ✅ **Built-in Rules**: All 6 built-in rules fully implemented with comprehensive tests
1407
+ - ✅ **Built-in Assertions**: `swap` and `pattern` general-purpose assertions, a small set of native prose assertions, and 53 markdownlint-parity rules — all fully implemented with comprehensive tests
443
1408
  - ✅ **File Discovery**: Recursive markdown file finding with common directory exclusions
444
1409
  - ✅ **Multiple Output Formats**: Human-readable table, structured JSON, SARIF, and GitHub Actions
445
1410
  - ✅ **Severity Filtering**: Show only errors, warnings, or all issues
@@ -447,7 +1412,7 @@ bullet-style-dash docs/guide.md:22:1 Use '-' for unordered list bullets
447
1412
  - ✅ **Exception Handling**: Skip lines and files that match exception patterns
448
1413
  - ✅ **Auto-Fix**: Safe automatic correction for appropriate rules
449
1414
  - ✅ **Production Scale**: Successfully handles large documentation repositories
450
- - ✅ **Comprehensive Testing**: Full test suite with 161 passing tests
1415
+ - ✅ **Comprehensive Testing**: Full Vitest test suite covering the parser, scope extractor, config validation, rules, and CLI
451
1416
 
452
1417
 
453
1418
  ### Key Design Principles
@@ -455,7 +1420,7 @@ bullet-style-dash docs/guide.md:22:1 Use '-' for unordered list bullets
455
1420
  - **File-First Processing**: Iterate by files, then by semantic scopes within files
456
1421
  - **Scope-Based Rules**: Apply rules only to relevant content scopes
457
1422
  - **Type Safety**: Full TypeScript coverage with strict typing
458
- - **Scope parsing**: Efficient per-file segmentation for applying rules by scope
1423
+ - **AST-Based Parsing**: A micromark token tree per file backs scope segmentation, replacing regex-based scope parsing
459
1424
  - **Modular Rules**: Each built-in rule in its own file with dedicated tests
460
1425
  - **Safe Auto-Fix**: Granular control over which rules can auto-fix
461
1426
  - **Vale Compatibility**: Scope notation compatible with existing Vale configurations
@@ -518,22 +1483,24 @@ File targeting supports multiple pattern types:
518
1483
  The enhanced pattern matching checks patterns against:
519
1484
 
520
1485
  1. **Filename** (`config.md`) - for simple patterns
521
- 2. **Relative path** (`docs/config/settings.md`) - for full path patterns
1486
+ 2. **Relative path** (`docs/config/settings.md`) - for full path patterns
522
1487
  3. **Path segments** (`config/settings.md`) - for partial path patterns
523
1488
 
524
1489
  This allows flexible targeting while maintaining backward compatibility.
525
1490
 
526
1491
  ## Contributing
527
1492
 
528
- Want to add new assertions or improve existing ones? Check out our **[Contributing Guide](src/assertions/CONTRIBUTING.md)** for:
1493
+ Want to add new assertions or improve existing ones?
1494
+ Check out our **[Contributing Guide](src/rules/CONTRIBUTING.md)** for:
529
1495
 
530
- - 🏗️ **Architecture overview** - How the centralized scoping system works
531
- - 📝 **Step-by-step guide** - Create new assertions following best practices
1496
+ - 🏗️ **Architecture overview** - How parse-once file processing and centralized scope filtering work
1497
+ - 📝 **Step-by-step guide** - Create new assertions following best practices
532
1498
  - 🧪 **Testing guidelines** - Comprehensive test coverage examples
533
1499
  - ✅ **Code standards** - Follow our established conventions
534
1500
  - 🚀 **Quick examples** - Get started with working code templates
535
1501
 
536
- The guide covers our modern architecture where the **runner handles scoping automatically**, so your assertions can focus on their core logic without worrying about segment filtering or line number adjustments.
1502
+ The guide covers our modern architecture where the **runner handles parsing and scope filtering automatically**.
1503
+ An assertion's `execute`/`fix` functions can focus on their core logic instead of re-implementing segment selection or file I/O.
537
1504
 
538
1505
  ## Future Enhancements
539
1506