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
@@ -0,0 +1,75 @@
1
+ import type { Config } from "./load.ts";
2
+ import type { RuleDefinition } from "../plugin.ts";
3
+ import type { Texts, UiLanguage } from "../ui.ts";
4
+ import { allowOf, type AllowProblem } from "../allow.ts";
5
+ import { MAX_PATTERN_LENGTH, MAX_REPEATS, type RegexRefusal } from "../custom/regex-safety.ts";
6
+
7
+ type Text = {
8
+ readonly problem: Readonly<Record<AllowProblem["kind"], (at: string) => string>>;
9
+ readonly refusal: Readonly<Record<RegexRefusal, string>>;
10
+ readonly unknownRule: (at: string, id: string) => string;
11
+ };
12
+
13
+ const TEXT: Texts<Text> = {
14
+ ja: {
15
+ problem: {
16
+ "not-a-list": (written) => `allow は項目の並びで書いてください(- text: … と reason: …)。読めなかった値: ${written}`,
17
+ "not-a-map": (at) => `${at}: text(または pattern)と reason を持つ項目として書いてください`,
18
+ "no-reason": (at) => `${at}: reason がありません。なぜ指摘しなくてよいのかを書いてください(chaff suppressions に並びます)`,
19
+ "no-target": (at) => `${at}: text(そのままの文字列)か pattern(正規表現)のどちらかを書いてください`,
20
+ "both-targets": (at) => `${at}: text と pattern の両方があります。どちらか一つにしてください`,
21
+ "bad-rules": (at) => `${at}: rules はルール名の並びで書いてください([preferred-term] や [preferred-term, spelling-consistency])`,
22
+ "bad-files": (at) => `${at}: files は glob の並びで書いてください(["docs/**/*.md"])`,
23
+ "bad-pattern": (at) => `${at}: pattern を使えません。`,
24
+ },
25
+ refusal: {
26
+ "too-long": `${String(MAX_PATTERN_LENGTH)} 字を超えています。いくつかの項目に分けてください`,
27
+ "nested-quantifier": "繰り返しの中に繰り返しがあります((a+)+ のような形)。長い行で止まらなくなるので使えません",
28
+ "too-many-repeats": `回数の決まらない繰り返し(* や + や {1,9})が ${String(MAX_REPEATS)} つを超えています。長い行で止まらなくなることがあります`,
29
+ backreference: "後方参照(\\1)は使えません。長い行で止まらなくなることがあるためです",
30
+ "empty-match": "何も無い所にも当たります。すべての指摘が消えてしまいます",
31
+ invalid: "正規表現として読めません",
32
+ },
33
+ unknownRule: (at, id) => `${at}: rules の ${id} というルールはありません(npx chaffjs rules --json で一覧が出ます)`,
34
+ },
35
+ en: {
36
+ problem: {
37
+ "not-a-list": (written) => `write allow as a list of entries (- text: … with reason: …); could not read ${written}`,
38
+ "not-a-map": (at) => `${at}: write each entry with text (or pattern) and reason`,
39
+ "no-reason": (at) => `${at}: reason is missing; say why this need not be reported (chaff suppressions lists it)`,
40
+ "no-target": (at) => `${at}: write either text (a literal string) or pattern (a regular expression)`,
41
+ "both-targets": (at) => `${at}: has both text and pattern; keep one`,
42
+ "bad-rules": (at) => `${at}: write rules as a list of rule ids ([preferred-term] or [preferred-term, spelling-consistency])`,
43
+ "bad-files": (at) => `${at}: write files as a list of globs (["docs/**/*.md"])`,
44
+ "bad-pattern": (at) => `${at}: the pattern cannot be used: `,
45
+ },
46
+ refusal: {
47
+ "too-long": `it is longer than ${String(MAX_PATTERN_LENGTH)} characters; split it into several entries`,
48
+ "nested-quantifier": "it repeats something that repeats (a shape like (a+)+), which can run for minutes on a long line",
49
+ "too-many-repeats": `it has more than ${String(MAX_REPEATS)} repeats of varying count (*, + or {1,9}), which can run for minutes on a long line`,
50
+ backreference: "backreferences (\\1) are not allowed, since they can run for minutes on a long line",
51
+ "empty-match": "it matches an empty string, so it would silence every finding",
52
+ invalid: "it is not a regular expression",
53
+ },
54
+ unknownRule: (at, id) => `${at}: there is no rule named ${id} under rules (npx chaffjs rules --json lists them)`,
55
+ },
56
+ };
57
+
58
+ const sentenceOf = (problem: AllowProblem, text: Text): string => {
59
+ if (problem.kind === "not-a-list") return text.problem[problem.kind](problem.written);
60
+ const head = text.problem[problem.kind](problem.at);
61
+ return problem.kind === "bad-pattern" ? `${head}${text.refusal[problem.refusal]}` : head;
62
+ };
63
+
64
+ /** What in allow: cannot be used. Each stops the run, as an unreadable custom rule does: an allowance without its reason is not taken. */
65
+ export const allowProblems = (config: Pick<Config, "allow" | "path">, ui: UiLanguage): string[] =>
66
+ allowOf(config.allow).problems.map((problem) => `chaff: ${config.path ?? "chaff.yaml"}: ${sentenceOf(problem, TEXT[ui])}`);
67
+
68
+ /** Rule ids under an entry's rules: that chaff does not have. Said before the results, like an unknown id under rules:. */
69
+ export const allowRuleWarnings = (config: Pick<Config, "allow" | "path">, known: readonly Pick<RuleDefinition, "id">[], ui: UiLanguage): string[] => {
70
+ const ids = new Set(known.map((rule) => rule.id));
71
+ const where = config.path ?? "chaff.yaml";
72
+ return allowOf(config.allow).entries.flatMap((entry) =>
73
+ entry.rules.filter((id) => !ids.has(id)).map((id) => `${where}: ${TEXT[ui].unknownRule(entry.at, id)}`),
74
+ );
75
+ };
@@ -1,17 +1,43 @@
1
1
  import type { Config } from "./load.ts";
