chaffjs 0.16.0 → 0.18.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.
- package/dist/announced-count.d.ts +26 -0
- package/dist/announced-count.d.ts.map +1 -0
- package/dist/announced-count.js +104 -0
- package/dist/announced-count.js.map +1 -0
- package/dist/bare-url.d.ts +14 -0
- package/dist/bare-url.d.ts.map +1 -0
- package/dist/bare-url.js +28 -0
- package/dist/bare-url.js.map +1 -0
- package/dist/baseline.d.ts +5 -0
- package/dist/baseline.d.ts.map +1 -1
- package/dist/baseline.js +16 -1
- package/dist/baseline.js.map +1 -1
- package/dist/body-section.d.ts +7 -0
- package/dist/body-section.d.ts.map +1 -0
- package/dist/body-section.js +6 -0
- package/dist/body-section.js.map +1 -0
- package/dist/calendar-number.d.ts +9 -2
- package/dist/calendar-number.d.ts.map +1 -1
- package/dist/calendar-number.js +18 -4
- package/dist/calendar-number.js.map +1 -1
- package/dist/cli-args.d.ts +4 -0
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +5 -0
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-text.d.ts.map +1 -1
- package/dist/cli-text.js +8 -4
- package/dist/cli-text.js.map +1 -1
- package/dist/cli.js +33 -30
- package/dist/cli.js.map +1 -1
- package/dist/closing-numbers.d.ts +20 -0
- package/dist/closing-numbers.d.ts.map +1 -0
- package/dist/closing-numbers.js +56 -0
- package/dist/closing-numbers.js.map +1 -0
- package/dist/commands/compare.d.ts +8 -0
- package/dist/commands/compare.d.ts.map +1 -0
- package/dist/commands/compare.js +72 -0
- package/dist/commands/compare.js.map +1 -0
- package/dist/commands/eval.d.ts.map +1 -1
- package/dist/commands/eval.js +17 -9
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/feedback.d.ts +5 -2
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +11 -5
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +13 -13
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/tree.d.ts +13 -0
- package/dist/commands/tree.d.ts.map +1 -1
- package/dist/commands/tree.js +35 -5
- package/dist/commands/tree.js.map +1 -1
- package/dist/compare/atom.d.ts +31 -0
- package/dist/compare/atom.d.ts.map +1 -0
- package/dist/compare/atom.js +4 -0
- package/dist/compare/atom.js.map +1 -0
- package/dist/compare/clock-time.d.ts +8 -0
- package/dist/compare/clock-time.d.ts.map +1 -0
- package/dist/compare/clock-time.js +65 -0
- package/dist/compare/clock-time.js.map +1 -0
- package/dist/compare/extract.d.ts +15 -0
- package/dist/compare/extract.d.ts.map +1 -0
- package/dist/compare/extract.js +58 -0
- package/dist/compare/extract.js.map +1 -0
- package/dist/compare/fact-text.d.ts +23 -0
- package/dist/compare/fact-text.d.ts.map +1 -0
- package/dist/compare/fact-text.js +47 -0
- package/dist/compare/fact-text.js.map +1 -0
- package/dist/compare/markup-atoms.d.ts +11 -0
- package/dist/compare/markup-atoms.d.ts.map +1 -0
- package/dist/compare/markup-atoms.js +23 -0
- package/dist/compare/markup-atoms.js.map +1 -0
- package/dist/compare/match.d.ts +19 -0
- package/dist/compare/match.d.ts.map +1 -0
- package/dist/compare/match.js +84 -0
- package/dist/compare/match.js.map +1 -0
- package/dist/compare/outcome.d.ts +33 -0
- package/dist/compare/outcome.d.ts.map +1 -0
- package/dist/compare/outcome.js +40 -0
- package/dist/compare/outcome.js.map +1 -0
- package/dist/compare/proper-nouns.d.ts +19 -0
- package/dist/compare/proper-nouns.d.ts.map +1 -0
- package/dist/compare/proper-nouns.js +44 -0
- package/dist/compare/proper-nouns.js.map +1 -0
- package/dist/compare/render.d.ts +9 -0
- package/dist/compare/render.d.ts.map +1 -0
- package/dist/compare/render.js +64 -0
- package/dist/compare/render.js.map +1 -0
- package/dist/compare/spans.d.ts +9 -0
- package/dist/compare/spans.d.ts.map +1 -0
- package/dist/compare/spans.js +11 -0
- package/dist/compare/spans.js.map +1 -0
- package/dist/compare/text-atoms.d.ts +24 -0
- package/dist/compare/text-atoms.d.ts.map +1 -0
- package/dist/compare/text-atoms.js +67 -0
- package/dist/compare/text-atoms.js.map +1 -0
- package/dist/compare/text.d.ts +24 -0
- package/dist/compare/text.d.ts.map +1 -0
- package/dist/compare/text.js +90 -0
- package/dist/compare/text.js.map +1 -0
- package/dist/compare/tree-atoms.d.ts +20 -0
- package/dist/compare/tree-atoms.d.ts.map +1 -0
- package/dist/compare/tree-atoms.js +58 -0
- package/dist/compare/tree-atoms.js.map +1 -0
- package/dist/compare/written-names.d.ts +8 -0
- package/dist/compare/written-names.d.ts.map +1 -0
- package/dist/compare/written-names.js +24 -0
- package/dist/compare/written-names.js.map +1 -0
- package/dist/config/load.d.ts +15 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +5 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/option-problems.d.ts +16 -0
- package/dist/config/option-problems.d.ts.map +1 -0
- package/dist/config/option-problems.js +58 -0
- package/dist/config/option-problems.js.map +1 -0
- package/dist/config/read.d.ts +4 -0
- package/dist/config/read.d.ts.map +1 -0
- package/dist/config/read.js +8 -0
- package/dist/config/read.js.map +1 -0
- package/dist/config/rule-problems.d.ts +2 -4
- package/dist/config/rule-problems.d.ts.map +1 -1
- package/dist/config/rule-problems.js +7 -1
- package/dist/config/rule-problems.js.map +1 -1
- package/dist/config/style.d.ts +16 -0
- package/dist/config/style.d.ts.map +1 -0
- package/dist/config/style.js +36 -0
- package/dist/config/style.js.map +1 -0
- package/dist/config/warnings.d.ts +6 -0
- package/dist/config/warnings.d.ts.map +1 -0
- package/dist/config/warnings.js +10 -0
- package/dist/config/warnings.js.map +1 -0
- package/dist/config/write.d.ts.map +1 -1
- package/dist/config/write.js +17 -4
- package/dist/config/write.js.map +1 -1
- package/dist/custom/bounded-match.d.ts +15 -0
- package/dist/custom/bounded-match.d.ts.map +1 -0
- package/dist/custom/bounded-match.js +43 -0
- package/dist/custom/bounded-match.js.map +1 -0
- package/dist/custom/load.d.ts +8 -0
- package/dist/custom/load.d.ts.map +1 -0
- package/dist/custom/load.js +11 -0
- package/dist/custom/load.js.map +1 -0
- package/dist/custom/parse.d.ts +70 -0
- package/dist/custom/parse.d.ts.map +1 -0
- package/dist/custom/parse.js +215 -0
- package/dist/custom/parse.js.map +1 -0
- package/dist/custom/problems.d.ts +5 -0
- package/dist/custom/problems.d.ts.map +1 -0
- package/dist/custom/problems.js +78 -0
- package/dist/custom/problems.js.map +1 -0
- package/dist/custom/regex-safety.d.ts +11 -0
- package/dist/custom/regex-safety.d.ts.map +1 -0
- package/dist/custom/regex-safety.js +110 -0
- package/dist/custom/regex-safety.js.map +1 -0
- package/dist/custom/token-pattern.d.ts +8 -0
- package/dist/custom/token-pattern.d.ts.map +1 -0
- package/dist/custom/token-pattern.js +75 -0
- package/dist/custom/token-pattern.js.map +1 -0
- package/dist/detect.d.ts.map +1 -1
- package/dist/detect.js +24 -2
- package/dist/detect.js.map +1 -1
- package/dist/detectors/acronym-context.d.ts +4 -0
- package/dist/detectors/acronym-context.d.ts.map +1 -1
- package/dist/detectors/acronym-context.js +25 -4
- package/dist/detectors/acronym-context.js.map +1 -1
- package/dist/detectors/acronym-expansion.d.ts +2 -0
- package/dist/detectors/acronym-expansion.d.ts.map +1 -1
- package/dist/detectors/acronym-expansion.js +104 -1
- package/dist/detectors/acronym-expansion.js.map +1 -1
- package/dist/detectors/agreement-slip.d.ts +32 -0
- package/dist/detectors/agreement-slip.d.ts.map +1 -0
- package/dist/detectors/agreement-slip.js +137 -0
- package/dist/detectors/agreement-slip.js.map +1 -0
- package/dist/detectors/ai-phrasing.d.ts +20 -0
- package/dist/detectors/ai-phrasing.d.ts.map +1 -0
- package/dist/detectors/ai-phrasing.js +112 -0
- package/dist/detectors/ai-phrasing.js.map +1 -0
- package/dist/detectors/announced-count.d.ts +4 -0
- package/dist/detectors/announced-count.d.ts.map +1 -0
- package/dist/detectors/announced-count.js +20 -0
- package/dist/detectors/announced-count.js.map +1 -0
- package/dist/detectors/broken-link.d.ts +17 -0
- package/dist/detectors/broken-link.d.ts.map +1 -0
- package/dist/detectors/broken-link.js +66 -0
- package/dist/detectors/broken-link.js.map +1 -0
- package/dist/detectors/cited-name.d.ts.map +1 -1
- package/dist/detectors/cited-name.js +4 -4
- package/dist/detectors/cited-name.js.map +1 -1
- package/dist/detectors/cited-title.d.ts +11 -0
- package/dist/detectors/cited-title.d.ts.map +1 -0
- package/dist/detectors/cited-title.js +75 -0
- package/dist/detectors/cited-title.js.map +1 -0
- package/dist/detectors/concrete-evidence.d.ts +1 -1
- package/dist/detectors/concrete-evidence.d.ts.map +1 -1
- package/dist/detectors/concrete-evidence.js +2 -1
- package/dist/detectors/concrete-evidence.js.map +1 -1
- package/dist/detectors/content-morphemes.d.ts +4 -0
- package/dist/detectors/content-morphemes.d.ts.map +1 -0
- package/dist/detectors/content-morphemes.js +12 -0
- package/dist/detectors/content-morphemes.js.map +1 -0
- package/dist/detectors/contrast-frame.d.ts +17 -0
- package/dist/detectors/contrast-frame.d.ts.map +1 -0
- package/dist/detectors/contrast-frame.js +32 -0
- package/dist/detectors/contrast-frame.js.map +1 -0
- package/dist/detectors/custom.d.ts +8 -0
- package/dist/detectors/custom.d.ts.map +1 -0
- package/dist/detectors/custom.js +71 -0
- package/dist/detectors/custom.js.map +1 -0
- package/dist/detectors/dangling-figure.d.ts +4 -0
- package/dist/detectors/dangling-figure.d.ts.map +1 -0
- package/dist/detectors/dangling-figure.js +18 -0
- package/dist/detectors/dangling-figure.js.map +1 -0
- package/dist/detectors/doubled-punctuation.d.ts +9 -0
- package/dist/detectors/doubled-punctuation.d.ts.map +1 -0
- package/dist/detectors/doubled-punctuation.js +33 -0
- package/dist/detectors/doubled-punctuation.js.map +1 -0
- package/dist/detectors/doubled-word.d.ts +5 -0
- package/dist/detectors/doubled-word.d.ts.map +1 -1
- package/dist/detectors/doubled-word.js +24 -11
- package/dist/detectors/doubled-word.js.map +1 -1
- package/dist/detectors/en-shape.d.ts +0 -1
- package/dist/detectors/en-shape.d.ts.map +1 -1
- package/dist/detectors/en-shape.js +0 -235
- package/dist/detectors/en-shape.js.map +1 -1
- package/dist/detectors/enumerated-runs.d.ts +1 -1
- package/dist/detectors/enumerated-runs.d.ts.map +1 -1
- package/dist/detectors/enumerated-runs.js +15 -4
- package/dist/detectors/enumerated-runs.js.map +1 -1
- package/dist/detectors/gram-furniture.d.ts +6 -0
- package/dist/detectors/gram-furniture.d.ts.map +1 -0
- package/dist/detectors/gram-furniture.js +21 -0
- package/dist/detectors/gram-furniture.js.map +1 -0
- package/dist/detectors/gram-place.d.ts +2 -0
- package/dist/detectors/gram-place.d.ts.map +1 -1
- package/dist/detectors/gram-place.js +9 -7
- package/dist/detectors/gram-place.js.map +1 -1
- package/dist/detectors/gram-windows.d.ts +9 -0
- package/dist/detectors/gram-windows.d.ts.map +1 -0
- package/dist/detectors/gram-windows.js +27 -0
- package/dist/detectors/gram-windows.js.map +1 -0
- package/dist/detectors/heading-case.d.ts +2 -0
- package/dist/detectors/heading-case.d.ts.map +1 -1
- package/dist/detectors/heading-case.js +29 -2
- package/dist/detectors/heading-case.js.map +1 -1
- package/dist/detectors/heading-code-words.d.ts +6 -0
- package/dist/detectors/heading-code-words.d.ts.map +1 -0
- package/dist/detectors/heading-code-words.js +29 -0
- package/dist/detectors/heading-code-words.js.map +1 -0
- package/dist/detectors/heading-echo.d.ts.map +1 -1
- package/dist/detectors/heading-echo.js +17 -20
- package/dist/detectors/heading-echo.js.map +1 -1
- package/dist/detectors/heading-level-skip.d.ts +12 -0
- package/dist/detectors/heading-level-skip.d.ts.map +1 -0
- package/dist/detectors/heading-level-skip.js +11 -0
- package/dist/detectors/heading-level-skip.js.map +1 -0
- package/dist/detectors/heading-overlap.d.ts +13 -0
- package/dist/detectors/heading-overlap.d.ts.map +1 -0
- package/dist/detectors/heading-overlap.js +52 -0
- package/dist/detectors/heading-overlap.js.map +1 -0
- package/dist/detectors/image-alt-text.d.ts +3 -0
- package/dist/detectors/image-alt-text.d.ts.map +1 -0
- package/dist/detectors/image-alt-text.js +9 -0
- package/dist/detectors/image-alt-text.js.map +1 -0
- package/dist/detectors/index.d.ts.map +1 -1
- package/dist/detectors/index.js +40 -2
- package/dist/detectors/index.js.map +1 -1
- package/dist/detectors/kutoten-consistency.d.ts +24 -0
- package/dist/detectors/kutoten-consistency.d.ts.map +1 -0
- package/dist/detectors/kutoten-consistency.js +77 -0
- package/dist/detectors/kutoten-consistency.js.map +1 -0
- package/dist/detectors/lead-in.d.ts +1 -0
- package/dist/detectors/lead-in.d.ts.map +1 -1
- package/dist/detectors/lead-in.js +2 -1
- package/dist/detectors/lead-in.js.map +1 -1
- package/dist/detectors/letter-joined-name.d.ts +13 -0
- package/dist/detectors/letter-joined-name.d.ts.map +1 -0
- package/dist/detectors/letter-joined-name.js +11 -0
- package/dist/detectors/letter-joined-name.js.map +1 -0
- package/dist/detectors/lexicon-match.d.ts +4 -0
- package/dist/detectors/lexicon-match.d.ts.map +1 -1
- package/dist/detectors/lexicon-match.js +7 -2
- package/dist/detectors/lexicon-match.js.map +1 -1
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +5 -2
- package/dist/detectors/lexicon.js.map +1 -1
- package/dist/detectors/list-item.d.ts +45 -0
- package/dist/detectors/list-item.d.ts.map +1 -0
- package/dist/detectors/list-item.js +88 -0
- package/dist/detectors/list-item.js.map +1 -0
- package/dist/detectors/list-items.d.ts +31 -0
- package/dist/detectors/list-items.d.ts.map +1 -0
- package/dist/detectors/list-items.js +113 -0
- package/dist/detectors/list-items.js.map +1 -0
- package/dist/detectors/list-lead-in.d.ts +7 -0
- package/dist/detectors/list-lead-in.d.ts.map +1 -0
- package/dist/detectors/list-lead-in.js +28 -0
- package/dist/detectors/list-lead-in.js.map +1 -0
- package/dist/detectors/list-sentence.d.ts +65 -0
- package/dist/detectors/list-sentence.d.ts.map +1 -0
- package/dist/detectors/list-sentence.js +105 -0
- package/dist/detectors/list-sentence.js.map +1 -0
- package/dist/detectors/list-view.d.ts +34 -0
- package/dist/detectors/list-view.d.ts.map +1 -0
- package/dist/detectors/list-view.js +137 -0
- package/dist/detectors/list-view.js.map +1 -0
- package/dist/detectors/long-vowel.d.ts +7 -0
- package/dist/detectors/long-vowel.d.ts.map +1 -0
- package/dist/detectors/long-vowel.js +57 -0
- package/dist/detectors/long-vowel.js.map +1 -0
- package/dist/detectors/markup-finding.d.ts +6 -0
- package/dist/detectors/markup-finding.d.ts.map +1 -0
- package/dist/detectors/markup-finding.js +19 -0
- package/dist/detectors/markup-finding.js.map +1 -0
- package/dist/detectors/name-numeral.d.ts +1 -1
- package/dist/detectors/name-numeral.d.ts.map +1 -1
- package/dist/detectors/name-numeral.js +2 -7
- package/dist/detectors/name-numeral.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +16 -12
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/oxford-comma.d.ts +9 -0
- package/dist/detectors/oxford-comma.d.ts.map +1 -0
- package/dist/detectors/oxford-comma.js +246 -0
- package/dist/detectors/oxford-comma.js.map +1 -0
- package/dist/detectors/place-run.d.ts.map +1 -1
- package/dist/detectors/place-run.js +10 -6
- package/dist/detectors/place-run.js.map +1 -1
- package/dist/detectors/placeholder-text.d.ts +9 -0
- package/dist/detectors/placeholder-text.d.ts.map +1 -0
- package/dist/detectors/placeholder-text.js +18 -0
- package/dist/detectors/placeholder-text.js.map +1 -0
- package/dist/detectors/quote-around.d.ts +3 -0
- package/dist/detectors/quote-around.d.ts.map +1 -0
- package/dist/detectors/quote-around.js +8 -0
- package/dist/detectors/quote-around.js.map +1 -0
- package/dist/detectors/register.d.ts +11 -3
- package/dist/detectors/register.d.ts.map +1 -1
- package/dist/detectors/register.js +28 -9
- package/dist/detectors/register.js.map +1 -1
- package/dist/detectors/roman-numeral.d.ts +2 -0
- package/dist/detectors/roman-numeral.d.ts.map +1 -1
- package/dist/detectors/roman-numeral.js +2 -0
- package/dist/detectors/roman-numeral.js.map +1 -1
- package/dist/detectors/sentence-ending.d.ts +17 -1
- package/dist/detectors/sentence-ending.d.ts.map +1 -1
- package/dist/detectors/sentence-ending.js +13 -7
- package/dist/detectors/sentence-ending.js.map +1 -1
- package/dist/detectors/sentence-length.d.ts.map +1 -1
- package/dist/detectors/sentence-length.js +13 -4
- package/dist/detectors/sentence-length.js.map +1 -1
- package/dist/detectors/signals.d.ts +8 -0
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +94 -54
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/stacked-hedge.d.ts +0 -7
- package/dist/detectors/stacked-hedge.d.ts.map +1 -1
- package/dist/detectors/stacked-hedge.js +6 -3
- package/dist/detectors/stacked-hedge.js.map +1 -1
- package/dist/detectors/stray-space.d.ts +7 -0
- package/dist/detectors/stray-space.d.ts.map +1 -0
- package/dist/detectors/stray-space.js +34 -0
- package/dist/detectors/stray-space.js.map +1 -0
- package/dist/detectors/structure-tree.d.ts +6 -0
- package/dist/detectors/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +37 -1
- package/dist/detectors/structure-tree.js.map +1 -1
- package/dist/detectors/structure.d.ts +4 -4
- package/dist/detectors/structure.d.ts.map +1 -1
- package/dist/detectors/structure.js +7 -6
- package/dist/detectors/structure.js.map +1 -1
- package/dist/detectors/superlative-name.d.ts.map +1 -1
- package/dist/detectors/superlative-name.js +8 -5
- package/dist/detectors/superlative-name.js.map +1 -1
- package/dist/detectors/superlative-scope.d.ts.map +1 -1
- package/dist/detectors/superlative-scope.js +9 -4
- package/dist/detectors/superlative-scope.js.map +1 -1
- package/dist/detectors/token-column.d.ts +46 -0
- package/dist/detectors/token-column.d.ts.map +1 -0
- package/dist/detectors/token-column.js +95 -0
- package/dist/detectors/token-column.js.map +1 -0
- package/dist/detectors/unbalanced-bracket.d.ts +22 -0
- package/dist/detectors/unbalanced-bracket.d.ts.map +1 -0
- package/dist/detectors/unbalanced-bracket.js +119 -0
- package/dist/detectors/unbalanced-bracket.js.map +1 -0
- package/dist/detectors/url-run-on.d.ts +9 -0
- package/dist/detectors/url-run-on.d.ts.map +1 -0
- package/dist/detectors/url-run-on.js +19 -0
- package/dist/detectors/url-run-on.js.map +1 -0
- package/dist/document-sections.d.ts +13 -0
- package/dist/document-sections.d.ts.map +1 -0
- package/dist/document-sections.js +32 -0
- package/dist/document-sections.js.map +1 -0
- package/dist/document.d.ts +11 -4
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +99 -95
- package/dist/document.js.map +1 -1
- package/dist/email-parts.d.ts +28 -0
- package/dist/email-parts.d.ts.map +1 -0
- package/dist/email-parts.js +230 -0
- package/dist/email-parts.js.map +1 -0
- package/dist/eval.d.ts +2 -1
- package/dist/eval.d.ts.map +1 -1
- package/dist/eval.js +16 -4
- package/dist/eval.js.map +1 -1
- package/dist/figure-references.d.ts +30 -0
- package/dist/figure-references.d.ts.map +1 -0
- package/dist/figure-references.js +76 -0
- package/dist/figure-references.js.map +1 -0
- package/dist/files.d.ts +2 -0
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +4 -0
- package/dist/files.js.map +1 -1
- package/dist/genre-parse.d.ts +5 -1
- package/dist/genre-parse.d.ts.map +1 -1
- package/dist/genre-parse.js +16 -3
- package/dist/genre-parse.js.map +1 -1
- package/dist/genre-suggest.d.ts.map +1 -1
- package/dist/genre-suggest.js +15 -1
- package/dist/genre-suggest.js.map +1 -1
- package/dist/heading-label.d.ts +22 -0
- package/dist/heading-label.d.ts.map +1 -0
- package/dist/heading-label.js +50 -0
- package/dist/heading-label.js.map +1 -0
- package/dist/in-page-nav.d.ts +4 -1
- package/dist/in-page-nav.d.ts.map +1 -1
- package/dist/in-page-nav.js +53 -18
- package/dist/in-page-nav.js.map +1 -1
- package/dist/joined-view.d.ts.map +1 -1
- package/dist/joined-view.js +1 -0
- package/dist/joined-view.js.map +1 -1
- package/dist/levels.d.ts +5 -1
- package/dist/levels.d.ts.map +1 -1
- package/dist/levels.js +9 -0
- package/dist/levels.js.map +1 -1
- package/dist/line-paragraphs.d.ts +8 -0
- package/dist/line-paragraphs.d.ts.map +1 -1
- package/dist/line-paragraphs.js +36 -11
- package/dist/line-paragraphs.js.map +1 -1
- package/dist/long-vowel.d.ts +35 -0
- package/dist/long-vowel.d.ts.map +1 -0
- package/dist/long-vowel.js +71 -0
- package/dist/long-vowel.js.map +1 -0
- package/dist/markdown-node.d.ts +19 -0
- package/dist/markdown-node.d.ts.map +1 -0
- package/dist/markdown-node.js +6 -0
- package/dist/markdown-node.js.map +1 -0
- package/dist/markdown-read.d.ts +17 -0
- package/dist/markdown-read.d.ts.map +1 -0
- package/dist/markdown-read.js +37 -0
- package/dist/markdown-read.js.map +1 -0
- package/dist/markup.d.ts +22 -0
- package/dist/markup.d.ts.map +1 -0
- package/dist/markup.js +180 -0
- package/dist/markup.js.map +1 -0
- package/dist/mask.d.ts.map +1 -1
- package/dist/mask.js +10 -16
- package/dist/mask.js.map +1 -1
- package/dist/number-name.d.ts +21 -5
- package/dist/number-name.d.ts.map +1 -1
- package/dist/number-name.js +120 -18
- package/dist/number-name.js.map +1 -1
- package/dist/opening-line.d.ts +3 -0
- package/dist/opening-line.d.ts.map +1 -0
- package/dist/opening-line.js +14 -0
- package/dist/opening-line.js.map +1 -0
- package/dist/orthography.d.ts +7 -1
- package/dist/orthography.d.ts.map +1 -1
- package/dist/orthography.js +16 -5
- package/dist/orthography.js.map +1 -1
- package/dist/page-furniture.d.ts +5 -2
- package/dist/page-furniture.d.ts.map +1 -1
- package/dist/page-furniture.js +8 -2
- package/dist/page-furniture.js.map +1 -1
- package/dist/paragraph-length.d.ts +7 -0
- package/dist/paragraph-length.d.ts.map +1 -0
- package/dist/paragraph-length.js +10 -0
- package/dist/paragraph-length.js.map +1 -0
- package/dist/plain-source.d.ts +1 -0
- package/dist/plain-source.d.ts.map +1 -1
- package/dist/plain-source.js +2 -1
- package/dist/plain-source.js.map +1 -1
- package/dist/plugin.d.ts +121 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/profile/for-file.d.ts.map +1 -1
- package/dist/profile/for-file.js +3 -1
- package/dist/profile/for-file.js.map +1 -1
- package/dist/quoted-span.d.ts +0 -2
- package/dist/quoted-span.d.ts.map +1 -1
- package/dist/quoted-span.js +9 -4
- package/dist/quoted-span.js.map +1 -1
- package/dist/reasons.d.ts +3 -0
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +6 -0
- package/dist/reasons.js.map +1 -1
- package/dist/reference-lists.d.ts +3 -0
- package/dist/reference-lists.d.ts.map +1 -0
- package/dist/reference-lists.js +75 -0
- package/dist/reference-lists.js.map +1 -0
- package/dist/render/explain.d.ts +7 -1
- package/dist/render/explain.d.ts.map +1 -1
- package/dist/render/explain.js +36 -12
- package/dist/render/explain.js.map +1 -1
- package/dist/render/friendly.d.ts.map +1 -1
- package/dist/render/friendly.js +19 -9
- package/dist/render/friendly.js.map +1 -1
- package/dist/render/options.d.ts +7 -0
- package/dist/render/options.d.ts.map +1 -0
- package/dist/render/options.js +50 -0
- package/dist/render/options.js.map +1 -0
- package/dist/render/rules-json.d.ts +4 -1
- package/dist/render/rules-json.d.ts.map +1 -1
- package/dist/render/rules-json.js +102 -12
- package/dist/render/rules-json.js.map +1 -1
- package/dist/render/rules-table.d.ts +4 -0
- package/dist/render/rules-table.d.ts.map +1 -0
- package/dist/render/rules-table.js +70 -0
- package/dist/render/rules-table.js.map +1 -0
- package/dist/render/sarif.js +4 -4
- package/dist/render/sarif.js.map +1 -1
- package/dist/render/semantic.js +3 -3
- package/dist/render/semantic.js.map +1 -1
- package/dist/render/severity-name.d.ts +6 -0
- package/dist/render/severity-name.d.ts.map +1 -0
- package/dist/render/severity-name.js +7 -0
- package/dist/render/severity-name.js.map +1 -0
- package/dist/render/text.d.ts +7 -2
- package/dist/render/text.d.ts.map +1 -1
- package/dist/render/text.js +15 -4
- package/dist/render/text.js.map +1 -1
- package/dist/resolve-genre.d.ts +1 -1
- package/dist/resolve-genre.d.ts.map +1 -1
- package/dist/resolve-genre.js +4 -1
- package/dist/resolve-genre.js.map +1 -1
- package/dist/rule-genres.d.ts +24 -0
- package/dist/rule-genres.d.ts.map +1 -0
- package/dist/rule-genres.js +11 -0
- package/dist/rule-genres.js.map +1 -0
- package/dist/rule-guide.d.ts +54 -0
- package/dist/rule-guide.d.ts.map +1 -0
- package/dist/rule-guide.js +81 -0
- package/dist/rule-guide.js.map +1 -0
- package/dist/rule-load.d.ts.map +1 -1
- package/dist/rule-load.js +94 -32
- package/dist/rule-load.js.map +1 -1
- package/dist/rule-options.d.ts +50 -0
- package/dist/rule-options.d.ts.map +1 -0
- package/dist/rule-options.js +106 -0
- package/dist/rule-options.js.map +1 -0
- package/dist/run-semantic.d.ts +3 -1
- package/dist/run-semantic.d.ts.map +1 -1
- package/dist/run-semantic.js +8 -3
- package/dist/run-semantic.js.map +1 -1
- package/dist/run.d.ts +15 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +57 -10
- package/dist/run.js.map +1 -1
- package/dist/semantic.d.ts +1 -1
- package/dist/semantic.d.ts.map +1 -1
- package/dist/semantic.js +10 -3
- package/dist/semantic.js.map +1 -1
- package/dist/sentence-shape.d.ts.map +1 -1
- package/dist/sentence-shape.js +4 -4
- package/dist/sentence-shape.js.map +1 -1
- package/dist/setting-problems.d.ts +2 -1
- package/dist/setting-problems.d.ts.map +1 -1
- package/dist/setting-problems.js +6 -1
- package/dist/setting-problems.js.map +1 -1
- package/dist/span-cut.d.ts +6 -0
- package/dist/span-cut.d.ts.map +1 -0
- package/dist/span-cut.js +22 -0
- package/dist/span-cut.js.map +1 -0
- package/dist/span-merge.d.ts +4 -0
- package/dist/span-merge.d.ts.map +1 -0
- package/dist/span-merge.js +12 -0
- package/dist/span-merge.js.map +1 -0
- package/dist/speaker-labels.d.ts +4 -0
- package/dist/speaker-labels.d.ts.map +1 -0
- package/dist/speaker-labels.js +106 -0
- package/dist/speaker-labels.js.map +1 -0
- package/dist/stray-space.d.ts +17 -0
- package/dist/stray-space.d.ts.map +1 -0
- package/dist/stray-space.js +66 -0
- package/dist/stray-space.js.map +1 -0
- package/dist/structure/aside-depth.d.ts +21 -0
- package/dist/structure/aside-depth.d.ts.map +1 -0
- package/dist/structure/aside-depth.js +65 -0
- package/dist/structure/aside-depth.js.map +1 -0
- package/dist/structure/build.d.ts +5 -1
- package/dist/structure/build.d.ts.map +1 -1
- package/dist/structure/build.js +29 -17
- package/dist/structure/build.js.map +1 -1
- package/dist/structure/closed-pairs.d.ts +8 -0
- package/dist/structure/closed-pairs.d.ts.map +1 -0
- package/dist/structure/closed-pairs.js +22 -0
- package/dist/structure/closed-pairs.js.map +1 -0
- package/dist/structure/date-range.d.ts +21 -0
- package/dist/structure/date-range.d.ts.map +1 -0
- package/dist/structure/date-range.js +45 -0
- package/dist/structure/date-range.js.map +1 -0
- package/dist/structure/known-mentions.d.ts +18 -0
- package/dist/structure/known-mentions.d.ts.map +1 -0
- package/dist/structure/known-mentions.js +78 -0
- package/dist/structure/known-mentions.js.map +1 -0
- package/dist/structure/numbering.d.ts +1 -0
- package/dist/structure/numbering.d.ts.map +1 -1
- package/dist/structure/numbering.js +11 -6
- package/dist/structure/numbering.js.map +1 -1
- package/dist/structure/of.d.ts +3 -1
- package/dist/structure/of.d.ts.map +1 -1
- package/dist/structure/of.js +5 -1
- package/dist/structure/of.js.map +1 -1
- package/dist/structure/percent-sum.d.ts +16 -0
- package/dist/structure/percent-sum.d.ts.map +1 -0
- package/dist/structure/percent-sum.js +104 -0
- package/dist/structure/percent-sum.js.map +1 -0
- package/dist/structure/quoted-number.d.ts +8 -0
- package/dist/structure/quoted-number.d.ts.map +1 -0
- package/dist/structure/quoted-number.js +34 -0
- package/dist/structure/quoted-number.js.map +1 -0
- package/dist/structure/relative-find.d.ts.map +1 -1
- package/dist/structure/relative-find.js +34 -46
- package/dist/structure/relative-find.js.map +1 -1
- package/dist/structure/relative-resolve.d.ts.map +1 -1
- package/dist/structure/relative-resolve.js +94 -42
- package/dist/structure/relative-resolve.js.map +1 -1
- package/dist/structure/runs.d.ts +2 -0
- package/dist/structure/runs.d.ts.map +1 -1
- package/dist/structure/runs.js +2 -2
- package/dist/structure/runs.js.map +1 -1
- package/dist/structure/sexp.d.ts +1 -1
- package/dist/structure/sexp.d.ts.map +1 -1
- package/dist/structure/sexp.js +18 -6
- package/dist/structure/sexp.js.map +1 -1
- package/dist/structure/total.d.ts +3 -0
- package/dist/structure/total.d.ts.map +1 -1
- package/dist/structure/total.js +2 -2
- package/dist/structure/total.js.map +1 -1
- package/dist/structure/universal.d.ts +14 -2
- package/dist/structure/universal.d.ts.map +1 -1
- package/dist/structure/universal.js +17 -2
- package/dist/structure/universal.js.map +1 -1
- package/dist/structure/wrapped-tail.d.ts +14 -7
- package/dist/structure/wrapped-tail.d.ts.map +1 -1
- package/dist/structure/wrapped-tail.js +33 -8
- package/dist/structure/wrapped-tail.js.map +1 -1
- package/dist/style-load.d.ts +4 -0
- package/dist/style-load.d.ts.map +1 -0
- package/dist/style-load.js +28 -0
- package/dist/style-load.js.map +1 -0
- package/dist/style-parse.d.ts +19 -0
- package/dist/style-parse.d.ts.map +1 -0
- package/dist/style-parse.js +60 -0
- package/dist/style-parse.js.map +1 -0
- package/dist/subheading-line.d.ts +6 -0
- package/dist/subheading-line.d.ts.map +1 -0
- package/dist/subheading-line.js +57 -0
- package/dist/subheading-line.js.map +1 -0
- package/dist/team-names.d.ts.map +1 -1
- package/dist/team-names.js +11 -14
- package/dist/team-names.js.map +1 -1
- package/dist/template-syntax.d.ts +17 -0
- package/dist/template-syntax.d.ts.map +1 -0
- package/dist/template-syntax.js +140 -0
- package/dist/template-syntax.js.map +1 -0
- package/dist/text-above.d.ts +19 -0
- package/dist/text-above.d.ts.map +1 -0
- package/dist/text-above.js +43 -0
- package/dist/text-above.js.map +1 -0
- package/dist/text-figures.d.ts +10 -0
- package/dist/text-figures.d.ts.map +1 -0
- package/dist/text-figures.js +131 -0
- package/dist/text-figures.js.map +1 -0
- package/dist/trailing-aside.d.ts +2 -0
- package/dist/trailing-aside.d.ts.map +1 -0
- package/dist/trailing-aside.js +53 -0
- package/dist/trailing-aside.js.map +1 -0
- package/dist/tree-walk.d.ts +18 -0
- package/dist/tree-walk.d.ts.map +1 -0
- package/dist/tree-walk.js +45 -0
- package/dist/tree-walk.js.map +1 -0
- package/genres.yaml +60 -2
- package/package.json +5 -3
- package/reference-headings.yaml +17 -0
- package/rules/adverb-overuse.yaml +19 -0
- package/rules/agentless-passive.yaml +19 -0
- package/rules/agreement-slip.yaml +49 -0
- package/rules/ai-generated-composite.yaml +102 -0
- package/rules/ai-tell.yaml +23 -0
- package/rules/announced-count-mismatch.yaml +57 -0
- package/rules/announcing-opener.yaml +51 -0
- package/rules/assistant-residue.yaml +52 -0
- package/rules/bold-density.yaml +31 -0
- package/rules/broken-link.yaml +65 -0
- package/rules/closing-cliche.yaml +33 -0
- package/rules/colon-lead-in.yaml +59 -0
- package/rules/concrete-evidence-density.yaml +41 -0
- package/rules/contraction-consistency.yaml +18 -0
- package/rules/contrast-framing.yaml +57 -0
- package/rules/cushion-phrase-density.yaml +25 -0
- package/rules/dangling-figure-reference.yaml +61 -0
- package/rules/dangling-reference.yaml +53 -1
- package/rules/date-order.yaml +33 -1
- package/rules/date-range-reversed.yaml +46 -0
- package/rules/date-weekday-mismatch.yaml +17 -1
- package/rules/double-keigo.yaml +16 -0
- package/rules/doubled-punctuation.yaml +45 -0
- package/rules/doubled-word.yaml +17 -1
- package/rules/duplicate-definition.yaml +59 -1
- package/rules/emoji-density.yaml +25 -0
- package/rules/empty-conclusion.yaml +29 -0
- package/rules/empty-intensifier.yaml +19 -0
- package/rules/excessive-hedging.yaml +19 -0
- package/rules/expletive-construction.yaml +19 -0
- package/rules/heading-echo.yaml +32 -0
- package/rules/heading-level-skip.yaml +78 -0
- package/rules/hiragana-fukushi.yaml +16 -0
- package/rules/image-alt-text.yaml +54 -0
- package/rules/internal-jargon.yaml +21 -0
- package/rules/katakana-long-vowel.yaml +98 -0
- package/rules/kutoten-consistency.yaml +53 -0
- package/rules/latin-spacing.yaml +23 -4
- package/rules/max-kanji-continuous.yaml +16 -0
- package/rules/max-paragraph-length.yaml +42 -2
- package/rules/max-sentence-length.yaml +36 -0
- package/rules/ngram-repetition.yaml +29 -2
- package/rules/no-doubled-joshi.yaml +16 -0
- package/rules/no-em-dash.yaml +25 -0
- package/rules/no-mixed-desumasu.yaml +27 -2
- package/rules/no-nakaguro-parallel.yaml +20 -0
- package/rules/numbering-gap.yaml +53 -1
- package/rules/oxford-comma-consistency.yaml +19 -1
- package/rules/padded-intro.yaml +19 -0
- package/rules/paragraph-length-variance.yaml +49 -0
- package/rules/percent-sum-mismatch.yaml +58 -0
- package/rules/preamble-length.yaml +56 -0
- package/rules/preferred-term.yaml +27 -0
- package/rules/proper-noun-density.yaml +26 -0
- package/rules/repeated-conjunction.yaml +47 -0
- package/rules/repeated-sentence-head.yaml +23 -0
- package/rules/required-sections.yaml +49 -0
- package/rules/risk-disclosure.yaml +22 -0
- package/rules/rule-of-three.yaml +97 -0
- package/rules/sasete-itadaku.yaml +18 -0
- package/rules/section-length-uniformity.yaml +89 -0
- package/rules/sentence-initial-conjunction-run.yaml +18 -0
- package/rules/sentence-rhythm.yaml +25 -0
- package/rules/stock-transition.yaml +55 -0
- package/rules/stray-space.yaml +56 -0
- package/rules/taigen-dome-in-prose.yaml +19 -0
- package/rules/title-case-consistency.yaml +42 -0
- package/rules/total-mismatch.yaml +37 -1
- package/rules/unbalanced-bracket.yaml +56 -0
- package/rules/undefined-acronym.yaml +23 -0
- package/rules/unfilled-placeholder.yaml +50 -0
- package/rules/unqualified-superlative.yaml +19 -0
- package/rules/unsourced-number.yaml +16 -0
- package/rules/url-run-on.yaml +45 -0
- package/skills/chaff/SKILL.md +70 -0
- package/src/announced-count.ts +148 -0
- package/src/bare-url.ts +35 -0
- package/src/baseline.ts +17 -1
- package/src/body-section.ts +7 -0
- package/src/calendar-number.ts +33 -10
- package/src/cli-args.ts +6 -0
- package/src/cli-text.ts +8 -4
- package/src/cli.ts +37 -37
- package/src/closing-numbers.ts +72 -0
- package/src/commands/compare.ts +80 -0
- package/src/commands/eval.ts +19 -8
- package/src/commands/feedback.ts +12 -6
- package/src/commands/test.ts +20 -17
- package/src/commands/tree.ts +41 -5
- package/src/compare/atom.ts +33 -0
- package/src/compare/clock-time.ts +86 -0
- package/src/compare/extract.ts +78 -0
- package/src/compare/fact-text.ts +68 -0
- package/src/compare/markup-atoms.ts +29 -0
- package/src/compare/match.ts +105 -0
- package/src/compare/outcome.ts +70 -0
- package/src/compare/proper-nouns.ts +65 -0
- package/src/compare/render.ts +102 -0
- package/src/compare/spans.ts +17 -0
- package/src/compare/text-atoms.ts +95 -0
- package/src/compare/text.ts +120 -0
- package/src/compare/tree-atoms.ts +80 -0
- package/src/compare/written-names.ts +26 -0
- package/src/config/load.ts +21 -0
- package/src/config/option-problems.ts +70 -0
- package/src/config/read.ts +8 -0
- package/src/config/rule-problems.ts +12 -2
- package/src/config/style.ts +42 -0
- package/src/config/warnings.ts +13 -0
- package/src/config/write.ts +18 -4
- package/src/custom/bounded-match.ts +58 -0
- package/src/custom/load.ts +15 -0
- package/src/custom/parse.ts +274 -0
- package/src/custom/problems.ts +89 -0
- package/src/custom/regex-safety.ts +118 -0
- package/src/custom/token-pattern.ts +84 -0
- package/src/detect.ts +28 -2
- package/src/detectors/acronym-context.ts +32 -4
- package/src/detectors/acronym-expansion.ts +132 -1
- package/src/detectors/agreement-slip.ts +191 -0
- package/src/detectors/ai-phrasing.ts +137 -0
- package/src/detectors/announced-count.ts +25 -0
- package/src/detectors/broken-link.ts +90 -0
- package/src/detectors/cited-name.ts +6 -5
- package/src/detectors/cited-title.ts +96 -0
- package/src/detectors/concrete-evidence.ts +3 -2
- package/src/detectors/content-morphemes.ts +19 -0
- package/src/detectors/contrast-frame.ts +54 -0
- package/src/detectors/custom.ts +89 -0
- package/src/detectors/dangling-figure.ts +22 -0
- package/src/detectors/doubled-punctuation.ts +49 -0
- package/src/detectors/doubled-word.ts +19 -4
- package/src/detectors/en-shape.ts +0 -269
- package/src/detectors/enumerated-runs.ts +13 -4
- package/src/detectors/gram-furniture.ts +30 -0
- package/src/detectors/gram-place.ts +9 -5
- package/src/detectors/gram-windows.ts +31 -0
- package/src/detectors/heading-case.ts +30 -2
- package/src/detectors/heading-code-words.ts +35 -0
- package/src/detectors/heading-echo.ts +18 -22
- package/src/detectors/heading-level-skip.ts +19 -0
- package/src/detectors/heading-overlap.ts +65 -0
- package/src/detectors/image-alt-text.ts +11 -0
- package/src/detectors/index.ts +49 -2
- package/src/detectors/kutoten-consistency.ts +96 -0
- package/src/detectors/lead-in.ts +3 -1
- package/src/detectors/letter-joined-name.ts +15 -0
- package/src/detectors/lexicon-match.ts +9 -2
- package/src/detectors/lexicon.ts +6 -2
- package/src/detectors/list-item.ts +122 -0
- package/src/detectors/list-items.ts +163 -0
- package/src/detectors/list-lead-in.ts +33 -0
- package/src/detectors/list-sentence.ts +157 -0
- package/src/detectors/list-view.ts +157 -0
- package/src/detectors/long-vowel.ts +66 -0
- package/src/detectors/markup-finding.ts +24 -0
- package/src/detectors/name-numeral.ts +4 -2
- package/src/detectors/orthography.ts +24 -18
- package/src/detectors/oxford-comma.ts +297 -0
- package/src/detectors/place-run.ts +7 -4
- package/src/detectors/placeholder-text.ts +27 -0
- package/src/detectors/quote-around.ts +9 -0
- package/src/detectors/register.ts +37 -10
- package/src/detectors/roman-numeral.ts +3 -0
- package/src/detectors/sentence-ending.ts +14 -7
- package/src/detectors/sentence-length.ts +16 -5
- package/src/detectors/signals.ts +110 -53
- package/src/detectors/stacked-hedge.ts +6 -3
- package/src/detectors/stray-space.ts +40 -0
- package/src/detectors/structure-tree.ts +45 -1
- package/src/detectors/structure.ts +13 -6
- package/src/detectors/superlative-name.ts +7 -4
- package/src/detectors/superlative-scope.ts +8 -3
- package/src/detectors/token-column.ts +149 -0
- package/src/detectors/unbalanced-bracket.ts +153 -0
- package/src/detectors/url-run-on.ts +27 -0
- package/src/document-sections.ts +46 -0
- package/src/document.ts +116 -127
- package/src/email-parts.ts +269 -0
- package/src/eval.ts +14 -4
- package/src/figure-references.ts +112 -0
- package/src/files.ts +5 -0
- package/src/genre-parse.ts +30 -5
- package/src/genre-suggest.ts +15 -2
- package/src/heading-label.ts +55 -0
- package/src/in-page-nav.ts +48 -19
- package/src/joined-view.ts +1 -0
- package/src/levels.ts +14 -1
- package/src/line-paragraphs.ts +56 -10
- package/src/long-vowel.ts +99 -0
- package/src/markdown-node.ts +19 -0
- package/src/markdown-read.ts +44 -0
- package/src/markup.ts +210 -0
- package/src/mask.ts +10 -19
- package/src/number-name.ts +152 -25
- package/src/opening-line.ts +17 -0
- package/src/orthography.ts +20 -5
- package/src/page-furniture.ts +11 -2
- package/src/paragraph-length.ts +9 -0
- package/src/plain-source.ts +2 -1
- package/src/plugin.ts +107 -1
- package/src/profile/for-file.ts +3 -1
- package/src/quoted-span.ts +10 -4
- package/src/reasons.ts +9 -0
- package/src/reference-lists.ts +91 -0
- package/src/render/explain.ts +47 -13
- package/src/render/friendly.ts +20 -9
- package/src/render/options.ts +58 -0
- package/src/render/rules-json.ts +130 -14
- package/src/render/rules-table.ts +91 -0
- package/src/render/sarif.ts +4 -4
- package/src/render/semantic.ts +3 -3
- package/src/render/severity-name.ts +10 -0
- package/src/render/text.ts +21 -7
- package/src/resolve-genre.ts +4 -1
- package/src/rule-genres.ts +25 -0
- package/src/rule-guide.ts +135 -0
- package/src/rule-load.ts +98 -33
- package/src/rule-options.ts +131 -0
- package/src/run-semantic.ts +28 -20
- package/src/run.ts +78 -11
- package/src/semantic.ts +11 -3
- package/src/sentence-shape.ts +4 -5
- package/src/setting-problems.ts +7 -1
- package/src/span-cut.ts +28 -0
- package/src/span-merge.ts +13 -0
- package/src/speaker-labels.ts +129 -0
- package/src/stray-space.ts +81 -0
- package/src/structure/aside-depth.ts +67 -0
- package/src/structure/build.ts +38 -19
- package/src/structure/closed-pairs.ts +20 -0
- package/src/structure/date-range.ts +69 -0
- package/src/structure/known-mentions.ts +96 -0
- package/src/structure/numbering.ts +9 -5
- package/src/structure/of.ts +11 -3
- package/src/structure/percent-sum.ts +135 -0
- package/src/structure/quoted-number.ts +36 -0
- package/src/structure/relative-find.ts +34 -47
- package/src/structure/relative-resolve.ts +104 -42
- package/src/structure/runs.ts +2 -2
- package/src/structure/sexp.ts +17 -5
- package/src/structure/total.ts +2 -2
- package/src/structure/universal.ts +24 -4
- package/src/structure/wrapped-tail.ts +38 -13
- package/src/style-load.ts +28 -0
- package/src/style-parse.ts +77 -0
- package/src/subheading-line.ts +68 -0
- package/src/team-names.ts +13 -13
- package/src/template-syntax.ts +164 -0
- package/src/text-above.ts +49 -0
- package/src/text-figures.ts +147 -0
- package/src/trailing-aside.ts +50 -0
- package/src/tree-walk.ts +48 -0
- package/styles/bunkacho.yaml +25 -0
- package/styles/ieice.yaml +29 -0
- package/styles/jis-z8301-2011.yaml +25 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
id: unbalanced-bracket
|
|
2
|
+
layer: L1
|
|
3
|
+
status: experimental
|
|
4
|
+
how_to_find: unbalanced-bracket
|
|
5
|
+
severity: warning
|
|
6
|
+
|
|
7
|
+
name:
|
|
8
|
+
ja: 括弧が組になっていない
|
|
9
|
+
en: Unbalanced bracket
|
|
10
|
+
|
|
11
|
+
why:
|
|
12
|
+
ja: 閉じ忘れた「(」や、開きの無い「」」があると、読み手はどこまでが括弧の中なのか分からなくなります。全角の「(」を半角の「)」で閉じるのも、書き換えの途中で残った印です。見出しで区切った節ごとに、「」『』()()[][]【】〔〕〈〉《》“” の組を数えます。詩の連や長い引用は段落をまたぐので、段落を越えて組にします。行の頭や空白の後ろの「1)」「a)」「事例)」のような三文字までの番号の印と数の後ろの「)」、コードと URL は数えません。英語の小説のように、次の段落も同じ開きで始まるなら、閉じない開きは続きとして数えません。
|
|
13
|
+
en: A "(" never closed, or a ")" never opened, leaves the reader unsure where the aside ends. A full-width "(" closed by a half-width ")" is left over from an edit too. Brackets are paired within each section under a heading ((), [], “”, and the Japanese 「」『』()[]【】〔〕〈〉《》), across paragraphs, since a stanza or a long quotation may span several. A short label of up to three characters such as "1)", "a)" or "iv)" at the start of a line or after a space, a ")" right after a number, code and URLs are not counted. An opening quotation mark carried into a paragraph that opens with the same mark, as in fiction, is not counted.
|
|
14
|
+
|
|
15
|
+
message:
|
|
16
|
+
ja: 「{mark}」が組になっていません
|
|
17
|
+
en: '"{mark}" has no partner'
|
|
18
|
+
|
|
19
|
+
messages:
|
|
20
|
+
unclosed:
|
|
21
|
+
ja: 「{mark}」が閉じていません
|
|
22
|
+
en: '"{mark}" is never closed'
|
|
23
|
+
unopened:
|
|
24
|
+
ja: 「{mark}」に対応する開きがありません
|
|
25
|
+
en: '"{mark}" closes nothing that was opened'
|
|
26
|
+
mismatch:
|
|
27
|
+
ja: 「{partner}」を「{mark}」で閉じています(全角と半角が違います)
|
|
28
|
+
en: '"{partner}" is closed by "{mark}" (full-width and half-width differ)'
|
|
29
|
+
|
|
30
|
+
how_to_fix:
|
|
31
|
+
ja: 足りない括弧を足すか、余分な括弧を消してください。全角と半角は、開きと閉じをそろえてください。
|
|
32
|
+
en: Add the missing bracket or remove the extra one. Make the opening and closing marks the same width.
|
|
33
|
+
|
|
34
|
+
levels: { strict: error, normal: warning, relaxed: info }
|
|
35
|
+
|
|
36
|
+
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
37
|
+
|
|
38
|
+
group: slips
|
|
39
|
+
summary:
|
|
40
|
+
ja: 閉じ忘れた「(」や開きの無い「」」のように、組になっていない括弧と引用符
|
|
41
|
+
en: A bracket or quotation mark with no partner, such as a "(" that is never closed
|
|
42
|
+
example:
|
|
43
|
+
ja:
|
|
44
|
+
before: |
|
|
45
|
+
資料(別紙を参照してください。
|
|
46
|
+
after: |
|
|
47
|
+
資料(別紙)を参照してください。
|
|
48
|
+
en:
|
|
49
|
+
before: |
|
|
50
|
+
The plan (see below is ready.
|
|
51
|
+
after: |
|
|
52
|
+
The plan (see below) is ready.
|
|
53
|
+
|
|
54
|
+
not_flagged:
|
|
55
|
+
ja: 行の頭や空白の後ろの「1)」「a)」「事例)」のような三文字までの番号の印、数の後ろの「)」、コードと URL は数えません。段落をまたいで閉じる括弧と、次の段落を同じ引用符で始める台詞も指しません。
|
|
56
|
+
en: Labels of up to three characters such as "1)" or "a)" at the start of a line or after a space, a ")" right after a number, code and URLs are not counted. A bracket closed in a later paragraph, and a quotation carried into a paragraph that opens with the same mark, are not reported.
|
|
@@ -13,7 +13,9 @@ extra_word_lists:
|
|
|
13
13
|
us-state-code,
|
|
14
14
|
emphasis-word,
|
|
15
15
|
numbered-division,
|
|
16
|
+
abbreviated-label,
|
|
16
17
|
honorific,
|
|
18
|
+
name-title,
|
|
17
19
|
date-time-unit,
|
|
18
20
|
http-method,
|
|
19
21
|
]
|
|
@@ -39,3 +41,24 @@ how_to_fix:
|
|
|
39
41
|
levels: { strict: 1, normal: 3, relaxed: 6 }
|
|
40
42
|
|
|
41
43
|
use_for: [business, technical, legal, docs, academic, literature, speech]
|
|
44
|
+
|
|
45
|
+
group: readability
|
|
46
|
+
summary:
|
|
47
|
+
ja: 「KGI」「PMF」のように、説明なしで出てくる略語
|
|
48
|
+
en: An acronym such as "KGI" or "PMF" used without ever being spelled out
|
|
49
|
+
example:
|
|
50
|
+
ja:
|
|
51
|
+
config: { rules: { undefined-acronym: strict } }
|
|
52
|
+
before: 今期の KGI は、PMF の達成です。
|
|
53
|
+
after: 今期の最終目標(KGI, Key Goal Indicator)は、製品が市場に受け入れられること(PMF, Product Market Fit)です。
|
|
54
|
+
en:
|
|
55
|
+
config: { rules: { undefined-acronym: strict } }
|
|
56
|
+
before: Our KGI this term is to reach PMF.
|
|
57
|
+
after: Our key goal indicator (KGI) this term is to reach product-market fit (PMF).
|
|
58
|
+
|
|
59
|
+
not_flagged:
|
|
60
|
+
ja: 誰でも知っている略語(URL、PDF など)と、前後の括弧で説明した略語は指しません。
|
|
61
|
+
en: Common acronyms (URL, PDF) and acronyms spelled out in brackets next to them are not reported.
|
|
62
|
+
level_meaning:
|
|
63
|
+
ja: 説明のない略語が {limit} 種類あれば指摘
|
|
64
|
+
en: reported once {limit} different acronyms go unexplained
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
id: unfilled-placeholder
|
|
2
|
+
layer: L2
|
|
3
|
+
status: experimental
|
|
4
|
+
how_to_find: unfilled-placeholder
|
|
5
|
+
word_list: placeholder-word
|
|
6
|
+
severity: warning
|
|
7
|
+
|
|
8
|
+
name:
|
|
9
|
+
ja: 埋め忘れた空欄
|
|
10
|
+
en: Unfilled placeholder
|
|
11
|
+
|
|
12
|
+
why:
|
|
13
|
+
ja: 「【会社名】」「[Your Name]」は、雛形や生成した下書きに残る空欄です。文体の好みではなく、埋め忘れです。例として置いた「○○」は正しい書き方なので数えません。
|
|
14
|
+
en: '"[Your Name]" and "[Insert Date]" are the blanks a template or a generated draft leaves. This is not a matter of style: the blank was never filled.'
|
|
15
|
+
|
|
16
|
+
message:
|
|
17
|
+
ja: 「{matched}」が埋まっていません
|
|
18
|
+
en: '"{matched}" was never filled in'
|
|
19
|
+
|
|
20
|
+
how_to_fix:
|
|
21
|
+
ja: 中身を書いてください。例のつもりなら、例だと分かる書き方(例:山田太郎)にしてください。
|
|
22
|
+
en: Fill it in. If it is meant as an example, say so ("for example, Jane Smith").
|
|
23
|
+
|
|
24
|
+
# 指摘に要る空欄の数。
|
|
25
|
+
levels: { strict: 1, normal: 1, relaxed: 2 }
|
|
26
|
+
|
|
27
|
+
use_for: [blog, business, technical, legal, docs, academic, literature, speech]
|
|
28
|
+
|
|
29
|
+
group: slips
|
|
30
|
+
summary:
|
|
31
|
+
ja: 「【会社名】」「[Your Name]」のように、雛形の空欄が埋まらないまま残っている所
|
|
32
|
+
en: A template blank left unfilled, such as "[Your Name]" or "[Insert Date]"
|
|
33
|
+
example:
|
|
34
|
+
ja:
|
|
35
|
+
before: |
|
|
36
|
+
【会社名】の田中です。見積もりをお送りします。
|
|
37
|
+
after: |
|
|
38
|
+
山田商事の田中です。見積もりをお送りします。
|
|
39
|
+
en:
|
|
40
|
+
before: |
|
|
41
|
+
We can meet on [Insert Date] to go through the quote.
|
|
42
|
+
after: |
|
|
43
|
+
We can meet on Friday 9 October to go through the quote.
|
|
44
|
+
|
|
45
|
+
not_flagged:
|
|
46
|
+
ja: 例として置いた「○○」、Markdown のリンク、脚注の番号、チェック欄、値が続く見出しの札(【氏名】山田)は指しません。
|
|
47
|
+
en: 'Markdown links and reference definitions, footnote numbers, checkboxes, and a label its value follows ("[Date]: 2024-04-01") are not reported.'
|
|
48
|
+
level_meaning:
|
|
49
|
+
ja: 空欄が {limit} 箇所あれば指摘
|
|
50
|
+
en: reported once there are {limit}
|
|
@@ -26,3 +26,22 @@ how_to_fix:
|
|
|
26
26
|
levels: { strict: 1, normal: 2, relaxed: 4 }
|
|
27
27
|
|
|
28
28
|
use_for: [business, blog, legal, docs, academic, literature, speech]
|
|
29
|
+
|
|
30
|
+
group: wording
|
|
31
|
+
summary:
|
|
32
|
+
ja: 「業界最速」「最高の品質」のように、何と比べたのかを書いていない最上級
|
|
33
|
+
en: A superlative such as "the fastest" with nothing to compare it against
|
|
34
|
+
example:
|
|
35
|
+
ja:
|
|
36
|
+
before: 当社の新製品は業界最速で、最高の品質です。圧倒的な使いやすさです。
|
|
37
|
+
after: 当社の新製品は、従来品より処理が二割速くなりました。
|
|
38
|
+
en:
|
|
39
|
+
before: Our new product is the fastest on the market, with unmatched quality and unparalleled ease of use.
|
|
40
|
+
after: Our new product processes orders a fifth faster than the previous model.
|
|
41
|
+
|
|
42
|
+
not_flagged:
|
|
43
|
+
ja: 「当社比」「〜の中で」のように、比べる相手や範囲が同じ文にあれば指しません。
|
|
44
|
+
en: A superlative with its comparison or scope in the same sentence ("in our range", "than last year") is not reported.
|
|
45
|
+
level_meaning:
|
|
46
|
+
ja: 比べる相手のない最上級が {limit} 箇所あれば指摘
|
|
47
|
+
en: reported once there are {limit} such claims
|
|
@@ -38,3 +38,19 @@ levels:
|
|
|
38
38
|
relaxed: info
|
|
39
39
|
|
|
40
40
|
use_for: [business]
|
|
41
|
+
|
|
42
|
+
group: facts
|
|
43
|
+
summary:
|
|
44
|
+
ja: どこから来たのか確かめようのない数字(AI に読ませる検査)
|
|
45
|
+
en: A number the reader has no way to check (checked by an AI)
|
|
46
|
+
example:
|
|
47
|
+
ja:
|
|
48
|
+
before: 利用者の 9 割が、この機能に満足しています。
|
|
49
|
+
after: 9 月に利用者 120 人へ聞いたアンケートでは、108 人(9 割)がこの機能に満足と答えました。
|
|
50
|
+
en:
|
|
51
|
+
before: Nine in ten users are happy with this feature.
|
|
52
|
+
after: In a survey of 120 users in September, 108 (nine in ten) said they were happy with this feature.
|
|
53
|
+
|
|
54
|
+
not_flagged:
|
|
55
|
+
ja: 機械では決めません。chaff test で、機械が数字を含む文を絞り込み、その文だけを AI が読みます。
|
|
56
|
+
en: No machine decides this. chaff test narrows the text to sentences with numbers, and an AI reads only those.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
id: url-run-on
|
|
2
|
+
layer: L1
|
|
3
|
+
status: experimental
|
|
4
|
+
how_to_find: url-run-on
|
|
5
|
+
severity: warning
|
|
6
|
+
|
|
7
|
+
name:
|
|
8
|
+
ja: URL のすぐ後ろに字が続いている
|
|
9
|
+
en: Text runs on after a URL
|
|
10
|
+
|
|
11
|
+
why:
|
|
12
|
+
ja: 「https://example.jp/をご覧ください」のように、そのまま書いた URL の直後に空白を置かずに日本語や全角の記号(。」)など)が続くと、GitHub などの自動リンクや多くのメールソフトは空白が来るまでを URL と読みます。押すと存在しないページが開きます。ASCII でない字が続くときだけを指摘します。リンクの記法([資料](https://…) と <https://…>)で書いたものと、コードの中は数えません。
|
|
13
|
+
en: When a URL written as plain text is followed straight away by a character outside ASCII ("https://example.com/—see", "https://example.jp/をご覧ください"), GitHub's automatic links and many mail clients read everything up to the next space as the URL, and clicking it opens a page that does not exist. Only a character outside ASCII right after the URL is reported. A URL written with link syntax ([docs](https://…) or <https://…>) and URLs in code are not counted.
|
|
14
|
+
|
|
15
|
+
message:
|
|
16
|
+
ja: URL「{url}」の直後に「{next}」が続いています。リンクがそこまで伸びます
|
|
17
|
+
en: 'The URL "{url}" is followed by "{next}" with no space; the link runs on into it'
|
|
18
|
+
|
|
19
|
+
how_to_fix:
|
|
20
|
+
ja: URL の後ろに空白を入れるか、<https://…> または [説明](https://…) の形で書いてください。
|
|
21
|
+
en: Put a space after the URL, or write it as <https://…> or [text](https://…).
|
|
22
|
+
|
|
23
|
+
levels: { strict: error, normal: warning, relaxed: info }
|
|
24
|
+
|
|
25
|
+
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
26
|
+
|
|
27
|
+
group: slips
|
|
28
|
+
summary:
|
|
29
|
+
ja: 「https://example.jp/をご覧ください」のように、URL のすぐ後ろに字が続き、リンクがそこまで伸びる所
|
|
30
|
+
en: A URL followed straight away by a character outside ASCII, which the link swallows
|
|
31
|
+
example:
|
|
32
|
+
ja:
|
|
33
|
+
before: |
|
|
34
|
+
詳しくは https://example.jp/guideをご覧ください。
|
|
35
|
+
after: |
|
|
36
|
+
詳しくは https://example.jp/guide をご覧ください。
|
|
37
|
+
en:
|
|
38
|
+
before: |
|
|
39
|
+
See https://example.com/guide—it has the details.
|
|
40
|
+
after: |
|
|
41
|
+
See https://example.com/guide — it has the details.
|
|
42
|
+
|
|
43
|
+
not_flagged:
|
|
44
|
+
ja: リンクの記法([説明](URL) と <URL>)で書いた URL、コードの中、空白や ASCII の記号が続く URL、ゼロ幅の空白のような見えない字は指しません。
|
|
45
|
+
en: URLs written with link syntax ([text](URL) or <URL>), URLs in code, a URL followed by a space or an ASCII mark, and invisible characters such as a zero-width space are not reported.
|
package/skills/chaff/SKILL.md
CHANGED
|
@@ -61,6 +61,7 @@ relaxing a rule.
|
|
|
61
61
|
existing one is left as it is), and adds `.chaff-cache/` and `.env*` to `.gitignore`.
|
|
62
62
|
- `npx chaffjs rules --json [--genre <genre>]` prints every rule with its levels, the setting in effect (`now`,
|
|
63
63
|
the genre's preset included) and why a rule is off. Read it instead of guessing rule names or limits.
|
|
64
|
+
`npx chaffjs rules` shows the same as a table, grouped, with the level each rule runs at now.
|
|
64
65
|
- A level is `strict` / `normal` / `relaxed` / `off`; when even `relaxed` is too tight, a positive number is the
|
|
65
66
|
limit itself (`max-sentence-length: 260`).
|
|
66
67
|
- `prefer:` maps spellings to the team's (`e-mail: email`); `preferred-term: normal` turns the rule on.
|
|
@@ -68,6 +69,75 @@ relaxing a rule.
|
|
|
68
69
|
- `genre:` sets the kind of document; `by_path` sets one per folder; `--genre` overrides both for one run.
|
|
69
70
|
`rules:` wins over the genre's preset.
|
|
70
71
|
|
|
72
|
+
## Turn a team's style note into chaff.yaml
|
|
73
|
+
|
|
74
|
+
When the person gives house rules ("polite endings, sentences of at most 80 characters"), do not guess rule
|
|
75
|
+
names or numbers:
|
|
76
|
+
|
|
77
|
+
1. Read `npx chaffjs rules --json`. Each rule has `summary` (what it finds), `level_meaning` (what a level's
|
|
78
|
+
number means), `levels`, `example`, `not_flagged`, and `genres` (whether it runs in each genre).
|
|
79
|
+
2. Split the note into single requirements; map each to the rule whose `summary` and `level_meaning` fit. A
|
|
80
|
+
number between levels is written as the number itself (`max-sentence-length: 80`). Spellings go under
|
|
81
|
+
`prefer`, in-house words under `jargon`, required headings under `required_sections`.
|
|
82
|
+
3. Say plainly what no rule covers. For example, `no-mixed-desumasu` flags a register mixed into a document, but
|
|
83
|
+
does not require a particular one; a document wholly in the other register is not reported.
|
|
84
|
+
4. Write only what differs from the default, then check before committing: `npx chaffjs explain <rule-id>`, a
|
|
85
|
+
short sample that breaks each requirement (each must be reported), and `npx chaffjs rules` (the table shows the
|
|
86
|
+
level each rule now runs at).
|
|
87
|
+
|
|
88
|
+
## Adding a team rule
|
|
89
|
+
|
|
90
|
+
Pick the easiest way that can say the requirement:
|
|
91
|
+
|
|
92
|
+
| Requirement | Use |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| An existing rule covers it | A level, a number, `prefer`, `jargon` or `required_sections` in `chaff.yaml` |
|
|
95
|
+
| A fixed phrase or pattern, with the team's own message | `custom_rules` of type `words` or `pattern` (coming in the next release) |
|
|
96
|
+
| Decided by part of speech or inflection | `custom_rules` of type `tokens` (coming in the next release) |
|
|
97
|
+
| Counting or comparing that the above cannot express | a Node function, `type: module` (a later release) |
|
|
98
|
+
|
|
99
|
+
Test a new team rule the same way: `explain`, then a sample it must report and a sample it must not, before
|
|
100
|
+
committing `chaff.yaml`. The guide page "Adding a rule" covers each way and how to add a rule to chaff itself.
|
|
101
|
+
|
|
102
|
+
## Making AI-sounding text sound human
|
|
103
|
+
|
|
104
|
+
chaff marks the shapes common in generated text (group "Signs of generated text" in `npx chaffjs rules`: `ai-tell`,
|
|
105
|
+
`contrast-framing`, `stock-transition`, `announcing-opener`, `colon-lead-in` (Japanese only), `assistant-residue`, and the signals
|
|
106
|
+
`ai-generated-composite` reads). Most are experimental: run with `--experimental`. None of them says the text was
|
|
107
|
+
generated. When asked to make a text sound less generated, pick one of two modes and say which.
|
|
108
|
+
|
|
109
|
+
**Light** (only the flagged spots), when the content and structure are fine:
|
|
110
|
+
|
|
111
|
+
1. `npx chaffjs <file> --experimental` (or with the genre's `--genre`); collect the AI-shape findings.
|
|
112
|
+
2. Rewrite only those spots. Keep the meaning, numbers, conditions and technical constraints.
|
|
113
|
+
3. Run chaff again. At most two rewrite passes.
|
|
114
|
+
4. Show the rewritten text and a short list of what changed and why.
|
|
115
|
+
|
|
116
|
+
**Bold** (section by section), when a light pass still leaves it reading as generated:
|
|
117
|
+
|
|
118
|
+
1. Run chaff with `--experimental` and note the document-level signals: the `ai-generated-composite` inputs,
|
|
119
|
+
`bold-density`, `contrast-framing`, `stock-transition`, `sentence-rhythm`.
|
|
120
|
+
2. Rewrite each section toward a human voice: less bold; one-line paragraphs and punchlines folded back into
|
|
121
|
+
paragraphs; no "X ではありません。Y です" / "It's not X. It's Y" frames; lists turned back into sentences where the
|
|
122
|
+
items connect; fewer em dashes; no announcing openers. Each paragraph carries one claim, joined to the last by a
|
|
123
|
+
connective, built around the writer's own experience or numbers where the original has them.
|
|
124
|
+
3. Run chaff again and report the same signals before and after, from chaff's output.
|
|
125
|
+
4. Run `npx chaffjs compare <old> <new>` (exit 1 on a dropped or added fact; `--json` to act on it). Restore every
|
|
126
|
+
dropped fact; for one that is not a fact (a number inside a metaphor, the heading of a section you cut), say why it
|
|
127
|
+
stays out. `--allow-dropped <kind>` excludes a kind you cut on purpose. Never leave an added fact.
|
|
128
|
+
|
|
129
|
+
In both modes:
|
|
130
|
+
|
|
131
|
+
- Never add facts, people, numbers or causes the original does not have.
|
|
132
|
+
- Keep a domain term a word rule trips when it is right in context.
|
|
133
|
+
- Prefer a direct statement over a negated contrast. Say who does what.
|
|
134
|
+
- Never loop just to silence a warning; two passes at most, and list what is left with the reason.
|
|
135
|
+
- Per genre: in a tech article, replace metaphors ("静かに壊れる", "silently fails") with what happens and keep steps
|
|
136
|
+
and commands as lists; in a business document, put the conclusion and who does what first and keep tables and
|
|
137
|
+
figures; in an essay, fold punchlines back in and replace big words ("真理", "new possibilities") with the scene.
|
|
138
|
+
|
|
139
|
+
The guide page "Making AI-sounding text sound human" has a worked example with chaff's output before and after.
|
|
140
|
+
|
|
71
141
|
## Structured documents
|
|
72
142
|
|
|
73
143
|
- `npx chaffjs tree <file>` shows a contract or specification as a tree of addresses (`3.2` for 第3条第2項 or
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { escapeRegExp } from "./orthography.ts";
|
|
2
|
+
import type { BulletList, Span } from "./plugin.ts";
|
|
3
|
+
import { joined, linesAbove, type TextBlock } from "./text-above.ts";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 箇条書きのすぐ前の文が予告した数(以下の3点、the following three steps)と、箇条書きのいちばん外側の項目の数。
|
|
7
|
+
* 予告と読むのは、文の最後の一文に数がちょうど一つあり、先を指す語がその前にあるか文がコロンで終わるときだけ。
|
|
8
|
+
* 言語の知識(先を指す語、漢数字や数の語、数える語、数を目安や順番にする語)は語彙表から受け取る。
|
|
9
|
+
*/
|
|
10
|
+
export type CountWords = {
|
|
11
|
+
/** 以下の、次の、following。 */
|
|
12
|
+
readonly anchors: readonly string[];
|
|
13
|
+
/** 数を字で書いたもの。一から順に並べる。 */
|
|
14
|
+
readonly numbers: readonly string[];
|
|
15
|
+
/** 数のすぐ後ろで並べるものを数える語。点、つ、steps。 */
|
|
16
|
+
readonly counters: readonly string[];
|
|
17
|
+
/** 数のすぐ前にあると予告でなくなる語(約、第、at least)。 */
|
|
18
|
+
readonly hedgesBefore: readonly string[];
|
|
19
|
+
/** 数か数える語のすぐ後ろにあると予告でなくなる語(以上、目、or more)。 */
|
|
20
|
+
readonly hedgesAfter: readonly string[];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type CountMismatch = { readonly offset: number; readonly phrase: string; readonly announced: number; readonly listed: number };
|
|
24
|
+
|
|
25
|
+
/** counted: 数える語が付いている(3点)。付いていない数(the following two:)は、先を指す語のすぐ後ろでだけ予告に読む。 */
|
|
26
|
+
type Phrase = { readonly start: number; readonly numberEnd: number; readonly end: number; readonly announced: number; readonly counted: boolean };
|
|
27
|
+
|
|
28
|
+
/** 予告の文の外側。見出し、表、引用、コードの囲みの行は、すぐ下の箇条書きを予告する文ではない。 */
|
|
29
|
+
const NOT_A_LEAD = /^[ \t]*(?:#|\||>|```|~~~)/u;
|
|
30
|
+
|
|
31
|
+
/** 箇条書きのすぐ前の塊。見出し・表・引用・コードの囲みなら undefined。 */
|
|
32
|
+
const leadBefore = (source: string, listStart: number): TextBlock | undefined => {
|
|
33
|
+
const lines = linesAbove(source, listStart);
|
|
34
|
+
return lines.some((line) => NOT_A_LEAD.test(line.text)) ? undefined : joined(source, lines);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** 文の終わり。英語の「.」は後ろが空白のときだけ(3.5 や e.g. の途中で切らない)。 */
|
|
38
|
+
const SENTENCE_END = /[。!?!?]|\.(?=\s)/gu;
|
|
39
|
+
|
|
40
|
+
/** 塊の最後の一文の始まり(塊の中の位置)。 */
|
|
41
|
+
const lastSentenceStart = (text: string): number => {
|
|
42
|
+
const body = text.trimEnd();
|
|
43
|
+
const ends = [...body.matchAll(SENTENCE_END)].map((match) => match.index + match[0].length).filter((end) => end < body.length);
|
|
44
|
+
return ends.at(-1) ?? 0;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const alternation = (words: readonly string[]): string =>
|
|
48
|
+
words
|
|
49
|
+
.toSorted((a, b) => b.length - a.length)
|
|
50
|
+
.map(escapeRegExp)
|
|
51
|
+
.join("|");
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 数と、それが数えるもの。数の前が数字・英字・数の字なら数の途中(十三、23、eleven の中)。
|
|
55
|
+
* 英語は数と数える語の間に語を二つまで置ける(three key steps)。数える語が無くても、文がコロンで終わる直前の数(the following two:)は数に読む。
|
|
56
|
+
*/
|
|
57
|
+
const phrasePattern = (words: CountWords): RegExp => {
|
|
58
|
+
const numberChars = escapeRegExp([...new Set(words.numbers.join(""))].join(""));
|
|
59
|
+
const numbers = words.numbers.length === 0 ? "\\p{Nd}+" : `\\p{Nd}+|${alternation(words.numbers)}`;
|
|
60
|
+
const counted = `[ \\t\\u00a0]?(?:\\p{Ll}[\\p{Ll}-]*[ \\t]){0,2}(${alternation(words.counters)})(?![A-Za-z])`;
|
|
61
|
+
return new RegExp(`(?<![\\p{N}A-Za-z${numberChars}])(${numbers})(?:${counted}|(?=[ \\t]?[::][ \\t]*$))`, "giu");
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const valueOf = (written: string, numbers: readonly string[]): number => {
|
|
65
|
+
const digits = Number(written.normalize("NFKC"));
|
|
66
|
+
if (!Number.isNaN(digits)) return digits;
|
|
67
|
+
return numbers.findIndex((number) => number.toLowerCase() === written.toLowerCase()) + 1;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const LATIN_LETTER = /[A-Za-z]/u;
|
|
71
|
+
const isLatin = (char: string | undefined): boolean => LATIN_LETTER.test(char ?? "");
|
|
72
|
+
|
|
73
|
+
/** 英語の語は語の切れ目で照らす(over が moreover に当たらない)。日本語の語は字面どおり。 */
|
|
74
|
+
const endsWithWord = (text: string, word: string): boolean => text.endsWith(word) && !(isLatin(word[0]) && isLatin(text.at(-word.length - 1)));
|
|
75
|
+
|
|
76
|
+
const startsWithWord = (text: string, word: string): boolean => text.startsWith(word) && !(isLatin(word.at(-1)) && isLatin(text[word.length]));
|
|
77
|
+
|
|
78
|
+
const isHedged = (sentence: string, phrase: Phrase, words: CountWords): boolean => {
|
|
79
|
+
const before = sentence.slice(0, phrase.start).trimEnd().toLowerCase();
|
|
80
|
+
const afters = [sentence.slice(phrase.numberEnd), sentence.slice(phrase.end)].map((text) => text.trimStart().toLowerCase());
|
|
81
|
+
return (
|
|
82
|
+
words.hedgesBefore.some((hedge) => endsWithWord(before, hedge.toLowerCase())) ||
|
|
83
|
+
words.hedgesAfter.some((hedge) => afters.some((after) => startsWithWord(after, hedge.toLowerCase())))
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const COLON_END = /[::][ \t]*$/u;
|
|
88
|
+
|
|
89
|
+
/** 数える語の無い数は、先を指す語のすぐ後ろでだけ(the following two:)。「under $75:」の金額を数に読まない。 */
|
|
90
|
+
const pointsAhead = (sentence: string, phrase: Phrase, anchors: readonly string[]): boolean => {
|
|
91
|
+
const before = sentence.slice(0, phrase.start).toLowerCase();
|
|
92
|
+
const lowered = anchors.map((anchor) => anchor.toLowerCase());
|
|
93
|
+
if (!phrase.counted) return lowered.some((anchor) => endsWithWord(before.trimEnd(), anchor));
|
|
94
|
+
return COLON_END.test(sentence.trimEnd()) || lowered.some((anchor) => before.includes(anchor));
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/** 最後の一文の予告。数がちょうど一つで、目安や順番でなく、先を指しているときだけ。 */
|
|
98
|
+
const announcedIn = (sentence: string, words: CountWords, pattern: RegExp): Phrase | undefined => {
|
|
99
|
+
const phrases = [...sentence.matchAll(pattern)].map((match) => ({
|
|
100
|
+
start: match.index,
|
|
101
|
+
numberEnd: match.index + (match[1] ?? "").length,
|
|
102
|
+
end: match.index + match[0].length,
|
|
103
|
+
announced: valueOf(match[1] ?? "", words.numbers),
|
|
104
|
+
counted: match[2] !== undefined,
|
|
105
|
+
}));
|
|
106
|
+
const only = phrases.length === 1 ? phrases[0] : undefined;
|
|
107
|
+
if (only === undefined || only.announced < 1 || isHedged(sentence, only, words)) return undefined;
|
|
108
|
+
return pointsAhead(sentence, only, words.anchors) ? only : undefined;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/** 位置から空白と改行を読み飛ばした先。 */
|
|
112
|
+
const pastSpace = (source: string, at: number): number => {
|
|
113
|
+
const filled = /[^ \t\r\n]/gu;
|
|
114
|
+
filled.lastIndex = at;
|
|
115
|
+
return filled.exec(source)?.index ?? source.length;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/** 箇条書きの終わり(後ろの空白を読み飛ばした先)と始まり。空白だけを挟んで続く二つの箇条書きは、終わりと始まりが同じ位置になる。 */
|
|
119
|
+
type Neighbours = { readonly ends: ReadonlySet<number>; readonly starts: ReadonlySet<number> };
|
|
120
|
+
|
|
121
|
+
const neighboursOf = (source: string, lists: readonly BulletList[]): Neighbours => ({
|
|
122
|
+
ends: new Set(lists.map((list) => pastSpace(source, list.span.end))),
|
|
123
|
+
starts: new Set(lists.map((list) => list.span.start)),
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
/** 空白だけを挟んで前か後ろに別の箇条書きが続く。印が変わって二つに割れた一つの並びかもしれず、数を決められない。 */
|
|
127
|
+
const hasNeighbour = (source: string, list: Span, neighbours: Neighbours): boolean =>
|
|
128
|
+
neighbours.ends.has(list.start) || neighbours.starts.has(pastSpace(source, list.end));
|
|
129
|
+
|
|
130
|
+
type Context = { readonly source: string; readonly words: CountWords; readonly pattern: RegExp; readonly neighbours: Neighbours };
|
|
131
|
+
|
|
132
|
+
const mismatchOf = ({ source, words, pattern, neighbours }: Context, list: BulletList): CountMismatch[] => {
|
|
133
|
+
if (hasNeighbour(source, list.span, neighbours)) return [];
|
|
134
|
+
const lead = leadBefore(source, list.span.start);
|
|
135
|
+
if (lead === undefined) return [];
|
|
136
|
+
const sentenceStart = lastSentenceStart(lead.text);
|
|
137
|
+
const sentence = lead.text.slice(sentenceStart);
|
|
138
|
+
const phrase = announcedIn(sentence, words, pattern);
|
|
139
|
+
if (phrase === undefined || phrase.announced === list.items.length) return [];
|
|
140
|
+
const offset = lead.start + sentenceStart + phrase.start;
|
|
141
|
+
return [{ offset, phrase: sentence.slice(phrase.start, phrase.end).trim(), announced: phrase.announced, listed: list.items.length }];
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const announcedCountMismatches = (source: string, lists: readonly BulletList[], words: CountWords): CountMismatch[] => {
|
|
145
|
+
if (words.counters.length === 0) return [];
|
|
146
|
+
const context = { source, words, pattern: phrasePattern(words), neighbours: neighboursOf(source, lists) };
|
|
147
|
+
return lists.flatMap((list) => mismatchOf(context, list));
|
|
148
|
+
};
|
package/src/bare-url.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Span } from "./plugin.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `https://…` をそのまま書いた URL。GFM の autolink 拡張を入れていないので mdast では
|
|
5
|
+
* ただのテキストになり、本文として残る。残すと、見出しと URL の中の識別子が一致して
|
|
6
|
+
* 「見出しの繰り返し」と読まれる。表示される文字も本文ではない。
|
|
7
|
+
* 空白が来るまでを取るので、URL の直後に続けた日本語(「https://example.jp/をご覧ください」の「をご覧ください」)も入る。
|
|
8
|
+
*/
|
|
9
|
+
export const BARE_URL = /https?:\/\/[^\s)<>"'\]]+/gu;
|
|
10
|
+
|
|
11
|
+
/** 文の終わりの句読点。URL の最後の字としてはまず書かれず、URL の後ろの文の字。 */
|
|
12
|
+
const PUNCTUATION: ReadonlySet<string> = new Set([".", ",", ";", ":", "!", "?"]);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* そのまま書いた URL に続けた文の始まり: ひらがなと全角の句読点・括弧(「…/をご覧ください」「…/。」)。
|
|
16
|
+
* 漢字やカタカナは道の名前(/東京、/カタログ)にもなるので切らない。
|
|
17
|
+
*/
|
|
18
|
+
const SENTENCE_AFTER = /[\p{Script=Hiragana}\u3000-\u303f\uff01-\uff0f\uff1a-\uff20]/u;
|
|
19
|
+
|
|
20
|
+
/** URL として読む長さ。続けた文の手前で切り、後ろの句読点を外す。正規表現の `[…]+$` は句読点の長い並びで後戻りが二乗になる。 */
|
|
21
|
+
const urlLength = (written: string): number => {
|
|
22
|
+
const cut = SENTENCE_AFTER.exec(written)?.index ?? written.length;
|
|
23
|
+
let end = cut;
|
|
24
|
+
while (end > 0 && PUNCTUATION.has(written.charAt(end - 1))) end -= 1;
|
|
25
|
+
return end;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type BareUrl = Span & { readonly url: string };
|
|
29
|
+
|
|
30
|
+
/** text の中の、そのまま書いた URL。続けて書いた日本語と文末の句読点は外す。位置は text の先頭を 0 とする。 */
|
|
31
|
+
export const bareUrls = (text: string): BareUrl[] =>
|
|
32
|
+
[...text.matchAll(BARE_URL)].map((match) => {
|
|
33
|
+
const url = match[0].slice(0, urlLength(match[0]));
|
|
34
|
+
return { start: match.index, end: match.index + url.length, url };
|
|
35
|
+
});
|
package/src/baseline.ts
CHANGED
|
@@ -13,6 +13,21 @@ export const fingerprint = (path: string, finding: Finding): string => {
|
|
|
13
13
|
return createHash("sha256").update(body).digest("hex").slice(0, 16);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* findings の fingerprint を順に。一つの文から出た指摘は同じ文を引くので、文と rule の組ごとに一度だけ計算する。
|
|
18
|
+
* 長い文に指摘が多いと、指摘ごとに文を読み直すのでは指摘数と文の長さの積になる。
|
|
19
|
+
*/
|
|
20
|
+
export const fingerprints = (path: string, findings: readonly Finding[]): string[] => {
|
|
21
|
+
const known = new Map<string, Map<string, string>>();
|
|
22
|
+
return findings.map((finding) => {
|
|
23
|
+
const byRule = known.get(finding.quote) ?? new Map<string, string>();
|
|
24
|
+
known.set(finding.quote, byRule);
|
|
25
|
+
const found = byRule.get(finding.rule) ?? fingerprint(path, finding);
|
|
26
|
+
byRule.set(finding.rule, found);
|
|
27
|
+
return found;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
16
31
|
export type Baseline = { readonly version: 1; readonly created: string; readonly entries: readonly string[] };
|
|
17
32
|
|
|
18
33
|
const isBaseline = (value: unknown): value is Baseline =>
|
|
@@ -40,7 +55,8 @@ export type Split = { readonly fresh: readonly Finding[]; readonly shelved: numb
|
|
|
40
55
|
export const splitByBaseline = (path: string, findings: readonly Finding[], baseline: Baseline | undefined): Split => {
|
|
41
56
|
if (baseline === undefined) return { fresh: findings, shelved: 0 };
|
|
42
57
|
const known = new Set(baseline.entries);
|
|
43
|
-
const
|
|
58
|
+
const prints = fingerprints(path, findings);
|
|
59
|
+
const fresh = findings.filter((_, index) => !known.has(prints[index] ?? ""));
|
|
44
60
|
return { fresh, shelved: findings.length - fresh.length };
|
|
45
61
|
};
|
|
46
62
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Section } from "./plugin.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 本題の始まり: 最初の中見出し(深さ 2 以上)の節。表題(深さ 1)の直後から数えると、表題しか無い文書で全文が前置きになる。
|
|
5
|
+
* 無ければ、本題の前を測る rule は動けない(rule の requires の headings)。
|
|
6
|
+
*/
|
|
7
|
+
export const bodySectionOf = (sections: readonly Section[]): Section | undefined => sections.find((section) => section.depth >= 2);
|
package/src/calendar-number.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { digitRunAround } from "./number-name.ts";
|
|
2
|
-
import type { Span, Token } from "./plugin.ts";
|
|
2
|
+
import type { ProseDocument, Span, Token } from "./plugin.ts";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 日付・時刻として書かれた数(9月、3時、2026年、10月1日、10時5分)。数を詰めて書くのが決まりで、空け方の好みではない。
|
|
@@ -8,21 +8,27 @@ import type { Span, Token } from "./plugin.ts";
|
|
|
8
8
|
* 単位は語彙表から渡す。chained は日付・時刻の単位を大きい順に(年月日時分秒)。大きい単位の後ろに小さい単位を続けて書けば
|
|
9
9
|
* 一つの日付・時刻になる。「2008年 2年連続」のように同じ単位や大きい単位が続けば、別のものの始まり。
|
|
10
10
|
* positional は数の後ろに置くだけで位置を言う単位(月、時)。year は 4 桁の数の後ろで暦の年を言う単位(年、年度)。
|
|
11
|
+
* era は元号(令和)。元号のすぐ後ろ(空白 1 つまで)の数は、単位が何でも暦の上の位置を言う(令和8年、桁が少なくても年数ではない)。
|
|
11
12
|
* 「5日」「5分」「3年」のように、単位だけでは長さと見分けのつかないものは、位置を言う単位と続けて書いたときだけ日付・時刻と読む。
|
|
12
13
|
*/
|
|
13
|
-
export type CalendarUnits = {
|
|
14
|
+
export type CalendarUnits = {
|
|
15
|
+
readonly chained: readonly string[];
|
|
16
|
+
readonly positional: ReadonlySet<string>;
|
|
17
|
+
readonly year: ReadonlySet<string>;
|
|
18
|
+
readonly era: readonly string[];
|
|
19
|
+
};
|
|
14
20
|
|
|
15
|
-
/** 日付・時刻の数の並び。first は日付の頭の数、inner は前の単位に続く数(2026年9月の 9)。 */
|
|
16
|
-
export type CalendarRun = { readonly run: Span; readonly place: "first" | "inner" };
|
|
21
|
+
/** 日付・時刻の数の並び。first は日付の頭の数、inner は前の単位に続く数(2026年9月の 9)。unit は数の後ろの単位(月)。 */
|
|
22
|
+
export type CalendarRun = { readonly run: Span; readonly place: "first" | "inner"; readonly unit: string };
|
|
17
23
|
|
|
18
24
|
/** 数の並びと、その後ろの単位の終わり(文の中の位置)。rank は chained の中の単位の順(無ければ -1)、anchored は単位だけで日付・時刻と分かるもの。 */
|
|
19
|
-
type Part = { readonly run: Span; readonly unitEnd: number; readonly rank: number; readonly anchored: boolean };
|
|
25
|
+
type Part = { readonly run: Span; readonly unit: string; readonly unitEnd: number; readonly rank: number; readonly anchored: boolean };
|
|
20
26
|
|
|
21
27
|
const DIGIT = /\d/u;
|
|
22
28
|
const CALENDAR_YEAR = /^\d{4}$/u;
|
|
23
29
|
|
|
24
30
|
/** text の中の数の並び(数字・小数点・ハイフン)を左から。 */
|
|
25
|
-
const digitRuns = (text: string): Span[] => {
|
|
31
|
+
export const digitRuns = (text: string): Span[] => {
|
|
26
32
|
const runs: Span[] = [];
|
|
27
33
|
let at = 0;
|
|
28
34
|
while (at < text.length) {
|
|
@@ -38,15 +44,22 @@ const pastSpace = (text: string, at: number): number => (text[at] === " " ? at +
|
|
|
38
44
|
|
|
39
45
|
const isUnit = (surface: string, units: CalendarUnits): boolean => units.chained.includes(surface) || units.positional.has(surface) || units.year.has(surface);
|
|
40
46
|
|
|
41
|
-
|
|
42
|
-
|
|
47
|
+
/** 数 run のすぐ前(空白 1 つまで)が元号か。 */
|
|
48
|
+
const followsEra = (text: string, run: Span, units: CalendarUnits): boolean => {
|
|
49
|
+
const before = text.slice(0, run.start);
|
|
50
|
+
const written = before.endsWith(" ") ? before.slice(0, -1) : before;
|
|
51
|
+
return units.era.some((era) => written.endsWith(era));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const isAnchor = (text: string, run: Span, surface: string, units: CalendarUnits): boolean =>
|
|
55
|
+
units.positional.has(surface) || (units.year.has(surface) && CALENDAR_YEAR.test(text.slice(run.start, run.end))) || followsEra(text, run, units);
|
|
43
56
|
|
|
44
57
|
/** 数のすぐ後ろ(空白 1 つまで)の語が日付・時刻の単位なら、その組。語の切れ目が合わなければ組にしない。 */
|
|
45
58
|
const partOf = (text: string, run: Span, tokens: readonly Token[], base: number, units: CalendarUnits): Part | undefined => {
|
|
46
59
|
const unit = tokens.find((token) => token.span.start === base + pastSpace(text, run.end));
|
|
47
60
|
if (unit === undefined || !isUnit(unit.surface, units)) return undefined;
|
|
48
61
|
const rank = units.chained.indexOf(unit.surface);
|
|
49
|
-
return { run, unitEnd: unit.span.end - base, rank, anchored: isAnchor(text
|
|
62
|
+
return { run, unit: unit.surface, unitEnd: unit.span.end - base, rank, anchored: isAnchor(text, run, unit.surface, units) };
|
|
50
63
|
};
|
|
51
64
|
|
|
52
65
|
/** 前の組の単位のすぐ後ろ(空白 1 つまで)から始まり、単位が前より小さい組か。 */
|
|
@@ -71,5 +84,15 @@ export const calendarRuns = (text: string, tokens: readonly Token[] | undefined,
|
|
|
71
84
|
const parts = digitRuns(text).flatMap((run) => partOf(text, run, tokens, base, units) ?? []);
|
|
72
85
|
return chainsOf(text, parts)
|
|
73
86
|
.filter((chain) => chain.some((part) => part.anchored))
|
|
74
|
-
.flatMap((chain) => chain.map((part, index): CalendarRun => ({ run: part.run, place: index === 0 ? "first" : "inner" })));
|
|
87
|
+
.flatMap((chain) => chain.map((part, index): CalendarRun => ({ run: part.run, place: index === 0 ? "first" : "inner", unit: part.unit })));
|
|
75
88
|
};
|
|
89
|
+
|
|
90
|
+
const patternList = (doc: ProseDocument, id: string): string[] => (doc.lexicons[id] ?? []).map((entry) => entry.pattern);
|
|
91
|
+
|
|
92
|
+
/** 文書の言語の、日付・時刻の単位の語彙表。表の無い言語では空で、日付・時刻の数は見つからない。 */
|
|
93
|
+
export const calendarUnitsOf = (doc: ProseDocument): CalendarUnits => ({
|
|
94
|
+
chained: patternList(doc, "date-time-unit"),
|
|
95
|
+
positional: new Set(patternList(doc, "calendar-unit")),
|
|
96
|
+
year: new Set(patternList(doc, "calendar-year-unit")),
|
|
97
|
+
era: patternList(doc, "calendar-era"),
|
|
98
|
+
});
|
package/src/cli-args.ts
CHANGED
|
@@ -7,3 +7,9 @@ const VALUE_FLAGS: ReadonlySet<string> = new Set(["--sarif", "--genre", "--rule"
|
|
|
7
7
|
/** The arguments that name what to check: everything that is neither an option nor an option's value. */
|
|
8
8
|
export const targetsOf = (args: readonly string[]): string[] =>
|
|
9
9
|
args.filter((arg, index) => !arg.startsWith("--") && !(index > 0 && VALUE_FLAGS.has(args[index - 1] ?? "")));
|
|
10
|
+
|
|
11
|
+
/** The settings with --experimental applied: the command line turns experimental rules on as chaff.yaml can. */
|
|
12
|
+
export const withExperimental = <T extends { readonly experimental: boolean }>(config: T, args: readonly string[]): T => ({
|
|
13
|
+
...config,
|
|
14
|
+
experimental: config.experimental || args.includes("--experimental"),
|
|
15
|
+
});
|