chaffjs 0.50.0 → 0.51.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 (890) hide show
  1. package/README.ja.md +30 -3
  2. package/README.md +30 -2
  3. package/dist/allow.d.ts +49 -0
  4. package/dist/allow.d.ts.map +1 -0
  5. package/dist/allow.js +111 -0
  6. package/dist/allow.js.map +1 -0
  7. package/dist/check-source.d.ts +13 -3
  8. package/dist/check-source.d.ts.map +1 -1
  9. package/dist/check-source.js +23 -6
  10. package/dist/check-source.js.map +1 -1
  11. package/dist/cli-text.d.ts +7 -1
  12. package/dist/cli-text.d.ts.map +1 -1
  13. package/dist/cli-text.js +8 -2
  14. package/dist/cli-text.js.map +1 -1
  15. package/dist/cli.d.ts.map +1 -1
  16. package/dist/cli.js +12 -11
  17. package/dist/cli.js.map +1 -1
  18. package/dist/commands/eval.js +1 -1
  19. package/dist/commands/eval.js.map +1 -1
  20. package/dist/commands/suppressions.d.ts +4 -1
  21. package/dist/commands/suppressions.d.ts.map +1 -1
  22. package/dist/commands/suppressions.js +2 -2
  23. package/dist/commands/suppressions.js.map +1 -1
  24. package/dist/commands/test.js +1 -1
  25. package/dist/commands/test.js.map +1 -1
  26. package/dist/compound-head.d.ts +5 -2
  27. package/dist/compound-head.d.ts.map +1 -1
  28. package/dist/compound-head.js +17 -8
  29. package/dist/compound-head.js.map +1 -1
  30. package/dist/config/allow-problems.d.ts +8 -0
  31. package/dist/config/allow-problems.d.ts.map +1 -0
  32. package/dist/config/allow-problems.js +61 -0
  33. package/dist/config/allow-problems.js.map +1 -0
  34. package/dist/config/by-path-problems.d.ts +3 -0
  35. package/dist/config/by-path-problems.d.ts.map +1 -1
  36. package/dist/config/by-path-problems.js +21 -2
  37. package/dist/config/by-path-problems.js.map +1 -1
  38. package/dist/config/by-path-rules.d.ts +34 -0
  39. package/dist/config/by-path-rules.d.ts.map +1 -0
  40. package/dist/config/by-path-rules.js +53 -0
  41. package/dist/config/by-path-rules.js.map +1 -0
  42. package/dist/config/by-path.d.ts +15 -0
  43. package/dist/config/by-path.d.ts.map +1 -1
  44. package/dist/config/by-path.js.map +1 -1
  45. package/dist/config/consistent-problems.d.ts +5 -0
  46. package/dist/config/consistent-problems.d.ts.map +1 -0
  47. package/dist/config/consistent-problems.js +24 -0
  48. package/dist/config/consistent-problems.js.map +1 -0
  49. package/dist/config/load.d.ts +23 -1
  50. package/dist/config/load.d.ts.map +1 -1
  51. package/dist/config/load.js +63 -10
  52. package/dist/config/load.js.map +1 -1
  53. package/dist/config/option-problems.d.ts +6 -4
  54. package/dist/config/option-problems.d.ts.map +1 -1
  55. package/dist/config/option-problems.js +5 -2
  56. package/dist/config/option-problems.js.map +1 -1
  57. package/dist/config/prefer-problems.d.ts +5 -0
  58. package/dist/config/prefer-problems.d.ts.map +1 -0
  59. package/dist/config/prefer-problems.js +15 -0
  60. package/dist/config/prefer-problems.js.map +1 -0
  61. package/dist/config/prefer.d.ts +21 -0
  62. package/dist/config/prefer.d.ts.map +1 -0
  63. package/dist/config/prefer.js +35 -0
  64. package/dist/config/prefer.js.map +1 -0
  65. package/dist/config/term-problems.d.ts +5 -0
  66. package/dist/config/term-problems.d.ts.map +1 -0
  67. package/dist/config/term-problems.js +25 -0
  68. package/dist/config/term-problems.js.map +1 -0
  69. package/dist/config/warnings.d.ts +1 -1
  70. package/dist/config/warnings.d.ts.map +1 -1
  71. package/dist/config/warnings.js +9 -2
  72. package/dist/config/warnings.js.map +1 -1
  73. package/dist/cross-variants.d.ts +1 -1
  74. package/dist/cross-variants.d.ts.map +1 -1
  75. package/dist/cross-variants.js +4 -8
  76. package/dist/cross-variants.js.map +1 -1
  77. package/dist/cross-votes.d.ts +13 -0
  78. package/dist/cross-votes.d.ts.map +1 -1
  79. package/dist/cross-votes.js +25 -2
  80. package/dist/cross-votes.js.map +1 -1
  81. package/dist/custom/parse.d.ts +9 -0
  82. package/dist/custom/parse.d.ts.map +1 -1
  83. package/dist/custom/parse.js +11 -2
  84. package/dist/custom/parse.js.map +1 -1
  85. package/dist/custom/problems.d.ts.map +1 -1
  86. package/dist/custom/problems.js +9 -3
  87. package/dist/custom/problems.js.map +1 -1
  88. package/dist/custom/scope-field.d.ts +7 -0
  89. package/dist/custom/scope-field.d.ts.map +1 -0
  90. package/dist/custom/scope-field.js +14 -0
  91. package/dist/custom/scope-field.js.map +1 -0
  92. package/dist/date-format.d.ts +5 -3
  93. package/dist/date-format.d.ts.map +1 -1
  94. package/dist/date-format.js +30 -5
  95. package/dist/date-format.js.map +1 -1
  96. package/dist/derived/elapsed.d.ts +4 -1
  97. package/dist/derived/elapsed.d.ts.map +1 -1
  98. package/dist/derived/elapsed.js +11 -1
  99. package/dist/derived/elapsed.js.map +1 -1
  100. package/dist/detectors/acronym-context.d.ts +3 -1
  101. package/dist/detectors/acronym-context.d.ts.map +1 -1
  102. package/dist/detectors/acronym-context.js +7 -1
  103. package/dist/detectors/acronym-context.js.map +1 -1
  104. package/dist/detectors/acronym-gloss.d.ts +20 -7
  105. package/dist/detectors/acronym-gloss.d.ts.map +1 -1
  106. package/dist/detectors/acronym-gloss.js +50 -13
  107. package/dist/detectors/acronym-gloss.js.map +1 -1
  108. package/dist/detectors/bare-comparative.d.ts +4 -0
  109. package/dist/detectors/bare-comparative.d.ts.map +1 -1
  110. package/dist/detectors/bare-comparative.js +27 -3
  111. package/dist/detectors/bare-comparative.js.map +1 -1
  112. package/dist/detectors/blank-structure.d.ts +5 -1
  113. package/dist/detectors/blank-structure.d.ts.map +1 -1
  114. package/dist/detectors/blank-structure.js +13 -7
  115. package/dist/detectors/blank-structure.js.map +1 -1
  116. package/dist/detectors/bold-label.d.ts.map +1 -1
  117. package/dist/detectors/bold-label.js +12 -6
  118. package/dist/detectors/bold-label.js.map +1 -1
  119. package/dist/detectors/bracket-title-date.d.ts +6 -0
  120. package/dist/detectors/bracket-title-date.d.ts.map +1 -0
  121. package/dist/detectors/bracket-title-date.js +29 -0
  122. package/dist/detectors/bracket-title-date.js.map +1 -0
  123. package/dist/detectors/broken-link.d.ts.map +1 -1
  124. package/dist/detectors/broken-link.js +12 -1
  125. package/dist/detectors/broken-link.js.map +1 -1
  126. package/dist/detectors/capitalised-term.d.ts.map +1 -1
  127. package/dist/detectors/capitalised-term.js +24 -11
  128. package/dist/detectors/capitalised-term.js.map +1 -1
  129. package/dist/detectors/change-rate.d.ts.map +1 -1
  130. package/dist/detectors/change-rate.js +27 -4
  131. package/dist/detectors/change-rate.js.map +1 -1
  132. package/dist/detectors/char-shape.d.ts.map +1 -1
  133. package/dist/detectors/char-shape.js +12 -17
  134. package/dist/detectors/char-shape.js.map +1 -1
  135. package/dist/detectors/clause-shape.d.ts +4 -2
  136. package/dist/detectors/clause-shape.d.ts.map +1 -1
  137. package/dist/detectors/clause-shape.js +8 -4
  138. package/dist/detectors/clause-shape.js.map +1 -1
  139. package/dist/detectors/contraction-mix.d.ts.map +1 -1
  140. package/dist/detectors/contraction-mix.js +3 -2
  141. package/dist/detectors/contraction-mix.js.map +1 -1
  142. package/dist/detectors/contraction-set-apart.d.ts +7 -1
  143. package/dist/detectors/contraction-set-apart.d.ts.map +1 -1
  144. package/dist/detectors/contraction-set-apart.js +14 -1
  145. package/dist/detectors/contraction-set-apart.js.map +1 -1
  146. package/dist/detectors/coordinate-adjective.d.ts +5 -3
  147. package/dist/detectors/coordinate-adjective.d.ts.map +1 -1
  148. package/dist/detectors/coordinate-adjective.js +49 -1
  149. package/dist/detectors/coordinate-adjective.js.map +1 -1
  150. package/dist/detectors/count-per-section.d.ts.map +1 -1
  151. package/dist/detectors/count-per-section.js +29 -23
  152. package/dist/detectors/count-per-section.js.map +1 -1
  153. package/dist/detectors/counter-edge.d.ts +11 -0
  154. package/dist/detectors/counter-edge.d.ts.map +1 -1
  155. package/dist/detectors/counter-edge.js +17 -0
  156. package/dist/detectors/counter-edge.js.map +1 -1
  157. package/dist/detectors/cross-variant.d.ts.map +1 -1
  158. package/dist/detectors/cross-variant.js +14 -2
  159. package/dist/detectors/cross-variant.js.map +1 -1
  160. package/dist/detectors/custom.d.ts.map +1 -1
  161. package/dist/detectors/custom.js +6 -4
  162. package/dist/detectors/custom.js.map +1 -1
  163. package/dist/detectors/date-format.js +1 -1
  164. package/dist/detectors/date-format.js.map +1 -1
  165. package/dist/detectors/date-repeated-day.d.ts +11 -0
  166. package/dist/detectors/date-repeated-day.d.ts.map +1 -0
  167. package/dist/detectors/date-repeated-day.js +15 -0
  168. package/dist/detectors/date-repeated-day.js.map +1 -0
  169. package/dist/detectors/date-year.d.ts.map +1 -1
  170. package/dist/detectors/date-year.js +8 -1
  171. package/dist/detectors/date-year.js.map +1 -1
  172. package/dist/detectors/defined-term-form.d.ts.map +1 -1
  173. package/dist/detectors/defined-term-form.js +6 -3
  174. package/dist/detectors/defined-term-form.js.map +1 -1
  175. package/dist/detectors/definition-use.d.ts.map +1 -1
  176. package/dist/detectors/definition-use.js +7 -1
  177. package/dist/detectors/definition-use.js.map +1 -1
  178. package/dist/detectors/derived-numbers.d.ts.map +1 -1
  179. package/dist/detectors/derived-numbers.js +1 -0
  180. package/dist/detectors/derived-numbers.js.map +1 -1
  181. package/dist/detectors/document-shape.d.ts +1 -1
  182. package/dist/detectors/document-shape.d.ts.map +1 -1
  183. package/dist/detectors/document-shape.js +4 -1
  184. package/dist/detectors/document-shape.js.map +1 -1
  185. package/dist/detectors/email-letter.d.ts +3 -1
  186. package/dist/detectors/email-letter.d.ts.map +1 -1
  187. package/dist/detectors/email-letter.js +4 -2
  188. package/dist/detectors/email-letter.js.map +1 -1
  189. package/dist/detectors/empty-section.d.ts +1 -0
  190. package/dist/detectors/empty-section.d.ts.map +1 -1
  191. package/dist/detectors/empty-section.js +10 -1
  192. package/dist/detectors/empty-section.js.map +1 -1
  193. package/dist/detectors/en-shape.d.ts.map +1 -1
  194. package/dist/detectors/en-shape.js +15 -1
  195. package/dist/detectors/en-shape.js.map +1 -1
  196. package/dist/detectors/enumeration-marker.d.ts +7 -0
  197. package/dist/detectors/enumeration-marker.d.ts.map +1 -0
  198. package/dist/detectors/enumeration-marker.js +8 -0
  199. package/dist/detectors/enumeration-marker.js.map +1 -0
  200. package/dist/detectors/event-title-item.d.ts +8 -0
  201. package/dist/detectors/event-title-item.d.ts.map +1 -0
  202. package/dist/detectors/event-title-item.js +45 -0
  203. package/dist/detectors/event-title-item.js.map +1 -0
  204. package/dist/detectors/example-baseline.d.ts +5 -0
  205. package/dist/detectors/example-baseline.d.ts.map +1 -1
  206. package/dist/detectors/example-baseline.js +15 -1
  207. package/dist/detectors/example-baseline.js.map +1 -1
  208. package/dist/detectors/filler-word.d.ts +11 -0
  209. package/dist/detectors/filler-word.d.ts.map +1 -0
  210. package/dist/detectors/filler-word.js +73 -0
  211. package/dist/detectors/filler-word.js.map +1 -0
  212. package/dist/detectors/fullwidth-alnum.d.ts.map +1 -1
  213. package/dist/detectors/fullwidth-alnum.js +19 -0
  214. package/dist/detectors/fullwidth-alnum.js.map +1 -1
  215. package/dist/detectors/heading-case.d.ts.map +1 -1
  216. package/dist/detectors/heading-case.js +6 -1
  217. package/dist/detectors/heading-case.js.map +1 -1
  218. package/dist/detectors/heading-marker-no-space.d.ts +3 -0
  219. package/dist/detectors/heading-marker-no-space.d.ts.map +1 -0
  220. package/dist/detectors/heading-marker-no-space.js +49 -0
  221. package/dist/detectors/heading-marker-no-space.js.map +1 -0
  222. package/dist/detectors/hyphen-name-suffix.d.ts.map +1 -1
  223. package/dist/detectors/hyphen-name-suffix.js +3 -2
  224. package/dist/detectors/hyphen-name-suffix.js.map +1 -1
  225. package/dist/detectors/inline-item-label.d.ts +6 -0
  226. package/dist/detectors/inline-item-label.d.ts.map +1 -0
  227. package/dist/detectors/inline-item-label.js +68 -0
  228. package/dist/detectors/inline-item-label.js.map +1 -0
  229. package/dist/detectors/kanji-name-edge.d.ts +5 -0
  230. package/dist/detectors/kanji-name-edge.d.ts.map +1 -1
  231. package/dist/detectors/kanji-name-edge.js +9 -0
  232. package/dist/detectors/kanji-name-edge.js.map +1 -1
  233. package/dist/detectors/known-correction.d.ts.map +1 -1
  234. package/dist/detectors/known-correction.js +13 -1
  235. package/dist/detectors/known-correction.js.map +1 -1
  236. package/dist/detectors/link-definition.d.ts +3 -0
  237. package/dist/detectors/link-definition.d.ts.map +1 -0
  238. package/dist/detectors/link-definition.js +78 -0
  239. package/dist/detectors/link-definition.js.map +1 -0
  240. package/dist/detectors/list-item-asides.d.ts +7 -0
  241. package/dist/detectors/list-item-asides.d.ts.map +1 -0
  242. package/dist/detectors/list-item-asides.js +25 -0
  243. package/dist/detectors/list-item-asides.js.map +1 -0
  244. package/dist/detectors/list-item.d.ts +2 -0
  245. package/dist/detectors/list-item.d.ts.map +1 -1
  246. package/dist/detectors/list-item.js +6 -0
  247. package/dist/detectors/list-item.js.map +1 -1
  248. package/dist/detectors/list-items.d.ts.map +1 -1
  249. package/dist/detectors/list-items.js +12 -3
  250. package/dist/detectors/list-items.js.map +1 -1
  251. package/dist/detectors/list-opening-conjunction.d.ts +7 -0
  252. package/dist/detectors/list-opening-conjunction.d.ts.map +1 -0
  253. package/dist/detectors/list-opening-conjunction.js +22 -0
  254. package/dist/detectors/list-opening-conjunction.js.map +1 -0
  255. package/dist/detectors/list-parallel.d.ts.map +1 -1
  256. package/dist/detectors/list-parallel.js +11 -14
  257. package/dist/detectors/list-parallel.js.map +1 -1
  258. package/dist/detectors/list-run.d.ts.map +1 -1
  259. package/dist/detectors/list-run.js +15 -3
  260. package/dist/detectors/list-run.js.map +1 -1
  261. package/dist/detectors/list-verb-series.d.ts +6 -0
  262. package/dist/detectors/list-verb-series.d.ts.map +1 -0
  263. package/dist/detectors/list-verb-series.js +20 -0
  264. package/dist/detectors/list-verb-series.js.map +1 -0
  265. package/dist/detectors/mark-shape.d.ts +5 -2
  266. package/dist/detectors/mark-shape.d.ts.map +1 -1
  267. package/dist/detectors/mark-shape.js +12 -15
  268. package/dist/detectors/mark-shape.js.map +1 -1
  269. package/dist/detectors/markdown-slip.d.ts +5 -0
  270. package/dist/detectors/markdown-slip.d.ts.map +1 -1
  271. package/dist/detectors/markdown-slip.js +23 -0
  272. package/dist/detectors/markdown-slip.js.map +1 -1
  273. package/dist/detectors/marked-word.d.ts +10 -0
  274. package/dist/detectors/marked-word.d.ts.map +1 -0
  275. package/dist/detectors/marked-word.js +30 -0
  276. package/dist/detectors/marked-word.js.map +1 -0
  277. package/dist/detectors/middle-dot.d.ts +1 -1
  278. package/dist/detectors/middle-dot.d.ts.map +1 -1
  279. package/dist/detectors/middle-dot.js +21 -2
  280. package/dist/detectors/middle-dot.js.map +1 -1
  281. package/dist/detectors/missing-final-period.d.ts.map +1 -1
  282. package/dist/detectors/missing-final-period.js +8 -1
  283. package/dist/detectors/missing-final-period.js.map +1 -1
  284. package/dist/detectors/name-variant-two-things.d.ts +2 -1
  285. package/dist/detectors/name-variant-two-things.d.ts.map +1 -1
  286. package/dist/detectors/name-variant-two-things.js +30 -2
  287. package/dist/detectors/name-variant-two-things.js.map +1 -1
  288. package/dist/detectors/net-amount-mismatch.d.ts.map +1 -1
  289. package/dist/detectors/net-amount-mismatch.js +26 -4
  290. package/dist/detectors/net-amount-mismatch.js.map +1 -1
  291. package/dist/detectors/nominalization.d.ts.map +1 -1
  292. package/dist/detectors/nominalization.js +6 -1
  293. package/dist/detectors/nominalization.js.map +1 -1
  294. package/dist/detectors/number-style.d.ts +2 -0
  295. package/dist/detectors/number-style.d.ts.map +1 -1
  296. package/dist/detectors/number-style.js +5 -0
  297. package/dist/detectors/number-style.js.map +1 -1
  298. package/dist/detectors/ordinary-phrase.d.ts +5 -0
  299. package/dist/detectors/ordinary-phrase.d.ts.map +1 -1
  300. package/dist/detectors/ordinary-phrase.js +12 -0
  301. package/dist/detectors/ordinary-phrase.js.map +1 -1
  302. package/dist/detectors/organisation-run.d.ts +2 -0
  303. package/dist/detectors/organisation-run.d.ts.map +1 -1
  304. package/dist/detectors/organisation-run.js +7 -0
  305. package/dist/detectors/organisation-run.js.map +1 -1
  306. package/dist/detectors/orthographic-variant-kanji-word.d.ts +22 -0
  307. package/dist/detectors/orthographic-variant-kanji-word.d.ts.map +1 -0
  308. package/dist/detectors/orthographic-variant-kanji-word.js +27 -0
  309. package/dist/detectors/orthographic-variant-kanji-word.js.map +1 -0
  310. package/dist/detectors/orthographic-variant-open.d.ts.map +1 -1
  311. package/dist/detectors/orthographic-variant-open.js +2 -1
  312. package/dist/detectors/orthographic-variant-open.js.map +1 -1
  313. package/dist/detectors/orthographic-variant-text.d.ts +7 -0
  314. package/dist/detectors/orthographic-variant-text.d.ts.map +1 -0
  315. package/dist/detectors/orthographic-variant-text.js +14 -0
  316. package/dist/detectors/orthographic-variant-text.js.map +1 -0
  317. package/dist/detectors/orthographic-variant.d.ts.map +1 -1
  318. package/dist/detectors/orthographic-variant.js +22 -23
  319. package/dist/detectors/orthographic-variant.js.map +1 -1
  320. package/dist/detectors/orthography.d.ts.map +1 -1
  321. package/dist/detectors/orthography.js +12 -2
  322. package/dist/detectors/orthography.js.map +1 -1
  323. package/dist/detectors/oxford-comma.d.ts.map +1 -1
  324. package/dist/detectors/oxford-comma.js +14 -3
  325. package/dist/detectors/oxford-comma.js.map +1 -1
  326. package/dist/detectors/paragraph-run.d.ts +1 -1
  327. package/dist/detectors/paragraph-run.d.ts.map +1 -1
  328. package/dist/detectors/paragraph-run.js +4 -2
  329. package/dist/detectors/paragraph-run.js.map +1 -1
  330. package/dist/detectors/placeholder-text.d.ts.map +1 -1
  331. package/dist/detectors/placeholder-text.js +12 -4
  332. package/dist/detectors/placeholder-text.js.map +1 -1
  333. package/dist/detectors/placeholder.d.ts +1 -0
  334. package/dist/detectors/placeholder.d.ts.map +1 -1
  335. package/dist/detectors/placeholder.js +8 -0
  336. package/dist/detectors/placeholder.js.map +1 -1
  337. package/dist/detectors/pseudo-heading.d.ts +9 -0
  338. package/dist/detectors/pseudo-heading.d.ts.map +1 -0
  339. package/dist/detectors/pseudo-heading.js +54 -0
  340. package/dist/detectors/pseudo-heading.js.map +1 -0
  341. package/dist/detectors/quote-around.d.ts +1 -1
  342. package/dist/detectors/quote-around.d.ts.map +1 -1
  343. package/dist/detectors/quote-around.js +26 -5
  344. package/dist/detectors/quote-around.js.map +1 -1
  345. package/dist/detectors/quoted-label.d.ts +8 -0
  346. package/dist/detectors/quoted-label.d.ts.map +1 -0
  347. package/dist/detectors/quoted-label.js +18 -0
  348. package/dist/detectors/quoted-label.js.map +1 -0
  349. package/dist/detectors/ra-nuki.d.ts +1 -7
  350. package/dist/detectors/ra-nuki.d.ts.map +1 -1
  351. package/dist/detectors/ra-nuki.js +2 -27
  352. package/dist/detectors/ra-nuki.js.map +1 -1
  353. package/dist/detectors/register-required.d.ts +27 -0
  354. package/dist/detectors/register-required.d.ts.map +1 -0
  355. package/dist/detectors/register-required.js +33 -0
  356. package/dist/detectors/register-required.js.map +1 -0
  357. package/dist/detectors/register-voice.d.ts +13 -1
  358. package/dist/detectors/register-voice.d.ts.map +1 -1
  359. package/dist/detectors/register-voice.js +27 -0
  360. package/dist/detectors/register-voice.js.map +1 -1
  361. package/dist/detectors/registry/enumeration-marker.d.ts +3 -0
  362. package/dist/detectors/registry/enumeration-marker.d.ts.map +1 -0
  363. package/dist/detectors/registry/enumeration-marker.js +3 -0
  364. package/dist/detectors/registry/enumeration-marker.js.map +1 -0
  365. package/dist/detectors/registry/filler-word.d.ts +3 -0
  366. package/dist/detectors/registry/filler-word.d.ts.map +1 -0
  367. package/dist/detectors/registry/filler-word.js +3 -0
  368. package/dist/detectors/registry/filler-word.js.map +1 -0
  369. package/dist/detectors/registry/heading-marker-no-space.d.ts +3 -0
  370. package/dist/detectors/registry/heading-marker-no-space.d.ts.map +1 -0
  371. package/dist/detectors/registry/heading-marker-no-space.js +3 -0
  372. package/dist/detectors/registry/heading-marker-no-space.js.map +1 -0
  373. package/dist/detectors/registry/link-definition-unused.d.ts +3 -0
  374. package/dist/detectors/registry/link-definition-unused.d.ts.map +1 -0
  375. package/dist/detectors/registry/link-definition-unused.js +3 -0
  376. package/dist/detectors/registry/link-definition-unused.js.map +1 -0
  377. package/dist/detectors/registry/pseudo-heading.d.ts +3 -0
  378. package/dist/detectors/registry/pseudo-heading.d.ts.map +1 -0
  379. package/dist/detectors/registry/pseudo-heading.js +3 -0
  380. package/dist/detectors/registry/pseudo-heading.js.map +1 -0
  381. package/dist/detectors/registry/reversed-link.d.ts +3 -0
  382. package/dist/detectors/registry/reversed-link.d.ts.map +1 -0
  383. package/dist/detectors/registry/reversed-link.js +3 -0
  384. package/dist/detectors/registry/reversed-link.js.map +1 -0
  385. package/dist/detectors/registry/sa-ire.d.ts +3 -0
  386. package/dist/detectors/registry/sa-ire.d.ts.map +1 -0
  387. package/dist/detectors/registry/sa-ire.js +3 -0
  388. package/dist/detectors/registry/sa-ire.js.map +1 -0
  389. package/dist/detectors/registry/table-absorbed-line.d.ts +3 -0
  390. package/dist/detectors/registry/table-absorbed-line.d.ts.map +1 -0
  391. package/dist/detectors/registry/table-absorbed-line.js +3 -0
  392. package/dist/detectors/registry/table-absorbed-line.js.map +1 -0
  393. package/dist/detectors/registry/term-consistency.d.ts +3 -0
  394. package/dist/detectors/registry/term-consistency.d.ts.map +1 -0
  395. package/dist/detectors/registry/term-consistency.js +3 -0
  396. package/dist/detectors/registry/term-consistency.js.map +1 -0
  397. package/dist/detectors/registry/term-form.d.ts +3 -0
  398. package/dist/detectors/registry/term-form.d.ts.map +1 -0
  399. package/dist/detectors/registry/term-form.js +3 -0
  400. package/dist/detectors/registry/term-form.js.map +1 -0
  401. package/dist/detectors/relative-pronoun-mix.d.ts +1 -1
  402. package/dist/detectors/relative-pronoun-mix.d.ts.map +1 -1
  403. package/dist/detectors/relative-pronoun-mix.js +14 -3
  404. package/dist/detectors/relative-pronoun-mix.js.map +1 -1
  405. package/dist/detectors/release-notes.d.ts +7 -0
  406. package/dist/detectors/release-notes.d.ts.map +1 -0
  407. package/dist/detectors/release-notes.js +12 -0
  408. package/dist/detectors/release-notes.js.map +1 -0
  409. package/dist/detectors/request-owner.d.ts +5 -1
  410. package/dist/detectors/request-owner.d.ts.map +1 -1
  411. package/dist/detectors/request-owner.js +53 -1
  412. package/dist/detectors/request-owner.js.map +1 -1
  413. package/dist/detectors/reversed-link.d.ts +3 -0
  414. package/dist/detectors/reversed-link.d.ts.map +1 -0
  415. package/dist/detectors/reversed-link.js +31 -0
  416. package/dist/detectors/reversed-link.js.map +1 -0
  417. package/dist/detectors/sa-ire.d.ts +3 -0
  418. package/dist/detectors/sa-ire.d.ts.map +1 -0
  419. package/dist/detectors/sa-ire.js +5 -0
  420. package/dist/detectors/sa-ire.js.map +1 -0
  421. package/dist/detectors/sentence-counts.d.ts.map +1 -1
  422. package/dist/detectors/sentence-counts.js +19 -6
  423. package/dist/detectors/sentence-counts.js.map +1 -1
  424. package/dist/detectors/sentence-ending.d.ts.map +1 -1
  425. package/dist/detectors/sentence-ending.js +35 -11
  426. package/dist/detectors/sentence-ending.js.map +1 -1
  427. package/dist/detectors/sentence-length.d.ts.map +1 -1
  428. package/dist/detectors/sentence-length.js +11 -1
  429. package/dist/detectors/sentence-length.js.map +1 -1
  430. package/dist/detectors/sentence-rhythm.d.ts.map +1 -1
  431. package/dist/detectors/sentence-rhythm.js +6 -2
  432. package/dist/detectors/sentence-rhythm.js.map +1 -1
  433. package/dist/detectors/signals.js +2 -2
  434. package/dist/detectors/signals.js.map +1 -1
  435. package/dist/detectors/structure.d.ts +1 -0
  436. package/dist/detectors/structure.d.ts.map +1 -1
  437. package/dist/detectors/structure.js +5 -0
  438. package/dist/detectors/structure.js.map +1 -1
  439. package/dist/detectors/technical-docs.d.ts +8 -1
  440. package/dist/detectors/technical-docs.d.ts.map +1 -1
  441. package/dist/detectors/technical-docs.js +16 -3
  442. package/dist/detectors/technical-docs.js.map +1 -1
  443. package/dist/detectors/term-consistency.d.ts +4 -0
  444. package/dist/detectors/term-consistency.d.ts.map +1 -0
  445. package/dist/detectors/term-consistency.js +35 -0
  446. package/dist/detectors/term-consistency.js.map +1 -0
  447. package/dist/detectors/term-form.d.ts +4 -0
  448. package/dist/detectors/term-form.d.ts.map +1 -0
  449. package/dist/detectors/term-form.js +17 -0
  450. package/dist/detectors/term-form.js.map +1 -0
  451. package/dist/detectors/token-shape.d.ts.map +1 -1
  452. package/dist/detectors/token-shape.js +4 -1
  453. package/dist/detectors/token-shape.js.map +1 -1
  454. package/dist/detectors/unbalanced-bracket.d.ts +1 -1
  455. package/dist/detectors/unbalanced-bracket.d.ts.map +1 -1
  456. package/dist/detectors/unbalanced-bracket.js +4 -2
  457. package/dist/detectors/unbalanced-bracket.js.map +1 -1
  458. package/dist/detectors/unknown-word-context.d.ts +2 -0
  459. package/dist/detectors/unknown-word-context.d.ts.map +1 -1
  460. package/dist/detectors/unknown-word-context.js +3 -0
  461. package/dist/detectors/unknown-word-context.js.map +1 -1
  462. package/dist/detectors/unknown-word.d.ts.map +1 -1
  463. package/dist/detectors/unknown-word.js +7 -2
  464. package/dist/detectors/unknown-word.js.map +1 -1
  465. package/dist/detectors/vague-density.d.ts.map +1 -1
  466. package/dist/detectors/vague-density.js +10 -2
  467. package/dist/detectors/vague-density.js.map +1 -1
  468. package/dist/detectors/version-mismatch.d.ts.map +1 -1
  469. package/dist/detectors/version-mismatch.js +5 -1
  470. package/dist/detectors/version-mismatch.js.map +1 -1
  471. package/dist/detectors/weasel-word.d.ts.map +1 -1
  472. package/dist/detectors/weasel-word.js +11 -2
  473. package/dist/detectors/weasel-word.js.map +1 -1
  474. package/dist/document-prose.d.ts +17 -0
  475. package/dist/document-prose.d.ts.map +1 -0
  476. package/dist/document-prose.js +35 -0
  477. package/dist/document-prose.js.map +1 -0
  478. package/dist/document-scope.d.ts +16 -0
  479. package/dist/document-scope.d.ts.map +1 -0
  480. package/dist/document-scope.js +51 -0
  481. package/dist/document-scope.js.map +1 -0
  482. package/dist/document.d.ts +10 -1
  483. package/dist/document.d.ts.map +1 -1
  484. package/dist/document.js +26 -37
  485. package/dist/document.js.map +1 -1
  486. package/dist/enumeration-marks.d.ts +23 -0
  487. package/dist/enumeration-marks.d.ts.map +1 -0
  488. package/dist/enumeration-marks.js +184 -0
  489. package/dist/enumeration-marks.js.map +1 -0
  490. package/dist/facts/cross-facts.d.ts +1 -1
  491. package/dist/facts/cross-facts.d.ts.map +1 -1
  492. package/dist/facts/cross-facts.js +8 -3
  493. package/dist/facts/cross-facts.js.map +1 -1
  494. package/dist/facts/labelled-facts.d.ts.map +1 -1
  495. package/dist/facts/labelled-facts.js +7 -4
  496. package/dist/facts/labelled-facts.js.map +1 -1
  497. package/dist/file-header.d.ts +2 -6
  498. package/dist/file-header.d.ts.map +1 -1
  499. package/dist/file-header.js +1 -1
  500. package/dist/file-header.js.map +1 -1
  501. package/dist/files.d.ts +18 -1
  502. package/dist/files.d.ts.map +1 -1
  503. package/dist/files.js +58 -8
  504. package/dist/files.js.map +1 -1
  505. package/dist/gitignore.d.ts +30 -0
  506. package/dist/gitignore.d.ts.map +1 -0
  507. package/dist/gitignore.js +68 -0
  508. package/dist/gitignore.js.map +1 -0
  509. package/dist/grade/stamp.d.ts.map +1 -1
  510. package/dist/grade/stamp.js +5 -0
  511. package/dist/grade/stamp.js.map +1 -1
  512. package/dist/latin-word-boundary.d.ts +5 -0
  513. package/dist/latin-word-boundary.d.ts.map +1 -1
  514. package/dist/latin-word-boundary.js +11 -0
  515. package/dist/latin-word-boundary.js.map +1 -1
  516. package/dist/markdown-node.d.ts +1 -0
  517. package/dist/markdown-node.d.ts.map +1 -1
  518. package/dist/markdown-node.js.map +1 -1
  519. package/dist/name-separator.d.ts.map +1 -1
  520. package/dist/name-separator.js +27 -5
  521. package/dist/name-separator.js.map +1 -1
  522. package/dist/news-dateline.d.ts +7 -0
  523. package/dist/news-dateline.d.ts.map +1 -0
  524. package/dist/news-dateline.js +24 -0
  525. package/dist/news-dateline.js.map +1 -0
  526. package/dist/plugin.d.ts +24 -0
  527. package/dist/plugin.d.ts.map +1 -1
  528. package/dist/reasons.d.ts +4 -0
  529. package/dist/reasons.d.ts.map +1 -1
  530. package/dist/reasons.js +4 -0
  531. package/dist/reasons.js.map +1 -1
  532. package/dist/render/explain.d.ts +3 -0
  533. package/dist/render/explain.d.ts.map +1 -1
  534. package/dist/render/explain.js +19 -1
  535. package/dist/render/explain.js.map +1 -1
  536. package/dist/render/rules-json.d.ts.map +1 -1
  537. package/dist/render/rules-json.js +12 -2
  538. package/dist/render/rules-json.js.map +1 -1
  539. package/dist/render/summary.d.ts +5 -2
  540. package/dist/render/summary.d.ts.map +1 -1
  541. package/dist/render/summary.js +25 -4
  542. package/dist/render/summary.js.map +1 -1
  543. package/dist/render/suppressions.d.ts +6 -1
  544. package/dist/render/suppressions.d.ts.map +1 -1
  545. package/dist/render/suppressions.js +76 -3
  546. package/dist/render/suppressions.js.map +1 -1
  547. package/dist/rule-load.d.ts.map +1 -1
  548. package/dist/rule-load.js +2 -1
  549. package/dist/rule-load.js.map +1 -1
  550. package/dist/run-in-title.d.ts +4 -0
  551. package/dist/run-in-title.d.ts.map +1 -0
  552. package/dist/run-in-title.js +82 -0
  553. package/dist/run-in-title.js.map +1 -0
  554. package/dist/run.d.ts +2 -0
  555. package/dist/run.d.ts.map +1 -1
  556. package/dist/run.js +20 -8
  557. package/dist/run.js.map +1 -1
  558. package/dist/scope-markers.d.ts +9 -0
  559. package/dist/scope-markers.d.ts.map +1 -0
  560. package/dist/scope-markers.js +19 -0
  561. package/dist/scope-markers.js.map +1 -0
  562. package/dist/scope-problem-text.d.ts +4 -0
  563. package/dist/scope-problem-text.d.ts.map +1 -0
  564. package/dist/scope-problem-text.js +17 -0
  565. package/dist/scope-problem-text.js.map +1 -0
  566. package/dist/scoped-sentences.d.ts +21 -0
  567. package/dist/scoped-sentences.d.ts.map +1 -0
  568. package/dist/scoped-sentences.js +21 -0
  569. package/dist/scoped-sentences.js.map +1 -0
  570. package/dist/setting-problems.d.ts.map +1 -1
  571. package/dist/setting-problems.js +4 -0
  572. package/dist/setting-problems.js.map +1 -1
  573. package/dist/spelling.js +4 -4
  574. package/dist/spelling.js.map +1 -1
  575. package/dist/stet-body.d.ts +13 -0
  576. package/dist/stet-body.d.ts.map +1 -0
  577. package/dist/stet-body.js +49 -0
  578. package/dist/stet-body.js.map +1 -0
  579. package/dist/stet.d.ts +30 -4
  580. package/dist/stet.d.ts.map +1 -1
  581. package/dist/stet.js +78 -28
  582. package/dist/stet.js.map +1 -1
  583. package/dist/structure/alert-lines.d.ts +4 -0
  584. package/dist/structure/alert-lines.d.ts.map +1 -0
  585. package/dist/structure/alert-lines.js +19 -0
  586. package/dist/structure/alert-lines.js.map +1 -0
  587. package/dist/structure/catch-all-row-blank.d.ts +9 -0
  588. package/dist/structure/catch-all-row-blank.d.ts.map +1 -0
  589. package/dist/structure/catch-all-row-blank.js +19 -0
  590. package/dist/structure/catch-all-row-blank.js.map +1 -0
  591. package/dist/structure/change-rate-tied.d.ts +22 -0
  592. package/dist/structure/change-rate-tied.d.ts.map +1 -0
  593. package/dist/structure/change-rate-tied.js +85 -0
  594. package/dist/structure/change-rate-tied.js.map +1 -0
  595. package/dist/structure/cross-definitions.d.ts +1 -1
  596. package/dist/structure/cross-definitions.d.ts.map +1 -1
  597. package/dist/structure/cross-definitions.js +3 -9
  598. package/dist/structure/cross-definitions.js.map +1 -1
  599. package/dist/structure/defining-names.d.ts +1 -1
  600. package/dist/structure/defining-names.d.ts.map +1 -1
  601. package/dist/structure/defining-names.js +12 -1
  602. package/dist/structure/defining-names.js.map +1 -1
  603. package/dist/structure/net-amount.d.ts +16 -0
  604. package/dist/structure/net-amount.d.ts.map +1 -1
  605. package/dist/structure/net-amount.js +28 -1
  606. package/dist/structure/net-amount.js.map +1 -1
  607. package/dist/structure/period-label-conflict.d.ts +2 -2
  608. package/dist/structure/period-label-conflict.d.ts.map +1 -1
  609. package/dist/structure/period-label-conflict.js +17 -3
  610. package/dist/structure/period-label-conflict.js.map +1 -1
  611. package/dist/structure/serial-range.d.ts.map +1 -1
  612. package/dist/structure/serial-range.js +14 -6
  613. package/dist/structure/serial-range.js.map +1 -1
  614. package/dist/structure/version-mismatch.d.ts +6 -1
  615. package/dist/structure/version-mismatch.d.ts.map +1 -1
  616. package/dist/structure/version-mismatch.js +28 -6
  617. package/dist/structure/version-mismatch.js.map +1 -1
  618. package/dist/structure/weekday.d.ts.map +1 -1
  619. package/dist/structure/weekday.js +14 -1
  620. package/dist/structure/weekday.js.map +1 -1
  621. package/dist/table-cells.d.ts +1 -1
  622. package/dist/table-cells.d.ts.map +1 -1
  623. package/dist/table-cells.js.map +1 -1
  624. package/dist/term-form.d.ts +15 -0
  625. package/dist/term-form.d.ts.map +1 -0
  626. package/dist/term-form.js +72 -0
  627. package/dist/term-form.js.map +1 -0
  628. package/dist/term-groups.d.ts +33 -0
  629. package/dist/term-groups.d.ts.map +1 -0
  630. package/dist/term-groups.js +46 -0
  631. package/dist/term-groups.js.map +1 -0
  632. package/dist/text-scope.d.ts +35 -0
  633. package/dist/text-scope.d.ts.map +1 -0
  634. package/dist/text-scope.js +55 -0
  635. package/dist/text-scope.js.map +1 -0
  636. package/dist/topic-clause.d.ts.map +1 -1
  637. package/dist/topic-clause.js +85 -16
  638. package/dist/topic-clause.js.map +1 -1
  639. package/dist/unclosed-code-quote.d.ts +7 -0
  640. package/dist/unclosed-code-quote.d.ts.map +1 -0
  641. package/dist/unclosed-code-quote.js +37 -0
  642. package/dist/unclosed-code-quote.js.map +1 -0
  643. package/package.json +4 -3
  644. package/rules/adverb-overuse.yaml +2 -2
  645. package/rules/bold-density.yaml +2 -2
  646. package/rules/bold-label-list.yaml +2 -2
  647. package/rules/bracket-width-consistency.yaml +2 -2
  648. package/rules/broken-link.yaml +2 -2
  649. package/rules/change-rate-mismatch.yaml +2 -2
  650. package/rules/code-fence-language-mix.yaml +2 -2
  651. package/rules/comparative-without-baseline.yaml +2 -2
  652. package/rules/contraction-consistency.yaml +3 -3
  653. package/rules/cross-doc-duplicate-definition.yaml +2 -2
  654. package/rules/cross-doc-fact-conflict.yaml +2 -2
  655. package/rules/cross-doc-term-variant.yaml +4 -4
  656. package/rules/date-format-consistency.yaml +2 -2
  657. package/rules/date-weekday-mismatch.yaml +2 -2
  658. package/rules/date-without-year.yaml +2 -2
  659. package/rules/defined-term-form.yaml +2 -2
  660. package/rules/elapsed-years-mismatch.yaml +2 -2
  661. package/rules/empty-section.yaml +2 -2
  662. package/rules/empty-table-cell.yaml +2 -2
  663. package/rules/enumeration-marker-mix.yaml +102 -0
  664. package/rules/filler-word.yaml +74 -0
  665. package/rules/fullwidth-alnum-consistency.yaml +2 -2
  666. package/rules/heading-marker-no-space.yaml +79 -0
  667. package/rules/hyphen-as-dash.yaml +2 -2
  668. package/rules/known-misspelling.yaml +2 -2
  669. package/rules/latin-spacing.yaml +4 -4
  670. package/rules/link-definition-unused.yaml +107 -0
  671. package/rules/list-item-form-mix.yaml +2 -2
  672. package/rules/max-kanji-continuous.yaml +5 -2
  673. package/rules/max-sentence-length.yaml +2 -2
  674. package/rules/missing-final-period.yaml +2 -2
  675. package/rules/name-variant.yaml +2 -2
  676. package/rules/net-amount-mismatch.yaml +5 -5
  677. package/rules/no-doubled-joshi.yaml +2 -2
  678. package/rules/no-mixed-desumasu.yaml +62 -2
  679. package/rules/no-nakaguro-parallel.yaml +2 -2
  680. package/rules/nominalization.yaml +2 -2
  681. package/rules/number-style-consistency.yaml +2 -2
  682. package/rules/obligation-without-deadline.yaml +2 -2
  683. package/rules/one-sentence-paragraph-run.yaml +2 -2
  684. package/rules/orthographic-variant.yaml +2 -2
  685. package/rules/oxford-comma-consistency.yaml +2 -2
  686. package/rules/period-label-conflict.yaml +2 -2
  687. package/rules/preamble-length.yaml +2 -2
  688. package/rules/pseudo-heading.yaml +79 -0
  689. package/rules/quote-without-source.yaml +2 -2
  690. package/rules/repeated-sentence-ending.yaml +2 -2
  691. package/rules/request-without-deadline.yaml +2 -2
  692. package/rules/reversed-link.yaml +78 -0
  693. package/rules/sa-ire.yaml +43 -0
  694. package/rules/sentence-rhythm.yaml +2 -2
  695. package/rules/serial-range-reversed.yaml +4 -4
  696. package/rules/shell-prompt-mix.yaml +2 -2
  697. package/rules/table-absorbed-line.yaml +88 -0
  698. package/rules/teki-overuse.yaml +2 -2
  699. package/rules/term-consistency.yaml +56 -0
  700. package/rules/term-form.yaml +56 -0
  701. package/rules/title-case-consistency.yaml +4 -4
  702. package/rules/title-length.yaml +2 -2
  703. package/rules/topic-predicate-distance.yaml +2 -2
  704. package/rules/unbalanced-bracket.yaml +2 -2
  705. package/rules/undefined-acronym.yaml +4 -2
  706. package/rules/undefined-term.yaml +2 -2
  707. package/rules/unfilled-placeholder.yaml +2 -2
  708. package/rules/unknown-word.yaml +2 -2
  709. package/rules/use-before-definition.yaml +2 -2
  710. package/rules/vague-word-density.yaml +2 -2
  711. package/rules/version-mismatch.yaml +2 -2
  712. package/rules/weasel-word.yaml +3 -3
  713. package/rules/which-that-consistency.yaml +2 -2
  714. package/skills/chaff/SKILL.md +51 -7
  715. package/src/allow.ts +146 -0
  716. package/src/check-source.ts +33 -9
  717. package/src/cli-text.ts +13 -4
  718. package/src/cli.ts +16 -15
  719. package/src/commands/eval.ts +1 -1
  720. package/src/commands/suppressions.ts +3 -3
  721. package/src/commands/test.ts +1 -1
  722. package/src/compound-head.ts +17 -8
  723. package/src/config/allow-problems.ts +75 -0
  724. package/src/config/by-path-problems.ts +29 -3
  725. package/src/config/by-path-rules.ts +78 -0
  726. package/src/config/by-path.ts +9 -0
  727. package/src/config/consistent-problems.ts +36 -0
  728. package/src/config/load.ts +87 -15
  729. package/src/config/option-problems.ts +8 -5
  730. package/src/config/prefer-problems.ts +22 -0
  731. package/src/config/prefer.ts +52 -0
  732. package/src/config/term-problems.ts +38 -0
  733. package/src/config/warnings.ts +9 -2
  734. package/src/cross-variants.ts +4 -7
  735. package/src/cross-votes.ts +35 -4
  736. package/src/custom/parse.ts +16 -3
  737. package/src/custom/problems.ts +9 -3
  738. package/src/custom/scope-field.ts +16 -0
  739. package/src/date-format.ts +43 -8
  740. package/src/derived/elapsed.ts +17 -2
  741. package/src/detectors/acronym-context.ts +7 -1
  742. package/src/detectors/acronym-gloss.ts +59 -11
  743. package/src/detectors/bare-comparative.ts +35 -3
  744. package/src/detectors/blank-structure.ts +18 -9
  745. package/src/detectors/bold-label.ts +7 -2
  746. package/src/detectors/bracket-title-date.ts +36 -0
  747. package/src/detectors/broken-link.ts +14 -1
  748. package/src/detectors/capitalised-term.ts +18 -4
  749. package/src/detectors/change-rate.ts +29 -4
  750. package/src/detectors/char-shape.ts +13 -17
  751. package/src/detectors/clause-shape.ts +8 -4
  752. package/src/detectors/contraction-mix.ts +8 -2
  753. package/src/detectors/contraction-set-apart.ts +22 -2
  754. package/src/detectors/coordinate-adjective.ts +54 -1
  755. package/src/detectors/count-per-section.ts +13 -8
  756. package/src/detectors/counter-edge.ts +20 -0
  757. package/src/detectors/cross-variant.ts +16 -2
  758. package/src/detectors/custom.ts +6 -4
  759. package/src/detectors/date-format.ts +1 -1
  760. package/src/detectors/date-repeated-day.ts +20 -0
  761. package/src/detectors/date-year.ts +8 -1
  762. package/src/detectors/defined-term-form.ts +6 -3
  763. package/src/detectors/definition-use.ts +7 -1
  764. package/src/detectors/derived-numbers.ts +1 -0
  765. package/src/detectors/document-shape.ts +4 -1
  766. package/src/detectors/email-letter.ts +6 -2
  767. package/src/detectors/empty-section.ts +10 -2
  768. package/src/detectors/en-shape.ts +17 -1
  769. package/src/detectors/enumeration-marker.ts +14 -0
  770. package/src/detectors/event-title-item.ts +57 -0
  771. package/src/detectors/example-baseline.ts +16 -1
  772. package/src/detectors/filler-word.ts +96 -0
  773. package/src/detectors/fullwidth-alnum.ts +24 -0
  774. package/src/detectors/heading-case.ts +7 -1
  775. package/src/detectors/heading-marker-no-space.ts +62 -0
  776. package/src/detectors/hyphen-name-suffix.ts +3 -2
  777. package/src/detectors/inline-item-label.ts +98 -0
  778. package/src/detectors/kanji-name-edge.ts +11 -0
  779. package/src/detectors/known-correction.ts +17 -1
  780. package/src/detectors/link-definition.ts +91 -0
  781. package/src/detectors/list-item-asides.ts +29 -0
  782. package/src/detectors/list-item.ts +7 -0
  783. package/src/detectors/list-items.ts +13 -2
  784. package/src/detectors/list-opening-conjunction.ts +22 -0
  785. package/src/detectors/list-parallel.ts +11 -15
  786. package/src/detectors/list-run.ts +16 -3
  787. package/src/detectors/list-verb-series.ts +24 -0
  788. package/src/detectors/mark-shape.ts +15 -19
  789. package/src/detectors/markdown-slip.ts +25 -1
  790. package/src/detectors/marked-word.ts +40 -0
  791. package/src/detectors/middle-dot.ts +27 -2
  792. package/src/detectors/missing-final-period.ts +9 -1
  793. package/src/detectors/name-variant-two-things.ts +37 -2
  794. package/src/detectors/net-amount-mismatch.ts +41 -4
  795. package/src/detectors/nominalization.ts +8 -1
  796. package/src/detectors/number-style.ts +8 -0
  797. package/src/detectors/ordinary-phrase.ts +13 -0
  798. package/src/detectors/organisation-run.ts +9 -0
  799. package/src/detectors/orthographic-variant-kanji-word.ts +33 -0
  800. package/src/detectors/orthographic-variant-open.ts +2 -1
  801. package/src/detectors/orthographic-variant-text.ts +20 -0
  802. package/src/detectors/orthographic-variant.ts +25 -32
  803. package/src/detectors/orthography.ts +18 -2
  804. package/src/detectors/oxford-comma.ts +14 -2
  805. package/src/detectors/paragraph-run.ts +7 -10
  806. package/src/detectors/placeholder-text.ts +22 -5
  807. package/src/detectors/placeholder.ts +10 -0
  808. package/src/detectors/pseudo-heading.ts +59 -0
  809. package/src/detectors/quote-around.ts +31 -6
  810. package/src/detectors/quoted-label.ts +22 -0
  811. package/src/detectors/ra-nuki.ts +3 -34
  812. package/src/detectors/register-required.ts +56 -0
  813. package/src/detectors/register-voice.ts +36 -1
  814. package/src/detectors/registry/enumeration-marker.ts +4 -0
  815. package/src/detectors/registry/filler-word.ts +4 -0
  816. package/src/detectors/registry/heading-marker-no-space.ts +4 -0
  817. package/src/detectors/registry/link-definition-unused.ts +4 -0
  818. package/src/detectors/registry/pseudo-heading.ts +4 -0
  819. package/src/detectors/registry/reversed-link.ts +4 -0
  820. package/src/detectors/registry/sa-ire.ts +4 -0
  821. package/src/detectors/registry/table-absorbed-line.ts +4 -0
  822. package/src/detectors/registry/term-consistency.ts +4 -0
  823. package/src/detectors/registry/term-form.ts +4 -0
  824. package/src/detectors/relative-pronoun-mix.ts +18 -3
  825. package/src/detectors/release-notes.ts +19 -0
  826. package/src/detectors/request-owner.ts +62 -2
  827. package/src/detectors/reversed-link.ts +39 -0
  828. package/src/detectors/sa-ire.ts +7 -0
  829. package/src/detectors/sentence-counts.ts +28 -9
  830. package/src/detectors/sentence-ending.ts +53 -12
  831. package/src/detectors/sentence-length.ts +16 -2
  832. package/src/detectors/sentence-rhythm.ts +6 -2
  833. package/src/detectors/signals.ts +2 -2
  834. package/src/detectors/structure.ts +4 -0
  835. package/src/detectors/technical-docs.ts +27 -3
  836. package/src/detectors/term-consistency.ts +41 -0
  837. package/src/detectors/term-form.ts +17 -0
  838. package/src/detectors/token-shape.ts +4 -1
  839. package/src/detectors/unbalanced-bracket.ts +4 -2
  840. package/src/detectors/unknown-word-context.ts +6 -0
  841. package/src/detectors/unknown-word.ts +7 -1
  842. package/src/detectors/vague-density.ts +10 -2
  843. package/src/detectors/version-mismatch.ts +7 -1
  844. package/src/detectors/weasel-word.ts +13 -2
  845. package/src/document-prose.ts +43 -0
  846. package/src/document-scope.ts +66 -0
  847. package/src/document.ts +43 -50
  848. package/src/enumeration-marks.ts +233 -0
  849. package/src/facts/cross-facts.ts +10 -4
  850. package/src/facts/labelled-facts.ts +7 -4
  851. package/src/file-header.ts +3 -5
  852. package/src/files.ts +87 -8
  853. package/src/gitignore.ts +83 -0
  854. package/src/grade/stamp.ts +5 -0
  855. package/src/latin-word-boundary.ts +12 -0
  856. package/src/markdown-node.ts +1 -0
  857. package/src/name-separator.ts +29 -7
  858. package/src/news-dateline.ts +29 -0
  859. package/src/plugin.ts +21 -3
  860. package/src/reasons.ts +8 -0
  861. package/src/render/explain.ts +26 -1
  862. package/src/render/rules-json.ts +16 -2
  863. package/src/render/summary.ts +33 -4
  864. package/src/render/suppressions.ts +101 -4
  865. package/src/rule-load.ts +3 -2
  866. package/src/run-in-title.ts +91 -0
  867. package/src/run.ts +21 -8
  868. package/src/scope-markers.ts +25 -0
  869. package/src/scope-problem-text.ts +21 -0
  870. package/src/scoped-sentences.ts +41 -0
  871. package/src/setting-problems.ts +4 -0
  872. package/src/spelling.ts +4 -4
  873. package/src/stet-body.ts +74 -0
  874. package/src/stet.ts +113 -32
  875. package/src/structure/alert-lines.ts +19 -0
  876. package/src/structure/catch-all-row-blank.ts +22 -0
  877. package/src/structure/change-rate-tied.ts +113 -0
  878. package/src/structure/cross-definitions.ts +6 -9
  879. package/src/structure/defining-names.ts +14 -1
  880. package/src/structure/net-amount.ts +44 -5
  881. package/src/structure/period-label-conflict.ts +22 -7
  882. package/src/structure/serial-range.ts +14 -6
  883. package/src/structure/version-mismatch.ts +41 -8
  884. package/src/structure/weekday.ts +14 -1
  885. package/src/table-cells.ts +2 -2
  886. package/src/term-form.ts +99 -0
  887. package/src/term-groups.ts +68 -0
  888. package/src/text-scope.ts +79 -0
  889. package/src/topic-clause.ts +96 -17
  890. package/src/unclosed-code-quote.ts +42 -0