2
+ import type { PathRule } from "./by-path.ts";
3
+ import { byPathSource } from "./by-path-rules.ts";
4
+ import { ruleProblems } from "./rule-problems.ts";
5
+ import { configOptionProblems } from "./option-problems.ts";
6
+ import type { RuleDefinition } from "../plugin.ts";
2
7
  import type { Texts, UiLanguage } from "../ui.ts";
3
8
 
4
- const TEXT: Texts<{ readonly unreadable: (where: string, value: string) => string }> = {
9
+ const TEXT: Texts<{ readonly unreadable: (where: string, value: string) => string; readonly rulesNotAMap: (where: string, value: string) => string }> = {
5
10
  ja: {
6
11
  unreadable: (where, value) =>
7
- `${where}: by_path の ${value} は読めないので使いません。by_path は files と、genre・language・profile の組を並べます(- files: ["guides/**/*.md"] と genre: docs/manual)`,
12
+ `${where}: by_path の ${value} は読めないので使いません。by_path は files と、genre・language・profile・rules・options の組を並べます(- files: ["guides/**/*.md"] と genre: docs/manual)`,
13
+ rulesNotAMap: (where, value) =>
14
+ `${where}: rules の ${value} は読めません。ルールの名前と段階(strict / normal / relaxed / off か、正の数)を並べてください`,
8
15
  },
9
16
  en: {
10
17
  unreadable: (where, value) =>
11
- `${where}: cannot read ${value} under by_path, so it is not used. by_path is a list of files with genre, language or profile (- files: ["guides/**/*.md"] with genre: docs/manual)`,
18
+ `${where}: cannot read ${value} under by_path, so it is not used. by_path is a list of files with genre, language, profile, rules or options (- files: ["guides/**/*.md"] with genre: docs/manual)`,
19
+ rulesNotAMap: (where, value) =>
20
+ `${where}: cannot read ${value} under rules. List rule names with a level (strict / normal / relaxed / off, or a positive number)`,
12
21
  },
13
22
  };
14
23
 
15
24
  /** chaff.yaml の by_path のうち、読めなかったもの。 */
16
25
  export const byPathProblems = (config: Pick<Config, "unreadableByPath" | "path">, ui: UiLanguage = "ja"): string[] =>
17
26
  (config.unreadableByPath ?? []).map((value) => TEXT[ui].unreadable(config.path ?? "chaff.yaml", value));
27
+
28
+ /** One entry's rules: and options: that change nothing, said as the top-level ones are, with the entry named. */
29
+ const entryProblems = (entry: PathRule, file: string, rules: readonly RuleDefinition[], ui: UiLanguage): string[] => {
30
+ const where = `${file} (${byPathSource(entry)})`;
31
+ const blocks = entry.unreadableBlocks ?? [];
32
+ const rulesBlock = blocks.find((block) => block.key === "rules");
33
+ const optionsBlock = blocks.find((block) => block.key === "options");
34
+ return [
35
+ ...(rulesBlock === undefined ? [] : [TEXT[ui].rulesNotAMap(where, rulesBlock.value)]),
36
+ ...ruleProblems({ rules: entry.rules ?? {}, limits: entry.limits ?? {}, unreadableRules: entry.unreadableRules ?? [], path: where }, rules, ui),
37
+ ...configOptionProblems({ options: entry.options ?? {}, unreadableOptions: optionsBlock?.value, path: where }, rules, ui),
38
+ ];
39
+ };
40
+
41
+ /** The by_path entries' rules: and options: that have no effect: an unknown rule, a value that is not a level, an option that does not apply. */
42
+ export const byPathRuleProblems = (config: Pick<Config, "byPath" | "path">, rules: readonly RuleDefinition[], ui: UiLanguage = "ja"): string[] =>
43
+ config.byPath.flatMap((entry) => entryProblems(entry, config.path ?? "chaff.yaml", rules, ui));
@@ -0,0 +1,78 @@
1
+ import { matches, type PathRule } from "./by-path.ts";
2
+ import type { Config } from "./load.ts";
3
+ import type { Level } from "../plugin.ts";
4
+ import type { OptionLayer } from "../rule-options.ts";
5
+
6
+ /** How a by_path entry is named where a setting's source is shown (the rules that did not run, explain, rules --json). */
7
+ export const byPathSource = (entry: Pick<PathRule, "files">): string => `by_path: ${entry.files.join(", ")}`;
8
+
9
+ /** What the by_path entries matching one file set on rules, merged: the later entry wins, as it does for genre. */
10
+ export type PathRuleSettings = {
11
+ readonly rules: Readonly<Record<string, Level>>;
12
+ readonly limits: Readonly<Record<string, number>>;
13
+ /** For each rule whose level an entry set, the entry that set it last. */
14
+ readonly levelsFrom: Readonly<Record<string, string>>;
15
+ /** The entries' options, strongest (latest) first. */
16
+ readonly optionLayers: readonly OptionLayer[];
17
+ };
18
+
19
+ const NOTHING: PathRuleSettings = { rules: {}, limits: {}, levelsFrom: {}, optionLayers: [] };
20
+
21
+ const without = <T>(record: Readonly<Record<string, T>>, ids: readonly string[]): Record<string, T> =>
22
+ Object.fromEntries(Object.entries(record).filter(([id]) => !ids.includes(id)));
23
+
24
+ /** One more entry over what the earlier ones set. A word it writes drops an earlier number for that rule: the word is the newer setting. */
25
+ const overlay = (settings: PathRuleSettings, entry: PathRule): PathRuleSettings => {
26
+ const source = byPathSource(entry);
27
+ const levels = entry.rules ?? {};
28
+ const ids = Object.keys(levels);
29
+ const options = entry.options ?? {};
30
+ return {
31
+ rules: { ...settings.rules, ...levels },
32
+ limits: { ...without(settings.limits, ids), ...entry.limits },
33
+ levelsFrom: { ...settings.levelsFrom, ...Object.fromEntries(ids.map((id) => [id, source])) },
34
+ optionLayers: Object.keys(options).length === 0 ? settings.optionLayers : [{ from: source, values: options }, ...settings.optionLayers],
35
+ };
36
+ };
37
+
38
+ /** The entries in the order written, merged. */
39
+ export const mergePathRules = (entries: readonly PathRule[]): PathRuleSettings => entries.reduce(overlay, NOTHING);
40
+
41
+ /** The by_path entries whose files match this path, matched from the folder of the settings file, in the order written. */
42
+ export const entriesFor = (byPath: readonly PathRule[], base: string, path: string): PathRule[] =>
43
+ byPath.filter((entry) => entry.files.some((glob) => matches(glob, base, path)));
44
+
45
+ /**
46
+ * The settings one file is checked with. Strongest first: the matching by_path entries' rules and options (the last one
47
+ * written first), chaff.yaml's own rules and options, its style, the genre's preset, the rule's default.
48
+ * A level by_path sets also drops a number chaff.yaml or the style set for that rule, since the level is the closer setting.
49
+ */
50
+ export const configForPath = (config: Config, path: string): Config => {
51
+ const settings = mergePathRules(entriesFor(config.byPath, config.baseDir, path));
52
+ const ids = Object.keys(settings.rules);
53
+ if (ids.length === 0 && settings.optionLayers.length === 0) return config;
54
+ const { applied } = config;
55
+ return {
56
+ ...config,
57
+ rules: { ...config.rules, ...settings.rules },
58
+ limits: { ...without(config.limits, ids), ...settings.limits },
59
+ applied:
60
+ applied === undefined
61
+ ? undefined
62
+ : { ...applied, levelsFrom: applied.levelsFrom.filter((id) => !ids.includes(id)), limits: without(applied.limits, ids) },
63
+ pathLevelsFrom: settings.levelsFrom,
64
+ pathOptionLayers: settings.optionLayers,
65
+ };
66
+ };
67
+
68
+ /** One by_path entry's setting for one rule, for explain and rules --json, which speak of no one file. */
69
+ export type PathRuleLevel = { readonly files: readonly string[]; readonly level: Level; readonly limit?: number };
70
+
71
+ /** Every by_path entry that sets this rule's level or number, in the order written. */
72
+ export const pathLevelsOf = (byPath: readonly PathRule[], ruleId: string): PathRuleLevel[] =>
73
+ byPath.flatMap((entry): PathRuleLevel[] => {
74
+ const level = entry.rules?.[ruleId];
75
+ if (level === undefined) return [];
76
+ const limit = entry.limits?.[ruleId];
77
+ return [limit === undefined ? { files: entry.files, level } : { files: entry.files, level, limit }];
78
+ });
@@ -1,10 +1,19 @@
1
1
  import { relative, sep } from "node:path";
2
+ import type { Level } from "../plugin.ts";
2
3
 
3
4
  export type PathRule = {
4
5
  readonly files: readonly string[];
5
6
  readonly genre: string | undefined;
6
7
  readonly language: string | undefined;
7
8
  readonly profile?: string | undefined;
9
+ /** The entry's rules:, read as the top-level rules: is (levels; a number counts as normal and sits in limits). */
10
+ readonly rules?: Readonly<Record<string, Level>>;
11
+ readonly limits?: Readonly<Record<string, number>>;
12
+ readonly unreadableRules?: readonly { readonly id: string; readonly value: string }[];
13
+ /** The entry's options:, shaped as the top-level options: is ({ rule id: { option: value } }). */
14
+ readonly options?: Readonly<Record<string, unknown>>;
15
+ /** rules: or options: written as something other than a map, as written. */
16
+ readonly unreadableBlocks?: readonly { readonly key: "rules" | "options"; readonly value: string }[];
8
17
  };
9
18
 
10
19
  /**
@@ -0,0 +1,36 @@
1
+ import type { Config } from "./load.ts";
2
+ import type { Texts, UiLanguage } from "../ui.ts";
3
+
4
+ type ConsistentTexts = {
5
+ readonly unreadable: (where: string, value: string) => string;
6
+ readonly twice: (where: string, member: string) => string;
7
+ };
8
+
9
+ const TEXT: Texts<ConsistentTexts> = {
10
+ ja: {
11
+ unreadable: (where, value) =>
12
+ `${where}: consistent の ${value} は組として読めません。consistent には、まぜない語の組を、違う語 2 つ以上の並びで 1 行に 1 つずつ書いてください(- [顧客, お客様])`,
13
+ twice: (where, member) =>
14
+ `${where}: consistent で「${member}」が二つの組に入っています。どちらの組の語と比べるか決まらないので、一つの組にまとめてください`,
15
+ },
16
+ en: {
17
+ unreadable: (where, value) =>
18
+ `${where}: cannot read ${value} under consistent as a group. Write each group as a list of two or more different words, one group per line (- [log in, sign in])`,
19
+ twice: (where, member) => `${where}: "${member}" is in two groups under consistent. It cannot be told which to compare it with; put them in one group`,
20
+ },
21
+ };
22
+
23
+ /** Members listed in more than one group, each once, in the order they first repeat. */
24
+ const repeatedMembers = (groups: readonly (readonly string[])[]): string[] => {
25
+ const members = groups.flatMap((group) => [...new Set(group)]);
26
+ return [...new Set(members.filter((member, at) => members.indexOf(member) !== at))];
27
+ };
28
+
29
+ /** What under consistent in chaff.yaml has no effect or no clear effect: values not read as groups, and words in two groups. */
30
+ export const consistentProblems = (config: Pick<Config, "consistent" | "unreadableConsistent" | "path">, ui: UiLanguage = "ja"): string[] => {
31
+ const where = config.path ?? "chaff.yaml";
32
+ return [
33
+ ...(config.unreadableConsistent ?? []).map((value) => TEXT[ui].unreadable(where, value)),
34
+ ...repeatedMembers(config.consistent ?? []).map((member) => TEXT[ui].twice(where, member)),
35
+ ];
36
+ };
@@ -3,11 +3,14 @@ import { workingDir } from "./working-dir.ts";
3
3
  import { isLevel } from "../levels.ts";
4
4
  import { defaultModel } from "../backends/default-model.ts";
5
5
  import { isBackend, type BackendName } from "../backends/types.ts";
6
- import type { Level } from "../plugin.ts";
6
+ import type { Level, ScopeSelector } from "../plugin.ts";
7
+ import { preferOf, type PreferProblem } from "./prefer.ts";
7
8
  import type { PathRule } from "./by-path.ts";
8
9
  import type { Extensions } from "../extension/load.ts";
9
10
  import type { StyleLimits } from "../style-parse.ts";
10
11
  import type { GuideLayer } from "../genre-guide/layer.ts";
12
+ import { foldTerm } from "../term-form.ts";
13
+ import type { OptionLayer } from "../rule-options.ts";
11
14
 
12
15
  export const CONFIG_FILE = "chaff.yaml";
13
16
 
@@ -30,19 +33,37 @@ export type Config = {
30
33
  readonly jargon: readonly string[];
31
34
  /** チームの表記。{ 使わない書き方: 使う書き方 }。「サーバー」ではなく「サーバ」、のように。 */
32
35
  readonly prefer: Readonly<Record<string, string>>;
36
+ /** prefer's entries written in the object form with a scope: { avoid: the parts of the document the entry counts in }. */
37
+ readonly preferScopes?: Readonly<Record<string, ScopeSelector>>;
38
+ /** prefer's entries that could not be read (an object without use, a scope that cannot be read). Each stops the run. */
39
+ readonly unreadablePrefer?: readonly PreferProblem[];
33
40
  /** この種類の文書に無いと困る見出し。チームが自分で決める。 */
34
41
  readonly requiredSections: readonly string[];
35
42
  /** チームの固有名詞(組織名・製品名)。1 つの名前として読み、漢字の連なりや繰り返しに数えない。 */
36
43
  readonly names: readonly string[];
37
44
  /** names に書かれていたが名前として読めなかった値。黙って捨てると、並べたつもりの名前が効いていないことに気づけない。 */
38
45
  readonly unreadableNames: readonly string[];
46
+ /** The team's terms, each to be written exactly so (GitHub, not Github or GitHub). term-form reads them. */
47
+ readonly terms?: readonly string[];
48
+ /** terms as written that cannot be read as a term: not a list, an entry that is not text, or one that is only spaces and hyphens. */
49
+ readonly unreadableTerms?: readonly string[];
50
+ /** The team's groups of words that are each right but must not be mixed in one document ([顧客, お客様]). term-consistency reads them. */
51
+ readonly consistent?: readonly (readonly string[])[];
52
+ /** consistent as written that cannot be read as a group: not a list, or an entry that is not two or more different words. */
53
+ readonly unreadableConsistent?: readonly string[];
39
54
  /** File-name globs (*.yaml) a directory walk checks besides Markdown. --include adds to them. */
40
55
  readonly include?: readonly string[];
56
+ /** Globs a directory walk leaves out, matched from chaff.yaml's folder as by_path is. A file named on the command line is still checked. */
57
+ readonly exclude?: readonly string[];
41
58
  /** パスごとの上書き。設定ファイルのある場所からの相対で照合する。 */
42
59
  readonly byPath: readonly PathRule[];
43
60
  /** by_path entries that could not be read (a map instead of a list, an entry without files), as written. */
44
61
  readonly unreadableByPath?: readonly string[];
45
62
  readonly baseDir: string;
63
+ /** Set only on the settings one file is checked with (by-path-rules.ts): for each rule a by_path entry set, which entry. */
64
+ readonly pathLevelsFrom?: Readonly<Record<string, string>>;
65
+ /** Set only on the settings one file is checked with: the matching by_path entries' options, strongest first. */
66
+ readonly pathOptionLayers?: readonly OptionLayer[];
46
67
  /** Options set on rules that take them: { rule id: { option: value } }, as written. rule-options.ts checks them against the rules. */
47
68
  readonly options?: Readonly<Record<string, unknown>>;
48
69
  /** options as written when it is not a map. Dropping it silently would leave a team thinking its options apply. */
@@ -59,6 +80,8 @@ export type Config = {
59
80
  readonly fixPlan?: unknown;
60
81
  /** guide as written: the team's changes to the genre guides, or off (genre-guide/of-config.ts reads it). */
61
82
  readonly guide?: unknown;
83
+ /** allow as written: text never to report, each entry with its reason (allow.ts reads and checks it). */
84
+ readonly allow?: unknown;
62
85
  /** plugins as written: package names and paths. extension/plugin-load.ts reads and checks them. */
63
86
  readonly plugins?: unknown;
64
87
  /** The code chaff.yaml names, once loaded (extension/load.ts). Reading chaff.yaml does not load it. */
@@ -133,29 +156,38 @@ const globsOf = (value: unknown): string[] => {
133
156
  return Array.isArray(value) ? value.map((entry) => String(entry)) : [];
134
157
  };
135
158
 
159
+ const PATH_BLOCKS: readonly ("rules" | "options")[] = ["rules", "options"];
160
+
161
+ /** rules: or options: under a by_path entry that is written but is not a map: it changes nothing, so it is reported. */
162
+ const unreadableBlocksOf = (raw: Record<string, unknown>): { key: "rules" | "options"; value: string }[] =>
163
+ PATH_BLOCKS.flatMap((key) => {
164
+ const value = raw[key];
165
+ return value === undefined || value === null || isRecord(value) ? [] : [{ key, value: printed(value) }];
166
+ });
167
+
168
+ /** An entry's rules: and options:, read as the top-level ones are. Nothing is added for an entry that writes neither. */
169
+ const pathRuleSettingsOf = (raw: Record<string, unknown>): Pick<PathRule, "rules" | "limits" | "unreadableRules" | "options" | "unreadableBlocks"> => {
170
+ const written = (key: string): boolean => raw[key] !== undefined && raw[key] !== null;
171
+ const blocks = unreadableBlocksOf(raw);
172
+ const options = raw["options"];
173
+ return {
174
+ ...(written("rules") ? { rules: rulesOf(raw["rules"]), limits: limitsOf(raw["rules"]), unreadableRules: unreadableOf(raw["rules"]) } : {}),
175
+ ...(written("options") ? { options: isRecord(options) ? options : {} } : {}),
176
+ ...(blocks.length === 0 ? {} : { unreadableBlocks: blocks }),
177
+ };
178
+ };
179
+
136
180
  const toPathRule = (raw: unknown): PathRule | undefined => {
137
181
  if (!isRecord(raw)) return undefined;
138
182
  const files = raw["files"];
139
183
  const globs = globsOf(files);
140
184
  if (globs.length === 0) return undefined;
141
- return { files: globs, genre: str(raw["genre"]), language: str(raw["language"]), profile: str(raw["profile"]) };
185
+ return { files: globs, genre: str(raw["genre"]), language: str(raw["language"]), profile: str(raw["profile"]), ...pathRuleSettingsOf(raw) };
142
186
  };
143
187
 
144
188
  /** 利用者が書く語の並び。空白だけのものは落とす。 */
145
189
  const wordsOf = (raw: unknown): string[] => (Array.isArray(raw) ? raw.map((entry) => String(entry).trim()).filter((entry) => entry.length > 0) : []);
146
190
 
147
- /** 両側とも空でない文字列の対だけを読む。同じ語どうし(「サーバ: サーバ」)は何も言えないので捨てる。 */
148
- const preferOf = (raw: unknown): Record<string, string> =>
149
- isRecord(raw)
150
- ? Object.fromEntries(
151
- Object.entries(raw).flatMap(([avoid, use]): [string, string][] => {
152
- const from = avoid.trim();
153
- const to = typeof use === "string" ? use.trim() : "";
154
- return from !== "" && to !== "" && from !== to ? [[from, to]] : [];
155
- }),
156
- )
157
- : {};
158
-
159
191
  const isNameEntry = (value: unknown): value is string | number => typeof value === "string" || typeof value === "number";
160
192
 
161
193
  const printed = (value: unknown): string => JSON.stringify(value) ?? String(value);
@@ -171,6 +203,35 @@ const namesOf = (raw: unknown): { readonly names: string[]; readonly unreadable:
171
203
  };
172
204
  };
173
205
 
206
+ /** A term is text with something besides spaces and hyphens in it; a number (2025) reads as text, as under names. */
207
+ const termsOf = (raw: unknown): { readonly terms: string[]; readonly unreadable: string[] } => {
208
+ if (raw === undefined || raw === null) return { terms: [], unreadable: [] };
209
+ if (!Array.isArray(raw)) return { terms: [], unreadable: [printed(raw)] };
210
+ const entries: unknown[] = raw;
211
+ const isTerm = (entry: unknown): entry is string | number => isNameEntry(entry) && foldTerm(String(entry)) !== "";
212
+ return { terms: wordsOf(entries.filter(isTerm)), unreadable: entries.filter((entry) => !isTerm(entry)).map(printed) };
213
+ };
214
+
215
+ /** A group: a list of two or more different words (a number reads as text, as under names). */
216
+ const groupOf = (entry: unknown): string[] | undefined => {
217
+ if (!Array.isArray(entry)) return undefined;
218
+ const members: unknown[] = entry;
219
+ const words = wordsOf(members);
220
+ return members.every(isNameEntry) && words.length === members.length && new Set(words).size === words.length && words.length >= 2 ? words : undefined;
221
+ };
222
+
223
+ /** consistent is a list of groups. A value that is not a list, and an entry that is not a group, are kept printed to be reported. */
224
+ const consistentOf = (raw: unknown): { readonly groups: string[][]; readonly unreadable: string[] } => {
225
+ if (raw === undefined || raw === null) return { groups: [], unreadable: [] };
226
+ if (!Array.isArray(raw)) return { groups: [], unreadable: [printed(raw)] };
227
+ const entries: unknown[] = raw;
228
+ const read = entries.map((entry) => ({ entry, group: groupOf(entry) }));
229
+ return {
230
+ groups: read.flatMap(({ group }) => (group === undefined ? [] : [group])),
231
+ unreadable: read.filter(({ group }) => group === undefined).map(({ entry }) => printed(entry)),
232
+ };
233
+ };
234
+
174
235
  /** by_path は files を持つ項目の並び。並びでない値と、読めない項目は読めないものとして返す。黙って捨てると、書いた人は効いたつもりでいる。 */
175
236
  export const byPathOf = (raw: unknown): { readonly rules: PathRule[]; readonly unreadable: string[] } => {
176
237
  if (raw === undefined || raw === null) return { rules: [], unreadable: [] };
@@ -189,8 +250,11 @@ export const configOf = (raw: unknown, path: string): Config => {
189
250
  const declared: unknown = raw["ai_backend"];
190
251
  const backend: BackendName = isBackend(declared) ? declared : DEFAULT_BACKEND;
191
252
  const names = namesOf(raw["names"]);
253
+ const terms = termsOf(raw["terms"]);
254
+ const consistent = consistentOf(raw["consistent"]);
192
255
  const byPath = byPathOf(raw["by_path"]);
193
256
  const options: unknown = raw["options"];
257
+ const prefer = preferOf(raw["prefer"]);
194
258
  return {
195
259
  genre: str(raw["genre"]),
196
260
  profile: str(raw["profile"]),
@@ -204,11 +268,18 @@ export const configOf = (raw: unknown, path: string): Config => {
204
268
  aiModel: str(raw["ai_model"]) ?? defaultModel(backend),
205
269
  confidenceThreshold: typeof raw["confidence_threshold"] === "number" ? raw["confidence_threshold"] : 0.7,
206
270
  jargon: wordsOf(raw["jargon"]),
207
- prefer: preferOf(raw["prefer"]),
271
+ prefer: prefer.prefer,
272
+ preferScopes: prefer.scopes,
273
+ unreadablePrefer: prefer.problems,
208
274
  requiredSections: wordsOf(raw["required_sections"]),
209
275
  names: names.names,
210
276
  unreadableNames: names.unreadable,
277
+ terms: terms.terms,
278
+ unreadableTerms: terms.unreadable,
279
+ consistent: consistent.groups,
280
+ unreadableConsistent: consistent.unreadable,
211
281
  include: globsOf(raw["include"]),
282
+ exclude: globsOf(raw["exclude"]),
212
283
  byPath: byPath.rules,
213
284
  unreadableByPath: byPath.unreadable,
214
285
  baseDir: dirname(path),
@@ -220,5 +291,6 @@ export const configOf = (raw: unknown, path: string): Config => {
220
291
  fixPlan: raw["fix_plan"],
221
292
  guide: raw["guide"],
222
293
  plugins: raw["plugins"],
294
+ allow: raw["allow"],
223
295
  };
224
296
  };
@@ -2,6 +2,7 @@ import { CONFIG_FILE, type Config } from "./load.ts";
2
2
  import type { RuleDefinition, RuleOption } from "../plugin.ts";
3
3
  import { optionProblems, type OptionLayer, type OptionProblem } from "../rule-options.ts";
4
4
  import { limitsFor, styleLevelSource, styleSource } from "./style.ts";
5
+ import { pathLevelsOf, type PathRuleLevel } from "./by-path-rules.ts";
5
6
  import type { Texts, UiLanguage } from "../ui.ts";
6
7
 
7
8
  /** Where chaff.yaml's options come from, for settleOptions: the file itself. */
@@ -10,19 +11,21 @@ export const configOptionLayer = (config: Pick<Config, "options">): OptionLayer
10
11
  values: config.options ?? {},
11
12
  });
12
13
 
13
- /** Where a rule's settings come from, for explain: the option layers, the style when it set the level, and a number set for it. */
14
+ /** Where a rule's settings come from, for explain: the option layers, the style when it set the level, a number set for it, and the by_path entries that change it for some files. */
14
15
  export const settingSourcesOf = (
15
- config: Pick<Config, "options" | "applied" | "limits">,
16
+ config: Pick<Config, "options" | "applied" | "limits" | "byPath">,
16
17
  ruleId: string,
17
18
  language: string,
18
- ): { optionLayers: OptionLayer[]; levelFrom: string | undefined; limit: number | undefined } => ({
19
+ ): { optionLayers: OptionLayer[]; levelFrom: string | undefined; limit: number | undefined; byPath: PathRuleLevel[] } => ({
19
20
  optionLayers: optionLayersOf(config),
20
21
  levelFrom: styleLevelSource(config, ruleId),
21
22
  limit: limitsFor(config, language)[ruleId],
23
+ byPath: pathLevelsOf(config.byPath, ruleId),
22
24
  });
23
25
 
24
- /** Every place options come from, strongest first: chaff.yaml, then its style. */
25
- export const optionLayersOf = (config: Pick<Config, "options" | "applied">): OptionLayer[] => [
26
+ /** Every place options come from, strongest first: the file's by_path entries, chaff.yaml, then its style. */
27
+ export const optionLayersOf = (config: Pick<Config, "options" | "applied" | "pathOptionLayers">): OptionLayer[] => [
28
+ ...(config.pathOptionLayers ?? []),
26
29
  configOptionLayer(config),
27
30
  ...(config.applied === undefined ? [] : [{ from: styleSource(config.applied.style), values: config.applied.options }]),
28
31
  ];
@@ -0,0 +1,22 @@
1
+ import type { Config } from "./load.ts";
2
+ import type { Texts, UiLanguage } from "../ui.ts";
3
+ import type { PreferProblem } from "./prefer.ts";
4
+ import { scopeProblemSentence } from "../scope-problem-text.ts";
5
+
6
+ const TEXT: Texts<{ readonly at: (where: string, avoid: string) => string; readonly noUse: string }> = {
7
+ ja: {
8
+ at: (where, avoid) => `${where}: prefer の ${avoid}: `,
9
+ noUse: "使う書き方を use に書いてください(例: { use: 当社, scope: [~quote] })",
10
+ },
11
+ en: {
12
+ at: (where, avoid) => `${where}: prefer ${avoid}: `,
13
+ noUse: "write the spelling to use under use (for example { use: our company, scope: [~quote] })",
14
+ },
15
+ };
16
+
17
+ const detailOf = (problem: PreferProblem, ui: UiLanguage): string =>
18
+ problem.kind === "no-use" ? TEXT[ui].noUse : scopeProblemSentence(problem.scope.kind, problem.scope.written, ui);
19
+
20
+ /** prefer's entries that cannot be used. Each stops the run: an entry that silently does not count looks like a clean document. */
21
+ export const preferProblems = (config: Pick<Config, "unreadablePrefer" | "path">, ui: UiLanguage): string[] =>
22
+ (config.unreadablePrefer ?? []).map((problem) => `chaff: ${TEXT[ui].at(config.path ?? "chaff.yaml", problem.avoid)}${detailOf(problem, ui)}`);
@@ -0,0 +1,52 @@
1
+ import type { ScopeSelector } from "../plugin.ts";
2
+ import { scopeSelectorOf, type ScopeProblem } from "../text-scope.ts";
3
+
4
+ // prefer in chaff.yaml: { avoid: use }, and for an entry limited to some parts of the document the object form
5
+ // { avoid: { use, scope } }. Both forms may sit in one map. Pure: the YAML comes in parsed.
6
+
7
+ /** An entry that could not be read: an object form without use, or with a scope that cannot be read. */
8
+ export type PreferProblem =
9
+ { readonly avoid: string; readonly kind: "no-use" } | { readonly avoid: string; readonly kind: "scope"; readonly scope: ScopeProblem };
10
+
11
+ type Prefer = {
12
+ /** { avoid: use } for every entry, either form. */
13
+ readonly prefer: Readonly<Record<string, string>>;
14
+ /** The scope of each entry written with one. */
15
+ readonly scopes: Readonly<Record<string, ScopeSelector>>;
16
+ readonly problems: readonly PreferProblem[];
17
+ };
18
+
19
+ type Entry = { readonly avoid: string; readonly use: string; readonly scope?: ScopeSelector } | { readonly problem: PreferProblem } | undefined;
20
+
21
+ const isRecord = (value: unknown): value is Record<string, unknown> => typeof value === "object" && value !== null && !Array.isArray(value);
22
+
23
+ const textOf = (value: unknown): string => (typeof value === "string" ? value.trim() : "");
24
+
25
+ /** The object form: use, and scope when written. */
26
+ const objectEntry = (avoid: string, written: Readonly<Record<string, unknown>>): Entry => {
27
+ const use = textOf(written["use"]);
28
+ if (use === "") return { problem: { avoid, kind: "no-use" } };
29
+ if (use === avoid) return undefined;
30
+ if (written["scope"] === undefined) return { avoid, use };
31
+ const read = scopeSelectorOf(written["scope"]);
32
+ return "selector" in read ? { avoid, use, scope: read.selector } : { problem: { avoid, kind: "scope", scope: read.problem } };
33
+ };
34
+
35
+ /** One entry. Both sides must be non-empty and differ (サーバ: サーバ says nothing); a value that is neither form is left out, as before. */
36
+ const entryOf = (written: string, value: unknown): Entry => {
37
+ const avoid = written.trim();
38
+ if (avoid === "") return undefined;
39
+ if (isRecord(value)) return objectEntry(avoid, value);
40
+ const use = textOf(value);
41
+ return use === "" || use === avoid ? undefined : { avoid, use };
42
+ };
43
+
44
+ export const preferOf = (raw: unknown): Prefer => {
45
+ const entries = isRecord(raw) ? Object.entries(raw).map(([avoid, value]) => entryOf(avoid, value)) : [];
46
+ const read = entries.flatMap((entry) => (entry === undefined || "problem" in entry ? [] : [entry]));
47
+ return {
48
+ prefer: Object.fromEntries(read.map((entry) => [entry.avoid, entry.use])),
49
+ scopes: Object.fromEntries(read.flatMap((entry) => (entry.scope === undefined ? [] : [[entry.avoid, entry.scope]]))),
50
+ problems: entries.flatMap((entry) => (entry !== undefined && "problem" in entry ? [entry.problem] : [])),
51
+ };
52
+ };
@@ -0,0 +1,38 @@
1
+ import type { Config } from "./load.ts";
2
+ import type { Texts, UiLanguage } from "../ui.ts";
3
+ import { foldTerm } from "../term-form.ts";
4
+
5
+ type TermTexts = {
6
+ readonly unreadable: (where: string, value: string) => string;
7
+ readonly clash: (where: string, first: string, second: string) => string;
8
+ };
9
+
10
+ const TEXT: Texts<TermTexts> = {
11
+ ja: {
12
+ unreadable: (where, value) => `${where}: terms の ${value} は語として読めません。terms には決まった書き方の語を 1 行に 1 つずつ並べてください(- GitHub)`,
13
+ clash: (where, first, second) =>
14
+ `${where}: terms の「${first}」と「${second}」は字の大小・幅・ハイフン・空白だけが違います。どちらも正しい書き方として扱うので、互いを指摘しません。決まった書き方を 1 つにしてください`,
15
+ },
16
+ en: {
17
+ unreadable: (where, value) =>
18
+ `${where}: cannot read ${value} under terms as a term. Write terms as a list, one term per line, as it must be written (- GitHub)`,
19
+ clash: (where, first, second) =>
20
+ `${where}: "${first}" and "${second}" under terms differ only in case, width, hyphens or spaces. Both are taken as right, so neither is reported; keep the one the team writes`,
21
+ },
22
+ };
23
+
24
+ /** Listed terms that fold to the same one, as the first written and each other spelling. */
25
+ const clashesOf = (terms: readonly string[]): { readonly first: string; readonly second: string }[] =>
26
+ terms.flatMap((term, at) => {
27
+ const first = terms.slice(0, at).find((earlier) => foldTerm(earlier) === foldTerm(term) && earlier !== term);
28
+ return first === undefined || terms.slice(0, at).includes(term) ? [] : [{ first, second: term }];
29
+ });
30
+
31
+ /** What under terms in chaff.yaml has no effect: values not read as terms, and terms that differ only in what term-form sets aside. */
32
+ export const termProblems = (config: Pick<Config, "terms" | "unreadableTerms" | "path">, ui: UiLanguage = "ja"): string[] => {
33
+ const where = config.path ?? "chaff.yaml";
34
+ return [
35
+ ...(config.unreadableTerms ?? []).map((value) => TEXT[ui].unreadable(where, value)),
36
+ ...clashesOf(config.terms ?? []).map(({ first, second }) => TEXT[ui].clash(where, first, second)),
37
+ ];
38
+ };
@@ -3,15 +3,22 @@ import type { RuleDefinition } from "../plugin.ts";
3
3
  import type { UiLanguage } from "../ui.ts";
4
4
  import { ruleProblems } from "./rule-problems.ts";
5
5
  import { nameProblems } from "./name-problems.ts";
6
- import { byPathProblems } from "./by-path-problems.ts";
6
+ import { termProblems } from "./term-problems.ts";
7
+ import { consistentProblems } from "./consistent-problems.ts";
8
+ import { byPathProblems, byPathRuleProblems } from "./by-path-problems.ts";
9
+ import { allowRuleWarnings } from "./allow-problems.ts";
7
10
  import { configOptionProblems } from "./option-problems.ts";
8
11
  import { configGuideProblems } from "../genre-guide/of-config.ts";
9
12
 
10
- /** Everything in chaff.yaml that has no effect: unknown rules or levels, unreadable names or by_path entries, options that do not apply, guides that cannot be read. Said before the results. */
13
+ /** Everything in chaff.yaml that has no effect: unknown rules or levels, unreadable names, terms, consistent groups or by_path entries, rules under allow that chaff does not have, options that do not apply, guides that cannot be read. Said before the results. */
11
14
  export const settingWarnings = (config: Config, rules: readonly RuleDefinition[], ui: UiLanguage): string[] => [
12
15
  ...ruleProblems(config, rules, ui),
13
16
  ...nameProblems(config, ui),
17
+ ...termProblems(config, ui),
18
+ ...consistentProblems(config, ui),
14
19
  ...byPathProblems(config, ui),
20
+ ...byPathRuleProblems(config, rules, ui),
21
+ ...allowRuleWarnings(config, rules, ui),
15
22
  ...configOptionProblems(config, rules, ui),
16
23
  ...configGuideProblems(config, ui),
17
24
  ];