@@ -31,7 +31,9 @@ read. A contract checked as a blog post gets wrong findings, so choose the genre
31
31
  guessed or default genre shows no guide, and `--no-guide` leaves it out.
32
32
 
33
33
  A rule the genre turns off is listed under "did not run" with the genre as the reason. That is the preset's
34
- choice, not a gap; turn it back on (`rules:` in `chaff.yaml`) only when the person asks. Some of these are off
34
+ choice, not a gap; turn it back on (`rules:` in `chaff.yaml`) only when the person asks. For minutes or notes made
35
+ from a transcript, use a business genre (`business/meeting-notes`): `filler-word` then reports fillers left in (ええと,
36
+ um, you know). `speech/transcript` is for a verbatim record and keeps them. Some of these are off
35
37
  because chaff measured them to be mostly wrong for that kind of document on real, judged documents
36
38
  ([isamu/chaff-corpus](https://github.com/isamu/chaff-corpus)); turning one back on brings those false findings back.
37
39
 
@@ -51,6 +53,9 @@ After the findings comes the list of rules that did not run, and why. Only the d
51
53
  the genre: a rule that compares documents runs only when chaff is given two or more files or a folder, and a rule
52
54
  that reads meaning runs only under `npx chaffjs test` (below).
53
55
 
56
+ Some rules read only one language and say so when they do not run: `ra-nuki` (見れる for 見られる) and `sa-ire`
57
+ (読まさせて for 読ませて) are Japanese only.
58
+
54
59
  A run over several files prints only the files that have findings. To call one file clean, run chaff on that
55
60
  file alone and read its list.
56
61
 
@@ -72,7 +77,8 @@ calls nothing. Ask the person before a real run; the passages leave the machine.
72
77
  | | When | How |
73
78
  | --- | --- | --- |
74
79
  | Fix the text | The finding is right | Edit the sentence. Keep the meaning, the facts and the numbers; change only how it is said. |
75
- | Silence that spot | Right in general, wrong here (a quotation, a term that must repeat) | `<!-- stet: rule-id — reason -->` before it; `stet-section` / `stet-file` for wider scope. Always give the reason. |
80
+ | Silence that spot | Right in general, wrong here (a quotation, a term that must repeat) | `<!-- stet: rule-id — reason -->` before it; `stet-section` / `stet-file` for wider scope, `<!-- stet-begin: rule-id — reason -->` … `<!-- stet-end -->` for a range, `rule-id["word"]` to silence one matched word only. Always name the rules (there is no all-rules form) and give the reason. |
81
+ | Allow that text everywhere | The same text is always right for this team (a product name, a quoted form) | An entry under `allow:` in `chaff.yaml`: `text:` (literal) or `pattern:` (regex), `reason:` (required), optional `rules:` and `files:`. `npx chaffjs suppressions` lists what it silenced. |
76
82
  | Change the rule | Wrong for this team or genre | `npx chaffjs relax <rule-id> --why "reason"` (or `strict` / `off`). The reason and date are written into `chaff.yaml`. |
77
83
 
78
84
  `npx chaffjs explain <rule-id>` shows why a rule exists, its levels and the current one. Read it before
@@ -84,6 +90,9 @@ When a finding is wrong for a reason that is not about this team (chaff misread
84
90
  `npx chaffjs feedback <file> --rule <rule-id> --line <n>`: it drafts a report and sends nothing. A document the
85
91
  person may share can go to isamu/chaff-corpus, where wrong findings become test cases and rule fixes.
86
92
 
93
+ `heading-marker-no-space` (`##Steps`, `#見出し`: no space after the marks, so the line is not a heading) is fixed by
94
+ adding the one space; keep the level and the words. If the line was a tag or a number, not a heading, leave it and say so.
95
+
87
96
  ## When numbers or dates disagree
88
97
 
89
98
  The group "Facts that disagree" in `npx chaffjs rules` checks what a sum or a calendar can settle. Among them:
@@ -96,6 +105,12 @@ Such a finding says two places in the document disagree. It does not say which o
96
105
  Never "fix" it by changing the figure that was right, and never adjust both so they merely agree. If you cannot
97
106
  tell which is right, leave both and ask.
98
107
 
108
+ ## When Markdown hides a section
109
+
110
+ Some findings are Markdown slips that drop a section from the outline: `pseudo-heading` is a bold line standing in for
111
+ a heading ("**Next steps**") in a document that otherwise uses headings. Make it a real heading one level below the
112
+ heading above it; if it is not a section of its own, drop the bold and write it into the text. Do not change its words.
113
+
99
114
  ## Tune chaff.yaml
100
115
 
101
116
  - `npx chaffjs init --genre <genre>` writes a commented `chaff.yaml` for that genre when there is none (an
@@ -106,17 +121,31 @@ tell which is right, leave both and ask.
106
121
  - A level is `strict` / `normal` / `relaxed` / `off`; when even `relaxed` is too tight, a positive number is the
107
122
  limit itself (`max-sentence-length: 260`). A rule with nothing to count takes fewer levels, and no number;
108
123
  `levels_you_can_set` in `rules --json` lists them.
109
- - `prefer:` maps spellings to the team's (`e-mail: email`); `preferred-term: normal` turns the rule on.
124
+ - `prefer:` maps spellings to the team's (`e-mail: email`); `preferred-term: normal` turns the rule on. An entry
125
+ limited to some parts of the document takes the object form: `our firm: { use: our company, scope: [~quote] }`.
126
+ - `terms:` lists names and terms with one fixed form (`[GitHub, JavaScript]`); `term-form` reports a form that
127
+ differs only in case, width, hyphens or spaces (`Github`, `GitHub`, `Java Script`), outside code, URLs and paths.
128
+ Without `terms:` the rule does not run, and the list of rules not run says so.
129
+ - `consistent:` lists groups of words that are each right but must not be mixed (`[[顧客, お客様], [log in, sign in]]`);
130
+ `term-consistency` reports the less-used member within a document (a tie is one finding that takes no side), and
131
+ `cross-doc-term-variant` compares the groups across the files of one run. Without `consistent:` the rule does not run,
132
+ and the list of rules not run says so.
110
133
  - Unknown rule names and unreadable values are reported on stderr — read stderr after editing `chaff.yaml`.
111
134
  - `genre:` sets the kind of document. `by_path` sets it per path, as a list of `files` globs, each with `genre`,
112
- `language` or `profile`, and an entry in any other shape is reported on stderr and not used:
135
+ `language`, `profile`, `rules` or `options`, and an entry in any other shape is reported on stderr and not used:
113
136
 
114
137
  ```yaml
115
138
  by_path:
116
139
  - files: ["guides/**/*.md"]
117
140
  genre: docs/manual
141
+ rules:
142
+ max-sentence-length: relaxed
118
143
  ```
119
144
 
145
+ An entry's `rules` and `options` are written as the top-level ones are. A file's level, weakest first: the default,
146
+ the genre, `style:`, top-level `rules:`, then the matching `by_path` entries' `rules` (the later entry wins). A rule
147
+ an entry turns off is listed as not run with the entry named; `explain` lists every entry that changes the rule.
148
+
120
149
  A file's front matter `genre:` (or `type:`) sets that one file, when neither `genre:` nor a matching `by_path`
121
150
  entry does. Strongest first: `--genre` for one run, then `by_path`, `genre:`, front matter, the path, the content,
122
151
  and `blog/tech`. `rules:` wins over the genre's preset.
@@ -124,7 +153,15 @@ tell which is right, leave both and ask.
124
153
  `verse` (a Japanese poem: each line ends a sentence) or `play` (a Japanese play: stage directions in () are split
125
154
  from the spoken line). Leave it out: the genre or the content chooses it, and the first line of `npx chaffjs tree` shows the choice. `none` stops the choice.
126
155
  - `names:` lists the team's names (organisations, products), each read as one name. `include:` adds files besides
156
+ Markdown when a folder is checked (`include: ["*.yaml"]`). `exclude:` leaves globs out of a folder walk
157
+ (`exclude: [vendor/**, CHANGELOG.md]`, matched like `by_path`), and a walk also leaves out what the `.gitignore`
158
+ files from the repository root (the nearest folder with `.git`) down ignore, plus `.git/info/exclude`. A file named on the command line is still checked; the summary says
159
+ how many files were left out and why.
160
+
127
161
  Markdown when a folder is checked (`include: ["*.yaml"]`).
162
+ - `options: { no-mixed-desumasu: { body: desumasu, list: dearu, heading: dearu } }` (Japanese only) is for a team
163
+ that has chosen its register: in a region written there, a sentence in the other register is reported even with no
164
+ mix. Leave it out to keep the default, which takes no side and only flags the minority of a mix.
128
165
 
129
166
  ## Turn a team's style note into chaff.yaml
130
167
 
@@ -135,7 +172,7 @@ names or numbers:
135
172
  number means), `levels`, `example`, `not_flagged`, and `genres` (whether it runs in each genre).
136
173
  2. Split the note into single requirements; map each to the rule whose `summary` and `level_meaning` fit. A
137
174
  number between levels is written as the number itself (`max-sentence-length: 80`). Spellings go under
138
- `prefer`, in-house words under `jargon`, required headings under `required_sections`.
175
+ `prefer`, names with one fixed form under `terms`, words not to be mixed under `consistent`, in-house words under `jargon`, required headings under `required_sections`.
139
176
  3. Say plainly what no rule covers. For example, `no-mixed-desumasu` flags a register mixed into a document, but
140
177
  does not require a particular one; a document wholly in the other register is not reported.
141
178
  4. Write only what differs from the default, then check before committing: `npx chaffjs explain <rule-id>`, a
@@ -148,7 +185,7 @@ Pick the easiest way that can say the requirement:
148
185
 
149
186
  | Requirement | Use |
150
187
  | --- | --- |
151
- | An existing rule covers it | A level, a number, `prefer`, `jargon` or `required_sections` in `chaff.yaml` |
188
+ | An existing rule covers it | A level, a number, `prefer`, `terms`, `consistent`, `jargon` or `required_sections` in `chaff.yaml` |
152
189
  | A fixed phrase or pattern, with the team's own message | `custom_rules` of type `words` or `pattern` |
153
190
  | Decided by part of speech or inflection | `custom_rules` of type `tokens` |
154
191
  | Counting or comparing that the above cannot express | a Node function, `type: module` |
@@ -170,6 +207,12 @@ custom_rules:
170
207
  ja: { before: 禁止ワードを使った文, after: 別の言い方の文 }
171
208
  ```
172
209
 
210
+ `scope:` on a `words`, `pattern` or `tokens` rule (and on a `prefer` entry) limits what it reads: `heading`, `list`,
211
+ `table`, `quote`, `paragraph` (body text outside the others). Without it, a rule reads body text and list items. Names
212
+ without `~` choose (none: every part), then names with `~` take parts away, so `[~quote]` is everything but
213
+ quotations and `[list, ~quote]` is list items outside quotations. A rule against 。 at the end of a heading is
214
+ `type: pattern`, `pattern: '。'`, `scope: [heading]`. An unknown name stops the run.
215
+
173
216
  Test a new team rule the same way: `explain`, then a sample it must report and a sample it must not, before
174
217
  committing `chaff.yaml`. The guide page "Adding a rule" covers each way and how to add a rule to chaff itself.
175
218
 
@@ -369,7 +412,8 @@ output before and after.
369
412
 
370
413
  - `npx chaffjs tree <file>` shows a contract or specification as a tree of addresses (`3.2` for 第3条第2項 or
371
414
  Section 3.2). A check reads the same tree to find references to missing provisions, numbering gaps and
372
- terms defined twice.
415
+ terms defined twice. `enumeration-marker-mix` points at an item numbered in another form than the rest of its run
416
+ ("1.", "2.", "3)", "4."; 「(1)」「(2)」「3.」); sub-items that count from 1 again are a level below and are left.
373
417
  - `npx chaffjs cite <source> <quotes.json>` checks that quotations (`[{ "address", "quote" }]`) are really in
374
418
  the source; exit 1 if any is not. Use it to back every quotation you put in an answer or a summary.
375
419
  `cite --url <URL> <quotes.json>` checks against a web page; `cite --scaffold <file>` prints the quotations in a
package/src/allow.ts ADDED
@@ -0,0 +1,146 @@
1
+ import type { Finding } from "./plugin.ts";
2
+ import { matches } from "./config/by-path.ts";
3
+ import { boundedMatches } from "./custom/bounded-match.ts";
4
+ import { PatternTimeout } from "./custom/pattern-timeout.ts";
5
+ import { regexRefusal, type RegexRefusal } from "./custom/regex-safety.ts";
6
+ import { lineStarts } from "./position.ts";
7
+
8
+ /**
9
+ * chaff.yaml's `allow:` — text a team never wants reported (a product name, a quoted form), each with the reason.
10
+ * A finding placed inside an allowed occurrence is dropped and listed by `chaff suppressions` with that reason, as a
11
+ * stet is: an allowance without a reason, or one that silences quietly, would let the rules drift from the documents.
12
+ */
13
+ export type AllowEntry = {
14
+ /** Where the entry is under allow: (allow[0]), for messages. */
15
+ readonly at: string;
16
+ /** A literal string (text:) or a regular expression (pattern:); exactly one is written. */
17
+ readonly text?: string | undefined;
18
+ readonly pattern?: string | undefined;
19
+ readonly reason: string;
20
+ /** Rule ids the entry covers; empty covers every rule. */
21
+ readonly rules: readonly string[];
22
+ /** Globs (from chaff.yaml's folder) of the files the entry covers; empty covers every file. */
23
+ readonly files: readonly string[];
24
+ };
25
+
26
+ export type AllowProblem =
27
+ | { readonly kind: "not-a-list"; readonly written: string }
28
+ | { readonly kind: "not-a-map" | "no-reason" | "no-target" | "both-targets" | "bad-rules" | "bad-files"; readonly at: string }
29
+ | { readonly kind: "bad-pattern"; readonly at: string; readonly refusal: RegexRefusal };
30
+
31
+ export type AllowRead = { readonly entries: readonly AllowEntry[]; readonly problems: readonly AllowProblem[] };
32
+
33
+ const PATTERN_FLAGS = "u";
34
+
35
+ const isRecord = (value: unknown): value is Record<string, unknown> => typeof value === "object" && value !== null && !Array.isArray(value);
36
+
37
+ const printed = (value: unknown): string => JSON.stringify(value) ?? String(value);
38
+
39
+ const nonEmpty = (value: unknown): string | undefined => (typeof value === "string" && value.trim() !== "" ? value : undefined);
40
+
41
+ /** A list of non-empty strings, or one string; undefined when written as anything else. Missing is the empty list. */
42
+ const stringsOf = (value: unknown): string[] | undefined => {
43
+ if (value === undefined || value === null) return [];
44
+ if (typeof value === "string") return value.trim() === "" ? undefined : [value.trim()];
45
+ if (!Array.isArray(value)) return undefined;
46
+ const items: unknown[] = value;
47
+ const strings = items.flatMap((item) => (nonEmpty(item) === undefined ? [] : [String(item).trim()]));
48
+ return strings.length === items.length ? strings : undefined;
49
+ };
50
+
51
+ /** The first thing wrong with one entry's target (text: or pattern:), or undefined. */
52
+ const targetProblem = (raw: Record<string, unknown>, at: string): AllowProblem | undefined => {
53
+ const text = nonEmpty(raw["text"]);
54
+ const pattern = nonEmpty(raw["pattern"]);
55
+ if (text !== undefined && pattern !== undefined) return { kind: "both-targets", at };
56
+ if (text === undefined && pattern === undefined) return { kind: "no-target", at };
57
+ const refusal = pattern === undefined ? undefined : regexRefusal(pattern, PATTERN_FLAGS);
58
+ return refusal === undefined ? undefined : { kind: "bad-pattern", at, refusal };
59
+ };
60
+
61
+ const entryOf = (raw: unknown, index: number): AllowEntry | AllowProblem => {
62
+ const at = `allow[${String(index)}]`;
63
+ if (!isRecord(raw)) return { kind: "not-a-map", at };
64
+ const target = targetProblem(raw, at);
65
+ if (target !== undefined) return target;
66
+ const reason = nonEmpty(raw["reason"]);
67
+ if (reason === undefined) return { kind: "no-reason", at };
68
+ const rules = stringsOf(raw["rules"]);
69
+ if (rules === undefined) return { kind: "bad-rules", at };
70
+ const files = stringsOf(raw["files"]);
71
+ if (files === undefined) return { kind: "bad-files", at };
72
+ return { at, text: nonEmpty(raw["text"]), pattern: nonEmpty(raw["pattern"]), reason: reason.trim(), rules, files };
73
+ };
74
+
75
+ const isProblem = (value: AllowEntry | AllowProblem): value is AllowProblem => "kind" in value;
76
+
77
+ const isEntry = (value: AllowEntry | AllowProblem): value is AllowEntry => !isProblem(value);
78
+
79
+ /** chaff.yaml's allow: as written, read into entries and the problems that stop the run. Pure. */
80
+ export const allowOf = (raw: unknown): AllowRead => {
81
+ if (raw === undefined || raw === null) return { entries: [], problems: [] };
82
+ if (!Array.isArray(raw)) return { entries: [], problems: [{ kind: "not-a-list", written: printed(raw) }] };
83
+ const items: unknown[] = raw;
84
+ const read = items.map((item, index) => entryOf(item, index));
85
+ return { entries: read.filter(isEntry), problems: read.filter(isProblem) };
86
+ };
87
+
88
+ /** The entries that cover this file. base is chaff.yaml's folder, as for by_path. */
89
+ export const allowFor = (entries: readonly AllowEntry[], base: string, path: string): AllowEntry[] =>
90
+ entries.filter((entry) => entry.files.length === 0 || entry.files.some((glob) => matches(glob, base, path)));
91
+
92
+ type Range = { readonly start: number; readonly end: number };
93
+
94
+ const literalRanges = (source: string, text: string): Range[] => {
95
+ const found: Range[] = [];
96
+ for (let at = source.indexOf(text); at !== -1; at = source.indexOf(text, at + text.length)) found.push({ start: at, end: at + text.length });
97
+ return found;
98
+ };
99
+
100
+ /** A pattern that runs past its time budget allows nothing: the findings stay, rather than vanish on a guess. */
101
+ const patternRanges = (source: string, pattern: string): Range[] => {
102
+ try {
103
+ return (boundedMatches(pattern, PATTERN_FLAGS, [source])[0] ?? []).map((match) => ({ start: match.index, end: match.index + match.text.length }));
104
+ } catch (error) {
105
+ if (error instanceof PatternTimeout) return [];
106
+ throw error;
107
+ }
108
+ };
109
+
110
+ const rangesOf = (source: string, entry: AllowEntry): Range[] =>
111
+ entry.text !== undefined ? literalRanges(source, entry.text) : patternRanges(source, entry.pattern ?? "");
112
+
113
+ /** Where the finding is placed, as an offset into the source; undefined for a finding about the whole document. */
114
+ const offsetOf = (finding: Finding, starts: readonly number[]): number | undefined => {
115
+ const offset = finding.values["offset"];
116
+ if (typeof offset === "number") return offset;
117
+ if (finding.line < 1 || finding.column < 1) return undefined;
118
+ const lineStart = starts[finding.line - 1];
119
+ return lineStart === undefined ? undefined : lineStart + finding.column - 1;
120
+ };
121
+
122
+ export type Allowed = { readonly finding: Finding; readonly entry: AllowEntry };
123
+
124
+ export type AllowApplied = { readonly kept: readonly Finding[]; readonly allowed: readonly Allowed[] };
125
+
126
+ /** Drops each finding placed inside an occurrence an entry allows for the finding's rule. entries are this file's (allowFor). */
127
+ export const applyAllow = (source: string, findings: readonly Finding[], entries: readonly AllowEntry[]): AllowApplied => {
128
+ if (entries.length === 0 || findings.length === 0) return { kept: findings, allowed: [] };
129
+ const starts = lineStarts(source);
130
+ const ranged = entries.map((entry) => ({ entry, ranges: rangesOf(source, entry) }));
131
+ const matched = findings.map((finding) => {
132
+ const offset = offsetOf(finding, starts);
133
+ const hit =
134
+ offset === undefined
135
+ ? undefined
136
+ : ranged.find(
137
+ ({ entry, ranges }) =>
138
+ (entry.rules.length === 0 || entry.rules.includes(finding.rule)) && ranges.some((range) => offset >= range.start && offset < range.end),
139
+ );
140
+ return { finding, entry: hit?.entry };
141
+ });
142
+ return {
143
+ kept: matched.filter((pair) => pair.entry === undefined).map((pair) => pair.finding),
144
+ allowed: matched.flatMap((pair) => (pair.entry === undefined ? [] : [{ finding: pair.finding, entry: pair.entry }])),
145
+ };
146
+ };
@@ -1,5 +1,6 @@
1
1
  import { loadAdapter } from "./adapter-load.ts";
2
2
  import { applyByPath } from "./config/by-path.ts";
3
+ import { configForPath } from "./config/by-path-rules.ts";
3
4
  import type { Config } from "./config/load.ts";
4
5
  import { optionLayersOf } from "./config/option-problems.ts";
5
6
  import { limitsFor } from "./config/style.ts";
@@ -12,7 +13,9 @@ import { resolveGenre, type ResolvedGenre } from "./resolve-genre.ts";
12
13
  import { neededBy, runRulesWith, type RunContext, type RunResult } from "./run.ts";
13
14
  import { runCrossRules } from "./cross-run.ts";
14
15
  import { CROSS_DETECTORS } from "./detectors/index.ts";
15
- import { applySuppressions, type Applied } from "./stet.ts";
16
+ import { applySuppressions, knownRulesOf, type Applied } from "./stet.ts";
17
+ import type { PerFile } from "./render/suppressions.ts";
18
+ import { allowFor, allowOf, applyAllow, type AllowEntry, type Allowed } from "./allow.ts";
16
19
 
17
20
  /** A document's language when nothing names one for this run: its by_path entry, chaff.yaml's language, then a guess from the text. */
18
21
  export const documentLanguage = (path: string, source: string, config: Config): string =>
@@ -21,7 +24,19 @@ export const documentLanguage = (path: string, source: string, config: Config):
21
24
  /** What this run chose over the settings: a language and a genre, when given, and whether experimental rules run. */
22
25
  export type CheckChoice = { readonly language?: string | undefined; readonly genre?: string | undefined; readonly experimental: boolean };
23
26
 
24
- /** One document linted: the rules that ran and why others did not, before and after stet silenced some. */
27
+ /** Findings after stet and chaff.yaml's allow: kept holds what neither silenced; allowed what an allow entry did. */
28
+ export type Silenced = Applied & { readonly allowed: readonly Allowed[] };
29
+
30
+ /** What `chaff suppressions` lists for one file: what stet and allow silenced, stets without a reason, range stets and stet problems. */
31
+ export const silencedOf = (applied: Silenced): Omit<PerFile, "path" | "notRun"> => ({
32
+ suppressed: applied.suppressed,
33
+ allowed: applied.allowed,
34
+ reasonless: applied.unusedReasonless,
35
+ ranges: applied.ranges,
36
+ problems: applied.problems,
37
+ });
38
+
39
+ /** One document linted: the rules that ran and why others did not, before and after stet and allow silenced some. */
25
40
  export type SourceCheck = {
26
41
  readonly language: string;
27
42
  readonly genre: ResolvedGenre;
@@ -30,7 +45,9 @@ export type SourceCheck = {
30
45
  /** What the rules ran with. The pass over several documents runs with it too. */
31
46
  readonly context: RunContext;
32
47
  readonly raw: RunResult;
33
- readonly applied: Applied;
48
+ readonly applied: Silenced;
49
+ /** chaff.yaml's allow entries that cover this file. The pass over several documents applies them too. */
50
+ readonly allow: readonly AllowEntry[];
34
51
  };
35
52
 
36
53
  /** What the language adapter is asked to prepare for these rules under this chaff.yaml: what the running rules read, nothing more. */
@@ -43,7 +60,8 @@ export const adapterNeedsOf = (
43
60
  ): AdapterNeeds => neededBy(rules, config.rules, experimental, genre, language);
44
61
 
45
62
  /** Lints one text as `chaff <file>` does. The file need not exist: `chaff grade` checks a model's output from memory. */
46
- export const checkSource = async (path: string, source: string, config: Config, choice: CheckChoice): Promise<SourceCheck> => {
63
+ export const checkSource = async (path: string, source: string, written: Config, choice: CheckChoice): Promise<SourceCheck> => {
64
+ const config = configForPath(written, path);
47
65
  const language = choice.language ?? documentLanguage(path, source, config);
48
66
  const adapter = await loadAdapter(language);
49
67
  const genre = resolveGenre(path, source, config, choice.genre);
@@ -57,18 +75,24 @@ export const checkSource = async (path: string, source: string, config: Config,
57
75
  limits: limitsFor(config, language),
58
76
  optionLayers: optionLayersOf(config),
59
77
  detectors: config.extensions?.detectors ?? {},
78
+ levelsFrom: config.pathLevelsFrom ?? {},
60
79
  };
61
80
  const raw = runRulesWith(doc, rules, context);
62
- return { language, genre, rules, doc, context, raw, applied: suppressedIn(source, doc, raw) };
81
+ const allow = allowFor(allowOf(config.allow).entries, config.baseDir, path);
82
+ return { language, genre, rules, doc, context, raw, allow, applied: suppressedIn(source, doc, raw, rules, allow) };
63
83
  };
64
84
 
65
- /** stet で黙らせたものは、ここで落とす。stet は text(読んだままの本文)から読む。 */
66
- const suppressedIn = (text: string, doc: ProseDocument, raw: RunResult): Applied =>
67
- applySuppressions(
85
+ /** stet で黙らせたものと、chaff.yaml の allow に当たるものは、ここで落とす。stet が先、allow が後。どちらも text(読んだままの本文)から読む。 */
86
+ const suppressedIn = (text: string, doc: ProseDocument, raw: RunResult, rules: readonly RuleDefinition[], allow: readonly AllowEntry[]): Silenced => {
87
+ const stetted = applySuppressions(
68
88
  text,
69
89
  raw.findings,
70
90
  doc.sections.map((section) => section.span),
91
+ knownRulesOf(rules),
71
92
  );
93
+ const allowed = applyAllow(text, stetted.kept, allow);
94
+ return { ...stetted, kept: allowed.kept, allowed: allowed.allowed };
95
+ };
72
96
 
73
97
  /**
74
98
  * The checks of one run's documents, with the rules that compare documents run over all of them (cross-run.ts), and
@@ -79,6 +103,6 @@ export const crossChecked = (checks: readonly SourceCheck[], detectors: Readonly
79
103
  const results = runCrossRules(checks, detectors);
80
104
  return checks.map((check, index) => {
81
105
  const raw = results[index] ?? check.raw;
82
- return raw === check.raw ? check : { ...check, raw, applied: suppressedIn(check.doc.source, check.doc, raw) };
106
+ return raw === check.raw ? check : { ...check, raw, applied: suppressedIn(check.doc.source, check.doc, raw, check.rules, check.allow) };
83
107
  });
84
108
  };
package/src/cli-text.ts CHANGED
@@ -148,13 +148,16 @@ Silence one spot: <!-- stet: rule-id — reason -->
148
148
  A rule's level is one of strict / normal / relaxed / off.
149
149
  `;
150
150
 
151
+ /** What the file's header line counts: findings shelved by the baseline, silenced by stet, silenced by chaff.yaml's allow. */
152
+ export type HeaderCounts = { readonly shelved: number; readonly hushed: number; readonly allowed?: number | undefined };
153
+
151
154
  export type CliText = {
152
155
  readonly usage: string;
153
156
  /** Under one command's lines of the usage, for `chaff <command> --help`. */
154
157
  readonly moreHelp: string;
155
158
  readonly languageName: (language: string) => string;
156
159
  readonly genreSource: Readonly<Record<GenreSource, string>>;
157
- readonly header: (path: string, genre: string, language: string, from: string, shelved: number, hushed: number) => string;
160
+ readonly header: (path: string, genre: string, language: string, from: string, counts: HeaderCounts) => string;
158
161
  readonly suggested: (name: string, genre: string) => string;
159
162
  readonly suggestedNote: (name: string, genre: string, used: string) => string;
160
163
  /** Nothing to check among targets; include: the globs looked for besides Markdown. Says how to look for more. */
@@ -191,11 +194,12 @@ export const CLI_TEXT: Texts<CliText> = {
191
194
  path: "パス",
192
195
  content: "内容",
193
196
  },
194
- header: (path, genre, language, from, shelved, hushed) =>
197
+ header: (path, genre, language, from, { shelved, hushed, allowed = 0 }) =>
195
198
  [
196
199
  `${path} ${genre} · ${language} ジャンルは${spacedInJapanese(from)}から`,
197
200
  shelved > 0 ? ` 棚上げ ${shelved} 件` : "",
198
201
  hushed > 0 ? ` stet ${hushed} 件` : "",
202
+ allowed > 0 ? ` allow ${allowed} 件` : "",
199
203
  ].join(""),
200
204
  suggested: (name, genre) => ` ${name}のようです。--genre ${genre} を試せます`,
201
205
  suggestedNote: (name, genre, used) =>
@@ -246,8 +250,13 @@ export const CLI_TEXT: Texts<CliText> = {
246
250
  path: "the path",
247
251
  content: "the content",
248
252
  },
249
- header: (path, genre, language, from, shelved, hushed) =>
250
- [`${path} ${genre} · ${language} genre from ${from}`, shelved > 0 ? ` ${shelved} shelved` : "", hushed > 0 ? ` ${hushed} stet` : ""].join(""),
253
+ header: (path, genre, language, from, { shelved, hushed, allowed = 0 }) =>
254
+ [
255
+ `${path} ${genre} · ${language} genre from ${from}`,
256
+ shelved > 0 ? ` ${shelved} shelved` : "",
257
+ hushed > 0 ? ` ${hushed} stet` : "",
258
+ allowed > 0 ? ` ${allowed} allowed` : "",
259
+ ].join(""),
251
260
  suggested: (name, genre) => ` Looks like: ${name}. Try --genre ${genre}`,
252
261
  suggestedNote: (name, genre, used) =>
253
262
  ` No genre was set, so this was checked as ${used}. If it is ${name}, --genre ${genre} checks it the way that kind is written (npx chaffjs genres lists them).`,
package/src/cli.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { mkdirSync, writeFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
  import { packageFor } from "./adapter-load.ts";
4
- import { checkSource, crossChecked, type SourceCheck } from "./check-source.ts";
4
+ import { checkSource, crossChecked, silencedOf, type SourceCheck } from "./check-source.ts";
5
5
  import { CONFIG_FILE, type Config } from "./config/load.ts";
6
6
  import { applyLevel } from "./config/write.ts";
7
- import { collectTargets, readDocumentFile } from "./files.ts";
7
+ import { collectFiles, collectTargets, readDocumentFile } from "./files.ts";
8
8
  import { BASELINE_FILE, fingerprints, readBaseline, splitByBaseline, writeBaseline } from "./baseline.ts";
9
9
  import type { PerFile } from "./render/suppressions.ts";
10
10
  import { runSuppressions } from "./commands/suppressions.ts";
@@ -40,7 +40,7 @@ import { homedir } from "node:os";
40
40
  import { settingWarnings } from "./config/warnings.ts";
41
41
  import { readConfigIn } from "./config/read.ts";
42
42
  import { settingSourcesOf } from "./config/option-problems.ts";
43
- import { renderSummary, type FileOutcome } from "./render/summary.ts";
43
+ import { renderExcluded, renderSummary, type FileOutcome } from "./render/summary.ts";
44
44
  import { aiScoreLineOf } from "./ai-score/lint-line.ts";
45
45
 
46
46
  import type { Finding, Level, RuleDefinition } from "./plugin.ts";
@@ -111,7 +111,8 @@ const present = (check: SourceCheck, argv: readonly string[]): Inspected => {
111
111
  const baseline = argv.includes("--show-baseline") ? undefined : readBaseline(join(process.cwd(), BASELINE_FILE));
112
112
  const split = splitByBaseline(path, applied.kept, baseline, process.cwd());
113
113
  const result = { ...raw, findings: split.fresh };
114
- const { header, notes } = fileHeader(path, source, language, { genre, from, unread }, { shelved: split.shelved, hushed: applied.suppressed.length });
114
+ const counts = { shelved: split.shelved, hushed: applied.suppressed.length, allowed: applied.allowed.length };
115
+ const { header, notes } = fileHeader(path, source, language, { genre, from, unread }, counts);
115
116
  const notRun = notRunAmong(applied.named, raw.skipped);
116
117
  const text = argv.includes("--compact")
117
118
  ? renderCompact(header, result, rules, language)
@@ -122,7 +123,7 @@ const present = (check: SourceCheck, argv: readonly string[]): Inspected => {
122
123
  language,
123
124
  genre,
124
125
  outcome: { path, findings: split.fresh, notRun: raw.skipped.length },
125
- perFile: { path, suppressed: applied.suppressed, reasonless: applied.unusedReasonless, notRun },
126
+ perFile: { path, notRun, ...silencedOf(applied) },
126
127
  checked: { findings: split.fresh, rules, language, genre, genreFrom: from, skipped: raw.skipped },
127
128
  kept: applied.kept,
128
129
  };
@@ -162,10 +163,14 @@ const summaryLanguage = (results: readonly Inspected[], config: Config): UiLangu
162
163
  };
163
164
 
164
165
  const lint = async (targets: readonly string[], argv: readonly string[], config: Config): Promise<number> => {
165
- const paths = collectTargets(targets, config.include);
166
+ const { paths, excluded } = collectFiles(targets, config.include, config);
166
167
  if (paths.length === 0) {
167
168
  // 0 件を成功にすると「CI は通っているが何も検証していない」状態が続く。§14。
168
- console.error(hostText(config).noMarkdown(targets.join(", "), config.include ?? []));
169
+ console.error(
170
+ [hostText(config).noMarkdown(targets.join(", "), config.include ?? []), ...renderExcluded(excluded, hostLanguage(config.language, process.env))].join(
171
+ "\n",
172
+ ),
173
+ );
169
174
  return 1;
170
175
  }
171
176
  const language = config.language ?? "ja";
@@ -186,6 +191,7 @@ const lint = async (targets: readonly string[], argv: readonly string[], config:
186
191
  renderSummary(
187
192
  results.map((result) => result.outcome),
188
193
  summaryLanguage(results, config),
194
+ excluded,
189
195
  ).forEach((line) => console.log(line));
190
196
  return results.some((result) => result.outcome.findings.some((finding) => finding.severity === "error")) ? 1 : 0;
191
197
  };
@@ -195,7 +201,7 @@ const lint = async (targets: readonly string[], argv: readonly string[], config:
195
201
  * 差分だけを出す。workflow spec §11。
196
202
  */
197
203
  const runWatch = async (targets: readonly string[], argv: readonly string[], config: Config): Promise<number> => {
198
- const paths = collectTargets(targets, config.include);
204
+ const paths = collectTargets(targets, config.include, config);
199
205
  const text = hostText(config);
200
206
  if (paths.length === 0) {
201
207
  console.error(text.noMarkdown(targets.join(", "), config.include ?? []));
@@ -246,7 +252,7 @@ const explain = (config: Config, ruleId: string | undefined, genreFlag: string |
246
252
  };
247
253
 
248
254
  const runBaseline = async (targets: readonly string[], argv: readonly string[], config: Config): Promise<number> => {
249
- const paths = collectTargets(targets.length > 0 ? targets : ["."], config.include);
255
+ const paths = collectTargets(targets.length > 0 ? targets : ["."], config.include, config);
250
256
  if (paths.length === 0) {
251
257
  console.error(hostText(config).noMarkdownHere(config.include ?? []));
252
258
  return 1;
@@ -297,12 +303,7 @@ const HANDLERS: Readonly<Record<string, Handler>> = {
297
303
  runFixPlan(fixPlanTargets(argv), argv, { ...treeContext(config), check: async (path) => (await inspectAll(config, argv)(path)).checked }),
298
304
  baseline: (argv, config) => runBaseline(positional(argv), argv, config),
299
305
  suppressions: (argv, config) =>
300
- runSuppressions(
301
- positional(argv),
302
- (paths) => inspectRun(paths, config, [...argv, "--show-baseline"]),
303
- hostLanguage(config.language, process.env),
304
- config.include,
305
- ),
306
+ runSuppressions(positional(argv), (paths) => inspectRun(paths, config, [...argv, "--show-baseline"]), hostLanguage(config.language, process.env), config),
306
307
  relax: (argv, config) => changeSetting(config, "relaxed", argv[1], flag(argv, "--why")),
307
308
  strict: (argv, config) => changeSetting(config, "strict", argv[1], flag(argv, "--why")),
308
309
  off: (argv, config) => changeSetting(config, "off", argv[1], flag(argv, "--why")),
@@ -53,7 +53,7 @@ export type Context = {
53
53
  * 測った結果は文書の言語で出す(混ざっていれば測らないので、言語は 1 つ)。断りは ui の言語。
54
54
  */
55
55
  export const runEval = async (targets: readonly string[], argv: readonly string[], context: Context): Promise<number> => {
56
- const paths = collectTargets(targets.length > 0 ? targets : ["."], context.config.include);
56
+ const paths = collectTargets(targets.length > 0 ? targets : ["."], context.config.include, context.config);
57
57
  if (paths.length === 0) {
58
58
  console.error(CLI_TEXT[context.ui].noMarkdown(targets.join(", "), context.config.include ?? []));
59
59
  return 1;
@@ -1,4 +1,4 @@
1
- import { collectTargets } from "../files.ts";
1
+ import { collectTargets, type Exclusion } from "../files.ts";
2
2
  import { renderSuppressions, type PerFile } from "../render/suppressions.ts";
3
3
  import type { UiLanguage } from "../ui.ts";
4
4
 
@@ -7,9 +7,9 @@ export const runSuppressions = async (
7
7
  targets: readonly string[],
8
8
  inspectRun: (paths: readonly string[]) => Promise<readonly { readonly perFile: PerFile }[]>,
9
9
  ui: UiLanguage,
10
- include: readonly string[] = [],
10
+ files: Exclusion & { readonly include?: readonly string[] | undefined },
11
11
  ): Promise<number> => {
12
- const inspected = await inspectRun(collectTargets(targets.length > 0 ? targets : ["."], include));
12
+ const inspected = await inspectRun(collectTargets(targets.length > 0 ? targets : ["."], files.include, files));
13
13
  console.log(
14
14
  renderSuppressions(
15
15
  inspected.map((file) => file.perFile),
@@ -163,7 +163,7 @@ const notRunNotice = (why: string, what: string, envFile: string | undefined, la
163
163
  * 見出しと指摘は文書の言語、締めは文書がそろっていればその言語、混ざっていれば ui の言語。
164
164
  */
165
165
  export const runTest = async (targets: readonly string[], argv: readonly string[], context: TestContext): Promise<number> => {
166
- const paths = collectTargets(targets.length > 0 ? targets : ["."], context.config.include);
166
+ const paths = collectTargets(targets.length > 0 ? targets : ["."], context.config.include, context.config);
167
167
  if (paths.length === 0) {
168
168
  console.error(CLI_TEXT[context.ui].noMarkdown(targets.join(", "), context.config.include ?? []));
169
169
  return 1;
@@ -9,17 +9,26 @@ const isTouching = (left: Token | undefined, right: Token | undefined): boolean
9
9
  const isNounBefore = (token: Token, next: Token | undefined, suffixes: ReadonlySet<string>): next is Token =>
10
10
  next?.pos === "NOUN" && isTouching(token, next) && !suffixes.has(next.surface);
11
11
 
12
- /** A noun alone in brackets that close onto a noun (卒業(見込)証明書): the brackets mark it optional inside one compound. */
13
- const isBracketedInCompound = (token: Token, tokens: readonly Token[], at: number, suffixes: ReadonlySet<string>): boolean => {
12
+ /** A noun alone in brackets that close onto a noun (卒業(見込)証明書): the brackets mark it optional inside one compound. That noun. */
13
+ const nounAfterBrackets = (token: Token, tokens: readonly Token[], at: number, suffixes: ReadonlySet<string>): Token | undefined => {
14
14
  const [opening, closing] = [tokens[at - 1], tokens[at + 1]];
15
- if (opening === undefined || closing === undefined) return false;
16
- if (!OPENING.has(opening.surface) || !CLOSING.has(closing.surface) || !isTouching(opening, token) || !isTouching(token, closing)) return false;
17
- return isNounBefore(closing, tokens[at + 2], suffixes);
15
+ if (opening === undefined || closing === undefined) return undefined;
16
+ if (!OPENING.has(opening.surface) || !CLOSING.has(closing.surface) || !isTouching(opening, token) || !isTouching(token, closing)) return undefined;
17
+ const next = tokens[at + 2];
18
+ return isNounBefore(closing, next, suffixes) ? next : undefined;
18
19
  };
19
20
 
20
21
  /**
21
- * Whether `token`, read at `at` in `tokens`, is a noun written onto the noun after it (取扱事業者), so official Japanese may
22
- * drop its okurigana. A listed phrase suffix (割当て等) does not make a compound. `token` may be tokens[at] read as a noun.
22
+ * The noun `token`, read at `at` in `tokens`, is written onto (事業者 of 取扱事業者), when `token` is a noun at the head of a
23
+ * compound, so official Japanese may drop its okurigana. A listed phrase suffix (割当て等) does not make a compound. `token`
24
+ * may be tokens[at] read as a noun.
23
25
  */
26
+ export const compoundTailOf = (token: Token, tokens: readonly Token[], at: number, suffixes: ReadonlySet<string>): Token | undefined => {
27
+ if (token.pos !== "NOUN") return undefined;
28
+ const next = tokens[at + 1];
29
+ return isNounBefore(token, next, suffixes) ? next : nounAfterBrackets(token, tokens, at, suffixes);
30
+ };
31
+
32
+ /** Whether `token`, read at `at` in `tokens`, is a noun written onto the noun after it (取扱事業者). */
24
33
  export const isCompoundHead = (token: Token, tokens: readonly Token[], at: number, suffixes: ReadonlySet<string>): boolean =>
25
- token.pos === "NOUN" && (isNounBefore(token, tokens[at + 1], suffixes) || isBracketedInCompound(token, tokens, at, suffixes));
34
+ compoundTailOf(token, tokens, at, suffixes) !== undefined;