chaffjs 0.49.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.
- package/README.ja.md +30 -3
- package/README.md +30 -2
- package/dist/allow.d.ts +49 -0
- package/dist/allow.d.ts.map +1 -0
- package/dist/allow.js +111 -0
- package/dist/allow.js.map +1 -0
- package/dist/announced-count.d.ts.map +1 -1
- package/dist/announced-count.js +18 -1
- package/dist/announced-count.js.map +1 -1
- package/dist/announced-list.d.ts.map +1 -1
- package/dist/announced-list.js +6 -1
- package/dist/announced-list.js.map +1 -1
- package/dist/check-source.d.ts +13 -3
- package/dist/check-source.d.ts.map +1 -1
- package/dist/check-source.js +23 -6
- package/dist/check-source.js.map +1 -1
- package/dist/cli-text.d.ts +7 -1
- package/dist/cli-text.d.ts.map +1 -1
- package/dist/cli-text.js +8 -2
- package/dist/cli-text.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +16 -13
- package/dist/cli.js.map +1 -1
- package/dist/commands/eval.js +1 -1
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/suppressions.d.ts +4 -1
- package/dist/commands/suppressions.d.ts.map +1 -1
- package/dist/commands/suppressions.js +2 -2
- package/dist/commands/suppressions.js.map +1 -1
- package/dist/commands/test.js +1 -1
- package/dist/commands/test.js.map +1 -1
- package/dist/composite-signals.d.ts +3 -1
- package/dist/composite-signals.d.ts.map +1 -1
- package/dist/composite-signals.js +7 -0
- package/dist/composite-signals.js.map +1 -1
- package/dist/compound-head.d.ts +5 -2
- package/dist/compound-head.d.ts.map +1 -1
- package/dist/compound-head.js +17 -8
- package/dist/compound-head.js.map +1 -1
- package/dist/config/allow-problems.d.ts +8 -0
- package/dist/config/allow-problems.d.ts.map +1 -0
- package/dist/config/allow-problems.js +61 -0
- package/dist/config/allow-problems.js.map +1 -0
- package/dist/config/by-path-problems.d.ts +3 -0
- package/dist/config/by-path-problems.d.ts.map +1 -1
- package/dist/config/by-path-problems.js +21 -2
- package/dist/config/by-path-problems.js.map +1 -1
- package/dist/config/by-path-rules.d.ts +34 -0
- package/dist/config/by-path-rules.d.ts.map +1 -0
- package/dist/config/by-path-rules.js +53 -0
- package/dist/config/by-path-rules.js.map +1 -0
- package/dist/config/by-path.d.ts +15 -0
- package/dist/config/by-path.d.ts.map +1 -1
- package/dist/config/by-path.js.map +1 -1
- package/dist/config/consistent-problems.d.ts +5 -0
- package/dist/config/consistent-problems.d.ts.map +1 -0
- package/dist/config/consistent-problems.js +24 -0
- package/dist/config/consistent-problems.js.map +1 -0
- package/dist/config/load.d.ts +23 -1
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +63 -10
- package/dist/config/load.js.map +1 -1
- package/dist/config/option-problems.d.ts +6 -4
- package/dist/config/option-problems.d.ts.map +1 -1
- package/dist/config/option-problems.js +5 -2
- package/dist/config/option-problems.js.map +1 -1
- package/dist/config/prefer-problems.d.ts +5 -0
- package/dist/config/prefer-problems.d.ts.map +1 -0
- package/dist/config/prefer-problems.js +15 -0
- package/dist/config/prefer-problems.js.map +1 -0
- package/dist/config/prefer.d.ts +21 -0
- package/dist/config/prefer.d.ts.map +1 -0
- package/dist/config/prefer.js +35 -0
- package/dist/config/prefer.js.map +1 -0
- package/dist/config/term-problems.d.ts +5 -0
- package/dist/config/term-problems.d.ts.map +1 -0
- package/dist/config/term-problems.js +25 -0
- package/dist/config/term-problems.js.map +1 -0
- package/dist/config/warnings.d.ts +1 -1
- package/dist/config/warnings.d.ts.map +1 -1
- package/dist/config/warnings.js +9 -2
- package/dist/config/warnings.js.map +1 -1
- package/dist/cross-variants.d.ts +1 -1
- package/dist/cross-variants.d.ts.map +1 -1
- package/dist/cross-variants.js +4 -8
- package/dist/cross-variants.js.map +1 -1
- package/dist/cross-votes.d.ts +13 -0
- package/dist/cross-votes.d.ts.map +1 -1
- package/dist/cross-votes.js +25 -2
- package/dist/cross-votes.js.map +1 -1
- package/dist/custom/parse.d.ts +9 -0
- package/dist/custom/parse.d.ts.map +1 -1
- package/dist/custom/parse.js +11 -2
- package/dist/custom/parse.js.map +1 -1
- package/dist/custom/problems.d.ts.map +1 -1
- package/dist/custom/problems.js +9 -3
- package/dist/custom/problems.js.map +1 -1
- package/dist/custom/scope-field.d.ts +7 -0
- package/dist/custom/scope-field.d.ts.map +1 -0
- package/dist/custom/scope-field.js +14 -0
- package/dist/custom/scope-field.js.map +1 -0
- package/dist/date-format.d.ts +5 -3
- package/dist/date-format.d.ts.map +1 -1
- package/dist/date-format.js +30 -5
- package/dist/date-format.js.map +1 -1
- package/dist/derived/elapsed.d.ts +4 -1
- package/dist/derived/elapsed.d.ts.map +1 -1
- package/dist/derived/elapsed.js +11 -1
- package/dist/derived/elapsed.js.map +1 -1
- package/dist/detectors/acronym-context.d.ts +3 -1
- package/dist/detectors/acronym-context.d.ts.map +1 -1
- package/dist/detectors/acronym-context.js +7 -1
- package/dist/detectors/acronym-context.js.map +1 -1
- package/dist/detectors/acronym-gloss.d.ts +20 -7
- package/dist/detectors/acronym-gloss.d.ts.map +1 -1
- package/dist/detectors/acronym-gloss.js +50 -13
- package/dist/detectors/acronym-gloss.js.map +1 -1
- package/dist/detectors/agentless-passive.d.ts.map +1 -1
- package/dist/detectors/agentless-passive.js +39 -4
- package/dist/detectors/agentless-passive.js.map +1 -1
- package/dist/detectors/agreement-slip.d.ts +2 -0
- package/dist/detectors/agreement-slip.d.ts.map +1 -1
- package/dist/detectors/agreement-slip.js +10 -3
- package/dist/detectors/agreement-slip.js.map +1 -1
- package/dist/detectors/amount-scale.js +2 -2
- package/dist/detectors/amount-scale.js.map +1 -1
- package/dist/detectors/bare-comparative.d.ts +4 -0
- package/dist/detectors/bare-comparative.d.ts.map +1 -1
- package/dist/detectors/bare-comparative.js +27 -3
- package/dist/detectors/bare-comparative.js.map +1 -1
- package/dist/detectors/blank-structure.d.ts +5 -1
- package/dist/detectors/blank-structure.d.ts.map +1 -1
- package/dist/detectors/blank-structure.js +13 -7
- package/dist/detectors/blank-structure.js.map +1 -1
- package/dist/detectors/bold-label.d.ts.map +1 -1
- package/dist/detectors/bold-label.js +12 -6
- package/dist/detectors/bold-label.js.map +1 -1
- package/dist/detectors/bracket-title-date.d.ts +6 -0
- package/dist/detectors/bracket-title-date.d.ts.map +1 -0
- package/dist/detectors/bracket-title-date.js +29 -0
- package/dist/detectors/bracket-title-date.js.map +1 -0
- package/dist/detectors/broken-link.d.ts.map +1 -1
- package/dist/detectors/broken-link.js +12 -1
- package/dist/detectors/broken-link.js.map +1 -1
- package/dist/detectors/capitalised-term.d.ts.map +1 -1
- package/dist/detectors/capitalised-term.js +24 -11
- package/dist/detectors/capitalised-term.js.map +1 -1
- package/dist/detectors/change-rate.d.ts.map +1 -1
- package/dist/detectors/change-rate.js +27 -4
- package/dist/detectors/change-rate.js.map +1 -1
- package/dist/detectors/char-shape.d.ts.map +1 -1
- package/dist/detectors/char-shape.js +12 -17
- package/dist/detectors/char-shape.js.map +1 -1
- package/dist/detectors/chat-citation.d.ts +2 -6
- package/dist/detectors/chat-citation.d.ts.map +1 -1
- package/dist/detectors/chat-citation.js +4 -2
- package/dist/detectors/chat-citation.js.map +1 -1
- package/dist/detectors/chat-mark-extent.d.ts +11 -0
- package/dist/detectors/chat-mark-extent.d.ts.map +1 -0
- package/dist/detectors/chat-mark-extent.js +53 -0
- package/dist/detectors/chat-mark-extent.js.map +1 -0
- package/dist/detectors/clause-shape.d.ts +4 -2
- package/dist/detectors/clause-shape.d.ts.map +1 -1
- package/dist/detectors/clause-shape.js +8 -4
- package/dist/detectors/clause-shape.js.map +1 -1
- package/dist/detectors/conjugated-entry.d.ts +2 -2
- package/dist/detectors/conjugated-entry.d.ts.map +1 -1
- package/dist/detectors/conjugated-entry.js +3 -5
- package/dist/detectors/conjugated-entry.js.map +1 -1
- package/dist/detectors/contraction-mix.d.ts.map +1 -1
- package/dist/detectors/contraction-mix.js +3 -2
- package/dist/detectors/contraction-mix.js.map +1 -1
- package/dist/detectors/contraction-set-apart.d.ts +7 -1
- package/dist/detectors/contraction-set-apart.d.ts.map +1 -1
- package/dist/detectors/contraction-set-apart.js +14 -1
- package/dist/detectors/contraction-set-apart.js.map +1 -1
- package/dist/detectors/contrast-frame.d.ts.map +1 -1
- package/dist/detectors/contrast-frame.js +34 -1
- package/dist/detectors/contrast-frame.js.map +1 -1
- package/dist/detectors/coordinate-adjective.d.ts +5 -3
- package/dist/detectors/coordinate-adjective.d.ts.map +1 -1
- package/dist/detectors/coordinate-adjective.js +49 -1
- package/dist/detectors/coordinate-adjective.js.map +1 -1
- package/dist/detectors/count-per-section.d.ts.map +1 -1
- package/dist/detectors/count-per-section.js +29 -23
- package/dist/detectors/count-per-section.js.map +1 -1
- package/dist/detectors/counter-edge.d.ts +11 -0
- package/dist/detectors/counter-edge.d.ts.map +1 -1
- package/dist/detectors/counter-edge.js +17 -0
- package/dist/detectors/counter-edge.js.map +1 -1
- package/dist/detectors/cross-variant.d.ts.map +1 -1
- package/dist/detectors/cross-variant.js +14 -2
- package/dist/detectors/cross-variant.js.map +1 -1
- package/dist/detectors/currency-notation.js +2 -2
- package/dist/detectors/currency-notation.js.map +1 -1
- package/dist/detectors/custom.d.ts.map +1 -1
- package/dist/detectors/custom.js +6 -4
- package/dist/detectors/custom.js.map +1 -1
- package/dist/detectors/date-format.js +1 -1
- package/dist/detectors/date-format.js.map +1 -1
- package/dist/detectors/date-repeated-day.d.ts +11 -0
- package/dist/detectors/date-repeated-day.d.ts.map +1 -0
- package/dist/detectors/date-repeated-day.js +15 -0
- package/dist/detectors/date-repeated-day.js.map +1 -0
- package/dist/detectors/date-year.d.ts.map +1 -1
- package/dist/detectors/date-year.js +8 -1
- package/dist/detectors/date-year.js.map +1 -1
- package/dist/detectors/defined-term-form.d.ts.map +1 -1
- package/dist/detectors/defined-term-form.js +21 -6
- package/dist/detectors/defined-term-form.js.map +1 -1
- package/dist/detectors/definition-use.d.ts.map +1 -1
- package/dist/detectors/definition-use.js +12 -2
- package/dist/detectors/definition-use.js.map +1 -1
- package/dist/detectors/derived-numbers.d.ts.map +1 -1
- package/dist/detectors/derived-numbers.js +1 -0
- package/dist/detectors/derived-numbers.js.map +1 -1
- package/dist/detectors/document-shape.d.ts +1 -1
- package/dist/detectors/document-shape.d.ts.map +1 -1
- package/dist/detectors/document-shape.js +4 -1
- package/dist/detectors/document-shape.js.map +1 -1
- package/dist/detectors/ellipsis.js +2 -2
- package/dist/detectors/ellipsis.js.map +1 -1
- package/dist/detectors/email-letter.d.ts +5 -1
- package/dist/detectors/email-letter.d.ts.map +1 -1
- package/dist/detectors/email-letter.js +5 -3
- package/dist/detectors/email-letter.js.map +1 -1
- package/dist/detectors/empty-section.d.ts +1 -0
- package/dist/detectors/empty-section.d.ts.map +1 -1
- package/dist/detectors/empty-section.js +10 -1
- package/dist/detectors/empty-section.js.map +1 -1
- package/dist/detectors/en-shape.d.ts.map +1 -1
- package/dist/detectors/en-shape.js +49 -9
- package/dist/detectors/en-shape.js.map +1 -1
- package/dist/detectors/enumeration-marker.d.ts +7 -0
- package/dist/detectors/enumeration-marker.d.ts.map +1 -0
- package/dist/detectors/enumeration-marker.js +8 -0
- package/dist/detectors/enumeration-marker.js.map +1 -0
- package/dist/detectors/event-title-item.d.ts +8 -0
- package/dist/detectors/event-title-item.d.ts.map +1 -0
- package/dist/detectors/event-title-item.js +45 -0
- package/dist/detectors/event-title-item.js.map +1 -0
- package/dist/detectors/example-baseline.d.ts +5 -0
- package/dist/detectors/example-baseline.d.ts.map +1 -1
- package/dist/detectors/example-baseline.js +15 -1
- package/dist/detectors/example-baseline.js.map +1 -1
- package/dist/detectors/filler-word.d.ts +11 -0
- package/dist/detectors/filler-word.d.ts.map +1 -0
- package/dist/detectors/filler-word.js +73 -0
- package/dist/detectors/filler-word.js.map +1 -0
- package/dist/detectors/fullwidth-alnum.d.ts.map +1 -1
- package/dist/detectors/fullwidth-alnum.js +19 -0
- package/dist/detectors/fullwidth-alnum.js.map +1 -1
- package/dist/detectors/gram-furniture.d.ts +1 -0
- package/dist/detectors/gram-furniture.d.ts.map +1 -1
- package/dist/detectors/gram-furniture.js +6 -0
- package/dist/detectors/gram-furniture.js.map +1 -1
- package/dist/detectors/gram-repetition.d.ts.map +1 -1
- package/dist/detectors/gram-repetition.js +8 -2
- package/dist/detectors/gram-repetition.js.map +1 -1
- package/dist/detectors/heading-case.d.ts +1 -0
- package/dist/detectors/heading-case.d.ts.map +1 -1
- package/dist/detectors/heading-case.js +16 -4
- package/dist/detectors/heading-case.js.map +1 -1
- package/dist/detectors/heading-marker-no-space.d.ts +3 -0
- package/dist/detectors/heading-marker-no-space.d.ts.map +1 -0
- package/dist/detectors/heading-marker-no-space.js +49 -0
- package/dist/detectors/heading-marker-no-space.js.map +1 -0
- package/dist/detectors/hyphen-name-suffix.d.ts.map +1 -1
- package/dist/detectors/hyphen-name-suffix.js +3 -2
- package/dist/detectors/hyphen-name-suffix.js.map +1 -1
- package/dist/detectors/inline-item-label.d.ts +6 -0
- package/dist/detectors/inline-item-label.d.ts.map +1 -0
- package/dist/detectors/inline-item-label.js +68 -0
- package/dist/detectors/inline-item-label.js.map +1 -0
- package/dist/detectors/kanji-name-edge.d.ts +5 -0
- package/dist/detectors/kanji-name-edge.d.ts.map +1 -1
- package/dist/detectors/kanji-name-edge.js +9 -0
- package/dist/detectors/kanji-name-edge.js.map +1 -1
- package/dist/detectors/known-correction.d.ts.map +1 -1
- package/dist/detectors/known-correction.js +13 -1
- package/dist/detectors/known-correction.js.map +1 -1
- package/dist/detectors/kutoten-consistency.d.ts.map +1 -1
- package/dist/detectors/kutoten-consistency.js +27 -6
- package/dist/detectors/kutoten-consistency.js.map +1 -1
- package/dist/detectors/lexicon-match.d.ts +2 -0
- package/dist/detectors/lexicon-match.d.ts.map +1 -1
- package/dist/detectors/lexicon-match.js +14 -3
- package/dist/detectors/lexicon-match.js.map +1 -1
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +8 -1
- package/dist/detectors/lexicon.js.map +1 -1
- package/dist/detectors/link-definition.d.ts +3 -0
- package/dist/detectors/link-definition.d.ts.map +1 -0
- package/dist/detectors/link-definition.js +78 -0
- package/dist/detectors/link-definition.js.map +1 -0
- package/dist/detectors/list-item-asides.d.ts +7 -0
- package/dist/detectors/list-item-asides.d.ts.map +1 -0
- package/dist/detectors/list-item-asides.js +25 -0
- package/dist/detectors/list-item-asides.js.map +1 -0
- package/dist/detectors/list-item-clause.d.ts +4 -0
- package/dist/detectors/list-item-clause.d.ts.map +1 -0
- package/dist/detectors/list-item-clause.js +8 -0
- package/dist/detectors/list-item-clause.js.map +1 -0
- package/dist/detectors/list-item.d.ts +2 -0
- package/dist/detectors/list-item.d.ts.map +1 -1
- package/dist/detectors/list-item.js +6 -0
- package/dist/detectors/list-item.js.map +1 -1
- package/dist/detectors/list-items.d.ts.map +1 -1
- package/dist/detectors/list-items.js +12 -3
- package/dist/detectors/list-items.js.map +1 -1
- package/dist/detectors/list-opening-conjunction.d.ts +7 -0
- package/dist/detectors/list-opening-conjunction.d.ts.map +1 -0
- package/dist/detectors/list-opening-conjunction.js +22 -0
- package/dist/detectors/list-opening-conjunction.js.map +1 -0
- package/dist/detectors/list-parallel.d.ts.map +1 -1
- package/dist/detectors/list-parallel.js +17 -16
- package/dist/detectors/list-parallel.js.map +1 -1
- package/dist/detectors/list-run.d.ts.map +1 -1
- package/dist/detectors/list-run.js +15 -3
- package/dist/detectors/list-run.js.map +1 -1
- package/dist/detectors/list-sentence.d.ts +2 -0
- package/dist/detectors/list-sentence.d.ts.map +1 -1
- package/dist/detectors/list-sentence.js.map +1 -1
- package/dist/detectors/list-verb-series.d.ts +6 -0
- package/dist/detectors/list-verb-series.d.ts.map +1 -0
- package/dist/detectors/list-verb-series.js +20 -0
- package/dist/detectors/list-verb-series.js.map +1 -0
- package/dist/detectors/mark-shape.d.ts +5 -2
- package/dist/detectors/mark-shape.d.ts.map +1 -1
- package/dist/detectors/mark-shape.js +40 -23
- package/dist/detectors/mark-shape.js.map +1 -1
- package/dist/detectors/markdown-slip.d.ts +5 -0
- package/dist/detectors/markdown-slip.d.ts.map +1 -1
- package/dist/detectors/markdown-slip.js +23 -0
- package/dist/detectors/markdown-slip.js.map +1 -1
- package/dist/detectors/marked-word.d.ts +10 -0
- package/dist/detectors/marked-word.d.ts.map +1 -0
- package/dist/detectors/marked-word.js +30 -0
- package/dist/detectors/marked-word.js.map +1 -0
- package/dist/detectors/middle-dot.d.ts +1 -1
- package/dist/detectors/middle-dot.d.ts.map +1 -1
- package/dist/detectors/middle-dot.js +21 -2
- package/dist/detectors/middle-dot.js.map +1 -1
- package/dist/detectors/missing-final-period.d.ts.map +1 -1
- package/dist/detectors/missing-final-period.js +17 -1
- package/dist/detectors/missing-final-period.js.map +1 -1
- package/dist/detectors/name-variant-two-things.d.ts +2 -1
- package/dist/detectors/name-variant-two-things.d.ts.map +1 -1
- package/dist/detectors/name-variant-two-things.js +30 -2
- package/dist/detectors/name-variant-two-things.js.map +1 -1
- package/dist/detectors/net-amount-mismatch.d.ts.map +1 -1
- package/dist/detectors/net-amount-mismatch.js +26 -4
- package/dist/detectors/net-amount-mismatch.js.map +1 -1
- package/dist/detectors/nominalization.d.ts.map +1 -1
- package/dist/detectors/nominalization.js +17 -5
- package/dist/detectors/nominalization.js.map +1 -1
- package/dist/detectors/number-style.d.ts +2 -0
- package/dist/detectors/number-style.d.ts.map +1 -1
- package/dist/detectors/number-style.js +5 -0
- package/dist/detectors/number-style.js.map +1 -1
- package/dist/detectors/ordinal-suffix.js +2 -2
- package/dist/detectors/ordinal-suffix.js.map +1 -1
- package/dist/detectors/ordinary-phrase.d.ts +5 -0
- package/dist/detectors/ordinary-phrase.d.ts.map +1 -1
- package/dist/detectors/ordinary-phrase.js +12 -0
- package/dist/detectors/ordinary-phrase.js.map +1 -1
- package/dist/detectors/organisation-run.d.ts +2 -0
- package/dist/detectors/organisation-run.d.ts.map +1 -1
- package/dist/detectors/organisation-run.js +7 -0
- package/dist/detectors/organisation-run.js.map +1 -1
- package/dist/detectors/orthographic-variant-kanji-word.d.ts +22 -0
- package/dist/detectors/orthographic-variant-kanji-word.d.ts.map +1 -0
- package/dist/detectors/orthographic-variant-kanji-word.js +27 -0
- package/dist/detectors/orthographic-variant-kanji-word.js.map +1 -0
- package/dist/detectors/orthographic-variant-open.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant-open.js +2 -1
- package/dist/detectors/orthographic-variant-open.js.map +1 -1
- package/dist/detectors/orthographic-variant-text.d.ts +7 -0
- package/dist/detectors/orthographic-variant-text.d.ts.map +1 -0
- package/dist/detectors/orthographic-variant-text.js +14 -0
- package/dist/detectors/orthographic-variant-text.js.map +1 -0
- package/dist/detectors/orthographic-variant.d.ts.map +1 -1
- package/dist/detectors/orthographic-variant.js +46 -23
- package/dist/detectors/orthographic-variant.js.map +1 -1
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +24 -8
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/oxford-comma.d.ts.map +1 -1
- package/dist/detectors/oxford-comma.js +28 -3
- package/dist/detectors/oxford-comma.js.map +1 -1
- package/dist/detectors/paragraph-run.d.ts +1 -1
- package/dist/detectors/paragraph-run.d.ts.map +1 -1
- package/dist/detectors/paragraph-run.js +6 -4
- package/dist/detectors/paragraph-run.js.map +1 -1
- package/dist/detectors/phone-number-variant.d.ts.map +1 -1
- package/dist/detectors/phone-number-variant.js +2 -1
- package/dist/detectors/phone-number-variant.js.map +1 -1
- package/dist/detectors/phrase-context.d.ts +6 -0
- package/dist/detectors/phrase-context.d.ts.map +1 -0
- package/dist/detectors/phrase-context.js +12 -0
- package/dist/detectors/phrase-context.js.map +1 -0
- package/dist/detectors/phrase-match-all.d.ts +3 -0
- package/dist/detectors/phrase-match-all.d.ts.map +1 -0
- package/dist/detectors/phrase-match-all.js +47 -0
- package/dist/detectors/phrase-match-all.js.map +1 -0
- package/dist/detectors/phrase-match.d.ts +2 -1
- package/dist/detectors/phrase-match.d.ts.map +1 -1
- package/dist/detectors/phrase-match.js +25 -6
- package/dist/detectors/phrase-match.js.map +1 -1
- package/dist/detectors/placeholder-text.d.ts.map +1 -1
- package/dist/detectors/placeholder-text.js +22 -2
- package/dist/detectors/placeholder-text.js.map +1 -1
- package/dist/detectors/placeholder.d.ts +1 -0
- package/dist/detectors/placeholder.d.ts.map +1 -1
- package/dist/detectors/placeholder.js +8 -0
- package/dist/detectors/placeholder.js.map +1 -1
- package/dist/detectors/proper-noun-density.d.ts.map +1 -1
- package/dist/detectors/proper-noun-density.js +10 -6
- package/dist/detectors/proper-noun-density.js.map +1 -1
- package/dist/detectors/pseudo-heading.d.ts +9 -0
- package/dist/detectors/pseudo-heading.d.ts.map +1 -0
- package/dist/detectors/pseudo-heading.js +54 -0
- package/dist/detectors/pseudo-heading.js.map +1 -0
- package/dist/detectors/quote-around.d.ts +4 -1
- package/dist/detectors/quote-around.d.ts.map +1 -1
- package/dist/detectors/quote-around.js +28 -5
- package/dist/detectors/quote-around.js.map +1 -1
- package/dist/detectors/quoted-label.d.ts +8 -0
- package/dist/detectors/quoted-label.d.ts.map +1 -0
- package/dist/detectors/quoted-label.js +18 -0
- package/dist/detectors/quoted-label.js.map +1 -0
- package/dist/detectors/ra-nuki.d.ts +1 -7
- package/dist/detectors/ra-nuki.d.ts.map +1 -1
- package/dist/detectors/ra-nuki.js +2 -27
- package/dist/detectors/ra-nuki.js.map +1 -1
- package/dist/detectors/range-notation.js +2 -2
- package/dist/detectors/range-notation.js.map +1 -1
- package/dist/detectors/register-required.d.ts +27 -0
- package/dist/detectors/register-required.d.ts.map +1 -0
- package/dist/detectors/register-required.js +33 -0
- package/dist/detectors/register-required.js.map +1 -0
- package/dist/detectors/register-voice.d.ts +13 -1
- package/dist/detectors/register-voice.d.ts.map +1 -1
- package/dist/detectors/register-voice.js +27 -0
- package/dist/detectors/register-voice.js.map +1 -1
- package/dist/detectors/registry/enumeration-marker.d.ts +3 -0
- package/dist/detectors/registry/enumeration-marker.d.ts.map +1 -0
- package/dist/detectors/registry/enumeration-marker.js +3 -0
- package/dist/detectors/registry/enumeration-marker.js.map +1 -0
- package/dist/detectors/registry/filler-word.d.ts +3 -0
- package/dist/detectors/registry/filler-word.d.ts.map +1 -0
- package/dist/detectors/registry/filler-word.js +3 -0
- package/dist/detectors/registry/filler-word.js.map +1 -0
- package/dist/detectors/registry/heading-marker-no-space.d.ts +3 -0
- package/dist/detectors/registry/heading-marker-no-space.d.ts.map +1 -0
- package/dist/detectors/registry/heading-marker-no-space.js +3 -0
- package/dist/detectors/registry/heading-marker-no-space.js.map +1 -0
- package/dist/detectors/registry/link-definition-unused.d.ts +3 -0
- package/dist/detectors/registry/link-definition-unused.d.ts.map +1 -0
- package/dist/detectors/registry/link-definition-unused.js +3 -0
- package/dist/detectors/registry/link-definition-unused.js.map +1 -0
- package/dist/detectors/registry/phrase-match-all.d.ts +3 -0
- package/dist/detectors/registry/phrase-match-all.d.ts.map +1 -0
- package/dist/detectors/registry/phrase-match-all.js +3 -0
- package/dist/detectors/registry/phrase-match-all.js.map +1 -0
- package/dist/detectors/registry/pseudo-heading.d.ts +3 -0
- package/dist/detectors/registry/pseudo-heading.d.ts.map +1 -0
- package/dist/detectors/registry/pseudo-heading.js +3 -0
- package/dist/detectors/registry/pseudo-heading.js.map +1 -0
- package/dist/detectors/registry/reversed-link.d.ts +3 -0
- package/dist/detectors/registry/reversed-link.d.ts.map +1 -0
- package/dist/detectors/registry/reversed-link.js +3 -0
- package/dist/detectors/registry/reversed-link.js.map +1 -0
- package/dist/detectors/registry/sa-ire.d.ts +3 -0
- package/dist/detectors/registry/sa-ire.d.ts.map +1 -0
- package/dist/detectors/registry/sa-ire.js +3 -0
- package/dist/detectors/registry/sa-ire.js.map +1 -0
- package/dist/detectors/registry/table-absorbed-line.d.ts +3 -0
- package/dist/detectors/registry/table-absorbed-line.d.ts.map +1 -0
- package/dist/detectors/registry/table-absorbed-line.js +3 -0
- package/dist/detectors/registry/table-absorbed-line.js.map +1 -0
- package/dist/detectors/registry/term-consistency.d.ts +3 -0
- package/dist/detectors/registry/term-consistency.d.ts.map +1 -0
- package/dist/detectors/registry/term-consistency.js +3 -0
- package/dist/detectors/registry/term-consistency.js.map +1 -0
- package/dist/detectors/registry/term-form.d.ts +3 -0
- package/dist/detectors/registry/term-form.d.ts.map +1 -0
- package/dist/detectors/registry/term-form.js +3 -0
- package/dist/detectors/registry/term-form.js.map +1 -0
- package/dist/detectors/relative-pronoun-mix.d.ts +1 -1
- package/dist/detectors/relative-pronoun-mix.d.ts.map +1 -1
- package/dist/detectors/relative-pronoun-mix.js +14 -3
- package/dist/detectors/relative-pronoun-mix.js.map +1 -1
- package/dist/detectors/release-notes.d.ts +7 -0
- package/dist/detectors/release-notes.d.ts.map +1 -0
- package/dist/detectors/release-notes.js +12 -0
- package/dist/detectors/release-notes.js.map +1 -0
- package/dist/detectors/request-owner.d.ts +5 -1
- package/dist/detectors/request-owner.d.ts.map +1 -1
- package/dist/detectors/request-owner.js +53 -1
- package/dist/detectors/request-owner.js.map +1 -1
- package/dist/detectors/requirement-lists.d.ts.map +1 -1
- package/dist/detectors/requirement-lists.js +2 -0
- package/dist/detectors/requirement-lists.js.map +1 -1
- package/dist/detectors/reversed-link.d.ts +3 -0
- package/dist/detectors/reversed-link.d.ts.map +1 -0
- package/dist/detectors/reversed-link.js +31 -0
- package/dist/detectors/reversed-link.js.map +1 -0
- package/dist/detectors/sa-ire.d.ts +3 -0
- package/dist/detectors/sa-ire.d.ts.map +1 -0
- package/dist/detectors/sa-ire.js +5 -0
- package/dist/detectors/sa-ire.js.map +1 -0
- package/dist/detectors/sentence-counts.d.ts.map +1 -1
- package/dist/detectors/sentence-counts.js +24 -9
- package/dist/detectors/sentence-counts.js.map +1 -1
- package/dist/detectors/sentence-ending.d.ts.map +1 -1
- package/dist/detectors/sentence-ending.js +35 -11
- 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 +20 -3
- package/dist/detectors/sentence-length.js.map +1 -1
- package/dist/detectors/sentence-rhythm.d.ts.map +1 -1
- package/dist/detectors/sentence-rhythm.js +6 -2
- package/dist/detectors/sentence-rhythm.js.map +1 -1
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +8 -3
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/structure.d.ts +1 -0
- package/dist/detectors/structure.d.ts.map +1 -1
- package/dist/detectors/structure.js +5 -0
- package/dist/detectors/structure.js.map +1 -1
- package/dist/detectors/team.d.ts.map +1 -1
- package/dist/detectors/team.js +42 -9
- package/dist/detectors/team.js.map +1 -1
- package/dist/detectors/technical-docs.d.ts +8 -1
- package/dist/detectors/technical-docs.d.ts.map +1 -1
- package/dist/detectors/technical-docs.js +16 -3
- package/dist/detectors/technical-docs.js.map +1 -1
- package/dist/detectors/term-consistency.d.ts +4 -0
- package/dist/detectors/term-consistency.d.ts.map +1 -0
- package/dist/detectors/term-consistency.js +35 -0
- package/dist/detectors/term-consistency.js.map +1 -0
- package/dist/detectors/term-form.d.ts +4 -0
- package/dist/detectors/term-form.d.ts.map +1 -0
- package/dist/detectors/term-form.js +17 -0
- package/dist/detectors/term-form.js.map +1 -0
- package/dist/detectors/token-shape.d.ts.map +1 -1
- package/dist/detectors/token-shape.js +4 -1
- package/dist/detectors/token-shape.js.map +1 -1
- package/dist/detectors/unbalanced-bracket.d.ts +1 -1
- package/dist/detectors/unbalanced-bracket.d.ts.map +1 -1
- package/dist/detectors/unbalanced-bracket.js +4 -2
- package/dist/detectors/unbalanced-bracket.js.map +1 -1
- package/dist/detectors/unit-spacing.js +2 -2
- package/dist/detectors/unit-spacing.js.map +1 -1
- package/dist/detectors/unknown-word-context.d.ts +2 -0
- package/dist/detectors/unknown-word-context.d.ts.map +1 -1
- package/dist/detectors/unknown-word-context.js +3 -0
- package/dist/detectors/unknown-word-context.js.map +1 -1
- package/dist/detectors/unknown-word.d.ts.map +1 -1
- package/dist/detectors/unknown-word.js +7 -2
- package/dist/detectors/unknown-word.js.map +1 -1
- package/dist/detectors/vague-deadline.d.ts.map +1 -1
- package/dist/detectors/vague-deadline.js +2 -1
- package/dist/detectors/vague-deadline.js.map +1 -1
- package/dist/detectors/vague-density.d.ts.map +1 -1
- package/dist/detectors/vague-density.js +10 -2
- package/dist/detectors/vague-density.js.map +1 -1
- package/dist/detectors/version-mismatch.d.ts.map +1 -1
- package/dist/detectors/version-mismatch.js +5 -1
- package/dist/detectors/version-mismatch.js.map +1 -1
- package/dist/detectors/weasel-word.d.ts.map +1 -1
- package/dist/detectors/weasel-word.js +11 -2
- package/dist/detectors/weasel-word.js.map +1 -1
- package/dist/document-prose.d.ts +17 -0
- package/dist/document-prose.d.ts.map +1 -0
- package/dist/document-prose.js +35 -0
- package/dist/document-prose.js.map +1 -0
- package/dist/document-scope.d.ts +16 -0
- package/dist/document-scope.d.ts.map +1 -0
- package/dist/document-scope.js +51 -0
- package/dist/document-scope.js.map +1 -0
- package/dist/document.d.ts +10 -1
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +26 -37
- package/dist/document.js.map +1 -1
- package/dist/enumeration-marks.d.ts +23 -0
- package/dist/enumeration-marks.d.ts.map +1 -0
- package/dist/enumeration-marks.js +184 -0
- package/dist/enumeration-marks.js.map +1 -0
- package/dist/facts/cross-facts.d.ts +1 -1
- package/dist/facts/cross-facts.d.ts.map +1 -1
- package/dist/facts/cross-facts.js +8 -3
- package/dist/facts/cross-facts.js.map +1 -1
- package/dist/facts/labelled-facts.d.ts.map +1 -1
- package/dist/facts/labelled-facts.js +7 -4
- package/dist/facts/labelled-facts.js.map +1 -1
- package/dist/file-header.d.ts +2 -6
- package/dist/file-header.d.ts.map +1 -1
- package/dist/file-header.js +1 -1
- package/dist/file-header.js.map +1 -1
- package/dist/files.d.ts +18 -1
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +58 -8
- package/dist/files.js.map +1 -1
- package/dist/gitignore.d.ts +30 -0
- package/dist/gitignore.d.ts.map +1 -0
- package/dist/gitignore.js +68 -0
- package/dist/gitignore.js.map +1 -0
- package/dist/grade/stamp.d.ts.map +1 -1
- package/dist/grade/stamp.js +5 -0
- package/dist/grade/stamp.js.map +1 -1
- package/dist/latin-word-boundary.d.ts +5 -0
- package/dist/latin-word-boundary.d.ts.map +1 -1
- package/dist/latin-word-boundary.js +11 -0
- package/dist/latin-word-boundary.js.map +1 -1
- package/dist/levels.d.ts +14 -0
- package/dist/levels.d.ts.map +1 -1
- package/dist/levels.js +8 -3
- package/dist/levels.js.map +1 -1
- package/dist/markdown-node.d.ts +1 -0
- package/dist/markdown-node.d.ts.map +1 -1
- package/dist/markdown-node.js.map +1 -1
- package/dist/name-separator.d.ts.map +1 -1
- package/dist/name-separator.js +27 -5
- package/dist/name-separator.js.map +1 -1
- package/dist/news-dateline.d.ts +7 -0
- package/dist/news-dateline.d.ts.map +1 -0
- package/dist/news-dateline.js +24 -0
- package/dist/news-dateline.js.map +1 -0
- package/dist/phone-numbers.d.ts +5 -2
- package/dist/phone-numbers.d.ts.map +1 -1
- package/dist/phone-numbers.js +17 -3
- package/dist/phone-numbers.js.map +1 -1
- package/dist/plugin.d.ts +26 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/reasons.d.ts +4 -0
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +4 -0
- package/dist/reasons.js.map +1 -1
- package/dist/render/explain.d.ts +5 -0
- package/dist/render/explain.d.ts.map +1 -1
- package/dist/render/explain.js +57 -15
- package/dist/render/explain.js.map +1 -1
- package/dist/render/options.d.ts.map +1 -1
- package/dist/render/options.js +11 -6
- package/dist/render/options.js.map +1 -1
- package/dist/render/rules-json.d.ts.map +1 -1
- package/dist/render/rules-json.js +12 -2
- package/dist/render/rules-json.js.map +1 -1
- package/dist/render/summary.d.ts +5 -2
- package/dist/render/summary.d.ts.map +1 -1
- package/dist/render/summary.js +25 -4
- package/dist/render/summary.js.map +1 -1
- package/dist/render/suppressions.d.ts +6 -1
- package/dist/render/suppressions.d.ts.map +1 -1
- package/dist/render/suppressions.js +76 -3
- package/dist/render/suppressions.js.map +1 -1
- package/dist/render/text.d.ts.map +1 -1
- package/dist/render/text.js +14 -4
- package/dist/render/text.js.map +1 -1
- package/dist/rule-load.d.ts.map +1 -1
- package/dist/rule-load.js +2 -1
- package/dist/rule-load.js.map +1 -1
- package/dist/run-in-title.d.ts +4 -0
- package/dist/run-in-title.d.ts.map +1 -0
- package/dist/run-in-title.js +82 -0
- package/dist/run-in-title.js.map +1 -0
- package/dist/run.d.ts +5 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +40 -21
- package/dist/run.js.map +1 -1
- package/dist/scope-markers.d.ts +9 -0
- package/dist/scope-markers.d.ts.map +1 -0
- package/dist/scope-markers.js +19 -0
- package/dist/scope-markers.js.map +1 -0
- package/dist/scope-problem-text.d.ts +4 -0
- package/dist/scope-problem-text.d.ts.map +1 -0
- package/dist/scope-problem-text.js +17 -0
- package/dist/scope-problem-text.js.map +1 -0
- package/dist/scoped-sentences.d.ts +21 -0
- package/dist/scoped-sentences.d.ts.map +1 -0
- package/dist/scoped-sentences.js +21 -0
- package/dist/scoped-sentences.js.map +1 -0
- package/dist/setting-problems.d.ts.map +1 -1
- package/dist/setting-problems.js +4 -0
- package/dist/setting-problems.js.map +1 -1
- package/dist/spelling.js +4 -4
- package/dist/spelling.js.map +1 -1
- package/dist/stet-body.d.ts +13 -0
- package/dist/stet-body.d.ts.map +1 -0
- package/dist/stet-body.js +49 -0
- package/dist/stet-body.js.map +1 -0
- package/dist/stet.d.ts +30 -4
- package/dist/stet.d.ts.map +1 -1
- package/dist/stet.js +78 -28
- package/dist/stet.js.map +1 -1
- package/dist/structure/alert-lines.d.ts +4 -0
- package/dist/structure/alert-lines.d.ts.map +1 -0
- package/dist/structure/alert-lines.js +19 -0
- package/dist/structure/alert-lines.js.map +1 -0
- package/dist/structure/catch-all-row-blank.d.ts +9 -0
- package/dist/structure/catch-all-row-blank.d.ts.map +1 -0
- package/dist/structure/catch-all-row-blank.js +19 -0
- package/dist/structure/catch-all-row-blank.js.map +1 -0
- package/dist/structure/change-rate-tied.d.ts +22 -0
- package/dist/structure/change-rate-tied.d.ts.map +1 -0
- package/dist/structure/change-rate-tied.js +85 -0
- package/dist/structure/change-rate-tied.js.map +1 -0
- package/dist/structure/cross-definitions.d.ts +1 -1
- package/dist/structure/cross-definitions.d.ts.map +1 -1
- package/dist/structure/cross-definitions.js +3 -9
- package/dist/structure/cross-definitions.js.map +1 -1
- package/dist/structure/deadline-after-event.d.ts +1 -1
- package/dist/structure/deadline-after-event.d.ts.map +1 -1
- package/dist/structure/deadline-after-event.js +36 -9
- package/dist/structure/deadline-after-event.js.map +1 -1
- package/dist/structure/defining-names.d.ts +1 -1
- package/dist/structure/defining-names.d.ts.map +1 -1
- package/dist/structure/defining-names.js +12 -1
- package/dist/structure/defining-names.js.map +1 -1
- package/dist/structure/definition-use.d.ts +10 -1
- package/dist/structure/definition-use.d.ts.map +1 -1
- package/dist/structure/definition-use.js +4 -4
- package/dist/structure/definition-use.js.map +1 -1
- package/dist/structure/leg-times.d.ts.map +1 -1
- package/dist/structure/leg-times.js +10 -2
- package/dist/structure/leg-times.js.map +1 -1
- package/dist/structure/net-amount.d.ts +16 -0
- package/dist/structure/net-amount.d.ts.map +1 -1
- package/dist/structure/net-amount.js +28 -1
- package/dist/structure/net-amount.js.map +1 -1
- package/dist/structure/period-label-conflict.d.ts +2 -2
- package/dist/structure/period-label-conflict.d.ts.map +1 -1
- package/dist/structure/period-label-conflict.js +17 -3
- package/dist/structure/period-label-conflict.js.map +1 -1
- package/dist/structure/requirement-lists.d.ts +3 -0
- package/dist/structure/requirement-lists.d.ts.map +1 -1
- package/dist/structure/requirement-lists.js +8 -2
- package/dist/structure/requirement-lists.js.map +1 -1
- package/dist/structure/serial-range.d.ts.map +1 -1
- package/dist/structure/serial-range.js +14 -6
- package/dist/structure/serial-range.js.map +1 -1
- package/dist/structure/time-marks.d.ts +10 -0
- package/dist/structure/time-marks.d.ts.map +1 -1
- package/dist/structure/time-marks.js +21 -0
- package/dist/structure/time-marks.js.map +1 -1
- package/dist/structure/version-mismatch.d.ts +6 -1
- package/dist/structure/version-mismatch.d.ts.map +1 -1
- package/dist/structure/version-mismatch.js +28 -6
- package/dist/structure/version-mismatch.js.map +1 -1
- package/dist/structure/weekday.d.ts.map +1 -1
- package/dist/structure/weekday.js +14 -1
- package/dist/structure/weekday.js.map +1 -1
- package/dist/table-cells.d.ts +1 -1
- package/dist/table-cells.d.ts.map +1 -1
- package/dist/table-cells.js.map +1 -1
- package/dist/term-form.d.ts +15 -0
- package/dist/term-form.d.ts.map +1 -0
- package/dist/term-form.js +72 -0
- package/dist/term-form.js.map +1 -0
- package/dist/term-groups.d.ts +33 -0
- package/dist/term-groups.d.ts.map +1 -0
- package/dist/term-groups.js +46 -0
- package/dist/term-groups.js.map +1 -0
- package/dist/text-scope.d.ts +35 -0
- package/dist/text-scope.d.ts.map +1 -0
- package/dist/text-scope.js +55 -0
- package/dist/text-scope.js.map +1 -0
- package/dist/topic-clause.d.ts.map +1 -1
- package/dist/topic-clause.js +85 -16
- package/dist/topic-clause.js.map +1 -1
- package/dist/unclosed-code-quote.d.ts +7 -0
- package/dist/unclosed-code-quote.d.ts.map +1 -0
- package/dist/unclosed-code-quote.js +37 -0
- package/dist/unclosed-code-quote.js.map +1 -0
- package/package.json +4 -3
- package/rules/abstract-length.yaml +1 -1
- package/rules/adverb-overuse.yaml +3 -3
- package/rules/agentless-passive.yaml +3 -3
- package/rules/agreement-slip.yaml +5 -4
- package/rules/ai-generated-composite.yaml +3 -3
- package/rules/ai-structure.yaml +1 -1
- package/rules/all-caps-shouting.yaml +1 -1
- package/rules/announced-count-mismatch.yaml +2 -2
- package/rules/announcing-opener.yaml +1 -1
- package/rules/arrival-before-departure.yaml +1 -1
- package/rules/article-sound.yaml +1 -1
- package/rules/baito-keigo.yaml +1 -1
- package/rules/bold-density.yaml +3 -3
- package/rules/bold-emphasis.yaml +1 -1
- package/rules/bold-label-list.yaml +3 -3
- package/rules/bracket-width-consistency.yaml +3 -3
- package/rules/broken-link.yaml +2 -2
- package/rules/change-rate-mismatch.yaml +2 -2
- package/rules/chat-citation-residue.yaml +1 -1
- package/rules/citation-style-mix.yaml +1 -1
- package/rules/clause-chain.yaml +1 -1
- package/rules/cliche.yaml +4 -4
- package/rules/closing-cliche.yaml +1 -1
- package/rules/closing-exhortation.yaml +1 -1
- package/rules/code-fence-language-mix.yaml +2 -2
- package/rules/cold-open.yaml +1 -1
- package/rules/colloquial-opener.yaml +1 -1
- package/rules/comparative-without-baseline.yaml +2 -2
- package/rules/concrete-evidence-density.yaml +1 -1
- package/rules/contraction-consistency.yaml +4 -4
- package/rules/cross-doc-duplicate-definition.yaml +2 -2
- package/rules/cross-doc-fact-conflict.yaml +2 -2
- package/rules/cross-doc-term-variant.yaml +6 -6
- package/rules/cushion-phrase-density.yaml +1 -1
- package/rules/date-format-consistency.yaml +2 -2
- package/rules/date-weekday-mismatch.yaml +2 -2
- package/rules/date-without-year.yaml +2 -2
- package/rules/deadline-after-event.yaml +2 -2
- package/rules/defined-term-form.yaml +2 -2
- package/rules/demonstrative-opener-run.yaml +1 -1
- package/rules/double-keigo.yaml +1 -1
- package/rules/double-negative.yaml +11 -2
- package/rules/doubled-nado.yaml +1 -1
- package/rules/elapsed-years-mismatch.yaml +2 -2
- package/rules/email-stock-courtesy.yaml +1 -1
- package/rules/email-subject-length.yaml +1 -1
- package/rules/emoji-heading.yaml +1 -1
- package/rules/empty-intensifier.yaml +1 -1
- package/rules/empty-section.yaml +2 -2
- package/rules/empty-table-cell.yaml +2 -2
- package/rules/enumeration-marker-mix.yaml +102 -0
- package/rules/excessive-hedging.yaml +1 -1
- package/rules/exclamation-width-consistency.yaml +1 -1
- package/rules/expletive-construction.yaml +3 -3
- package/rules/figurative-density.yaml +3 -3
- package/rules/filler-word.yaml +74 -0
- package/rules/fullwidth-alnum-consistency.yaml +2 -2
- package/rules/heading-marker-no-space.yaml +79 -0
- package/rules/hiragana-fukushi.yaml +1 -1
- package/rules/homophone-slip.yaml +3 -3
- package/rules/honesty-marker.yaml +1 -1
- package/rules/humble-for-others.yaml +1 -1
- package/rules/hyphen-as-dash.yaml +3 -3
- package/rules/idiom-misuse.yaml +1 -1
- package/rules/internal-jargon.yaml +1 -1
- package/rules/kana-function-word.yaml +1 -1
- package/rules/katakana-long-vowel.yaml +1 -1
- package/rules/known-misspelling.yaml +2 -2
- package/rules/kutoten-consistency.yaml +7 -3
- package/rules/latin-abbreviation-form.yaml +1 -1
- package/rules/latin-spacing.yaml +5 -5
- package/rules/link-definition-unused.yaml +107 -0
- package/rules/list-item-form-mix.yaml +2 -2
- package/rules/max-kanji-continuous.yaml +5 -2
- package/rules/max-paragraph-length.yaml +1 -1
- package/rules/max-sentence-length.yaml +3 -3
- package/rules/max-ten.yaml +1 -1
- package/rules/misconversion.yaml +2 -2
- package/rules/missing-final-period.yaml +2 -2
- package/rules/name-variant.yaml +2 -2
- package/rules/net-amount-mismatch.yaml +5 -5
- package/rules/ngram-repetition.yaml +3 -3
- package/rules/no-doubled-joshi.yaml +2 -2
- package/rules/no-em-dash.yaml +3 -3
- package/rules/no-mixed-desumasu.yaml +63 -3
- package/rules/no-nakaguro-parallel.yaml +3 -3
- package/rules/nominalization.yaml +3 -3
- package/rules/nonstandard-word.yaml +2 -2
- package/rules/number-style-consistency.yaml +2 -2
- package/rules/numbered-generic-heading.yaml +1 -1
- package/rules/numbering-gap.yaml +2 -2
- package/rules/obligation-without-deadline.yaml +2 -2
- package/rules/one-sentence-paragraph-run.yaml +3 -3
- package/rules/orthographic-variant.yaml +2 -2
- package/rules/over-general-claim.yaml +1 -1
- package/rules/oxford-comma-consistency.yaml +4 -3
- package/rules/padded-intro.yaml +1 -1
- package/rules/period-label-conflict.yaml +2 -2
- package/rules/phone-number-variant.yaml +1 -1
- package/rules/preamble-length.yaml +3 -3
- package/rules/preferred-term.yaml +1 -1
- package/rules/proper-noun-density.yaml +1 -1
- package/rules/pseudo-heading.yaml +79 -0
- package/rules/q-fragment-answer.yaml +1 -1
- package/rules/quote-style-consistency.yaml +1 -1
- package/rules/quote-without-source.yaml +2 -2
- package/rules/redundant-expression.yaml +1 -1
- package/rules/repeated-conjunction.yaml +1 -1
- package/rules/repeated-sentence-ending.yaml +3 -3
- package/rules/repeated-sentence-head.yaml +5 -5
- package/rules/request-without-deadline.yaml +2 -2
- package/rules/required-listed-as-preferred.yaml +2 -2
- package/rules/required-sections.yaml +1 -1
- package/rules/reversed-link.yaml +78 -0
- package/rules/sa-ire.yaml +43 -0
- package/rules/sasete-itadaku.yaml +1 -1
- package/rules/sentence-initial-conjunction-run.yaml +1 -1
- package/rules/sentence-initial-so.yaml +1 -1
- package/rules/sentence-rhythm.yaml +2 -2
- package/rules/sentence-spacing-consistency.yaml +1 -1
- package/rules/serial-range-reversed.yaml +4 -4
- package/rules/shell-prompt-mix.yaml +3 -3
- package/rules/stock-transition.yaml +1 -1
- package/rules/stray-space.yaml +1 -1
- package/rules/table-absorbed-line.yaml +88 -0
- package/rules/taigen-dome-in-prose.yaml +1 -1
- package/rules/teki-overuse.yaml +3 -3
- package/rules/term-consistency.yaml +56 -0
- package/rules/term-form.yaml +56 -0
- package/rules/title-case-consistency.yaml +5 -5
- package/rules/title-length.yaml +3 -3
- package/rules/topic-predicate-distance.yaml +3 -3
- package/rules/translationese-density.yaml +1 -1
- package/rules/unbalanced-bracket.yaml +2 -2
- package/rules/uncomparable-graded.yaml +1 -1
- package/rules/undefined-acronym.yaml +5 -3
- package/rules/undefined-term.yaml +2 -2
- package/rules/unfilled-placeholder.yaml +4 -4
- package/rules/unknown-word.yaml +2 -2
- package/rules/unqualified-superlative.yaml +1 -1
- package/rules/use-before-definition.yaml +2 -2
- package/rules/vague-word-density.yaml +3 -3
- package/rules/version-mismatch.yaml +2 -2
- package/rules/weasel-word.yaml +4 -4
- package/rules/which-that-consistency.yaml +3 -3
- package/rules/wordy-phrase.yaml +1 -1
- package/skills/chaff/SKILL.md +51 -7
- package/src/allow.ts +146 -0
- package/src/announced-count.ts +22 -1
- package/src/announced-list.ts +7 -1
- package/src/check-source.ts +33 -9
- package/src/cli-text.ts +13 -4
- package/src/cli.ts +20 -17
- package/src/commands/eval.ts +1 -1
- package/src/commands/suppressions.ts +3 -3
- package/src/commands/test.ts +1 -1
- package/src/composite-signals.ts +10 -1
- package/src/compound-head.ts +17 -8
- package/src/config/allow-problems.ts +75 -0
- package/src/config/by-path-problems.ts +29 -3
- package/src/config/by-path-rules.ts +78 -0
- package/src/config/by-path.ts +9 -0
- package/src/config/consistent-problems.ts +36 -0
- package/src/config/load.ts +87 -15
- package/src/config/option-problems.ts +8 -5
- package/src/config/prefer-problems.ts +22 -0
- package/src/config/prefer.ts +52 -0
- package/src/config/term-problems.ts +38 -0
- package/src/config/warnings.ts +9 -2
- package/src/cross-variants.ts +4 -7
- package/src/cross-votes.ts +35 -4
- package/src/custom/parse.ts +16 -3
- package/src/custom/problems.ts +9 -3
- package/src/custom/scope-field.ts +16 -0
- package/src/date-format.ts +43 -8
- package/src/derived/elapsed.ts +17 -2
- package/src/detectors/acronym-context.ts +7 -1
- package/src/detectors/acronym-gloss.ts +59 -11
- package/src/detectors/agentless-passive.ts +49 -5
- package/src/detectors/agreement-slip.ts +11 -3
- package/src/detectors/amount-scale.ts +2 -2
- package/src/detectors/bare-comparative.ts +35 -3
- package/src/detectors/blank-structure.ts +18 -9
- package/src/detectors/bold-label.ts +7 -2
- package/src/detectors/bracket-title-date.ts +36 -0
- package/src/detectors/broken-link.ts +14 -1
- package/src/detectors/capitalised-term.ts +18 -4
- package/src/detectors/change-rate.ts +29 -4
- package/src/detectors/char-shape.ts +13 -17
- package/src/detectors/chat-citation.ts +4 -5
- package/src/detectors/chat-mark-extent.ts +63 -0
- package/src/detectors/clause-shape.ts +8 -4
- package/src/detectors/conjugated-entry.ts +3 -5
- package/src/detectors/contraction-mix.ts +8 -2
- package/src/detectors/contraction-set-apart.ts +22 -2
- package/src/detectors/contrast-frame.ts +37 -2
- package/src/detectors/coordinate-adjective.ts +54 -1
- package/src/detectors/count-per-section.ts +13 -8
- package/src/detectors/counter-edge.ts +20 -0
- package/src/detectors/cross-variant.ts +16 -2
- package/src/detectors/currency-notation.ts +2 -2
- package/src/detectors/custom.ts +6 -4
- package/src/detectors/date-format.ts +1 -1
- package/src/detectors/date-repeated-day.ts +20 -0
- package/src/detectors/date-year.ts +8 -1
- package/src/detectors/defined-term-form.ts +21 -7
- package/src/detectors/definition-use.ts +12 -9
- package/src/detectors/derived-numbers.ts +1 -0
- package/src/detectors/document-shape.ts +4 -1
- package/src/detectors/ellipsis.ts +2 -2
- package/src/detectors/email-letter.ts +7 -3
- package/src/detectors/empty-section.ts +10 -2
- package/src/detectors/en-shape.ts +57 -6
- package/src/detectors/enumeration-marker.ts +14 -0
- package/src/detectors/event-title-item.ts +57 -0
- package/src/detectors/example-baseline.ts +16 -1
- package/src/detectors/filler-word.ts +96 -0
- package/src/detectors/fullwidth-alnum.ts +24 -0
- package/src/detectors/gram-furniture.ts +8 -0
- package/src/detectors/gram-repetition.ts +8 -1
- package/src/detectors/heading-case.ts +18 -4
- package/src/detectors/heading-marker-no-space.ts +62 -0
- package/src/detectors/hyphen-name-suffix.ts +3 -2
- package/src/detectors/inline-item-label.ts +98 -0
- package/src/detectors/kanji-name-edge.ts +11 -0
- package/src/detectors/known-correction.ts +17 -1
- package/src/detectors/kutoten-consistency.ts +37 -6
- package/src/detectors/lexicon-match.ts +17 -3
- package/src/detectors/lexicon.ts +10 -4
- package/src/detectors/link-definition.ts +91 -0
- package/src/detectors/list-item-asides.ts +29 -0
- package/src/detectors/list-item-clause.ts +9 -0
- package/src/detectors/list-item.ts +7 -0
- package/src/detectors/list-items.ts +13 -2
- package/src/detectors/list-opening-conjunction.ts +22 -0
- package/src/detectors/list-parallel.ts +16 -17
- package/src/detectors/list-run.ts +16 -3
- package/src/detectors/list-sentence.ts +2 -0
- package/src/detectors/list-verb-series.ts +24 -0
- package/src/detectors/mark-shape.ts +51 -27
- package/src/detectors/markdown-slip.ts +25 -1
- package/src/detectors/marked-word.ts +40 -0
- package/src/detectors/middle-dot.ts +27 -2
- package/src/detectors/missing-final-period.ts +19 -1
- package/src/detectors/name-variant-two-things.ts +37 -2
- package/src/detectors/net-amount-mismatch.ts +41 -4
- package/src/detectors/nominalization.ts +22 -5
- package/src/detectors/number-style.ts +8 -0
- package/src/detectors/ordinal-suffix.ts +2 -2
- package/src/detectors/ordinary-phrase.ts +13 -0
- package/src/detectors/organisation-run.ts +9 -0
- package/src/detectors/orthographic-variant-kanji-word.ts +33 -0
- package/src/detectors/orthographic-variant-open.ts +2 -1
- package/src/detectors/orthographic-variant-text.ts +20 -0
- package/src/detectors/orthographic-variant.ts +61 -32
- package/src/detectors/orthography.ts +36 -10
- package/src/detectors/oxford-comma.ts +28 -2
- package/src/detectors/paragraph-run.ts +9 -12
- package/src/detectors/phone-number-variant.ts +2 -1
- package/src/detectors/phrase-context.ts +19 -0
- package/src/detectors/phrase-match-all.ts +57 -0
- package/src/detectors/phrase-match.ts +31 -6
- package/src/detectors/placeholder-text.ts +36 -3
- package/src/detectors/placeholder.ts +10 -0
- package/src/detectors/proper-noun-density.ts +14 -6
- package/src/detectors/pseudo-heading.ts +59 -0
- package/src/detectors/quote-around.ts +37 -6
- package/src/detectors/quoted-label.ts +22 -0
- package/src/detectors/ra-nuki.ts +3 -34
- package/src/detectors/range-notation.ts +2 -2
- package/src/detectors/register-required.ts +56 -0
- package/src/detectors/register-voice.ts +36 -1
- package/src/detectors/registry/enumeration-marker.ts +4 -0
- package/src/detectors/registry/filler-word.ts +4 -0
- package/src/detectors/registry/heading-marker-no-space.ts +4 -0
- package/src/detectors/registry/link-definition-unused.ts +4 -0
- package/src/detectors/registry/phrase-match-all.ts +4 -0
- package/src/detectors/registry/pseudo-heading.ts +4 -0
- package/src/detectors/registry/reversed-link.ts +4 -0
- package/src/detectors/registry/sa-ire.ts +4 -0
- package/src/detectors/registry/table-absorbed-line.ts +4 -0
- package/src/detectors/registry/term-consistency.ts +4 -0
- package/src/detectors/registry/term-form.ts +4 -0
- package/src/detectors/relative-pronoun-mix.ts +18 -3
- package/src/detectors/release-notes.ts +19 -0
- package/src/detectors/request-owner.ts +62 -2
- package/src/detectors/requirement-lists.ts +2 -0
- package/src/detectors/reversed-link.ts +39 -0
- package/src/detectors/sa-ire.ts +7 -0
- package/src/detectors/sentence-counts.ts +35 -13
- package/src/detectors/sentence-ending.ts +53 -12
- package/src/detectors/sentence-length.ts +28 -4
- package/src/detectors/sentence-rhythm.ts +6 -2
- package/src/detectors/signals.ts +12 -3
- package/src/detectors/structure.ts +4 -0
- package/src/detectors/team.ts +50 -12
- package/src/detectors/technical-docs.ts +27 -3
- package/src/detectors/term-consistency.ts +41 -0
- package/src/detectors/term-form.ts +17 -0
- package/src/detectors/token-shape.ts +4 -1
- package/src/detectors/unbalanced-bracket.ts +4 -2
- package/src/detectors/unit-spacing.ts +2 -2
- package/src/detectors/unknown-word-context.ts +6 -0
- package/src/detectors/unknown-word.ts +7 -1
- package/src/detectors/vague-deadline.ts +2 -1
- package/src/detectors/vague-density.ts +10 -2
- package/src/detectors/version-mismatch.ts +7 -1
- package/src/detectors/weasel-word.ts +13 -2
- package/src/document-prose.ts +43 -0
- package/src/document-scope.ts +66 -0
- package/src/document.ts +43 -50
- package/src/enumeration-marks.ts +233 -0
- package/src/facts/cross-facts.ts +10 -4
- package/src/facts/labelled-facts.ts +7 -4
- package/src/file-header.ts +3 -5
- package/src/files.ts +87 -8
- package/src/gitignore.ts +83 -0
- package/src/grade/stamp.ts +5 -0
- package/src/latin-word-boundary.ts +12 -0
- package/src/levels.ts +9 -3
- package/src/markdown-node.ts +1 -0
- package/src/name-separator.ts +29 -7
- package/src/news-dateline.ts +29 -0
- package/src/phone-numbers.ts +19 -3
- package/src/plugin.ts +23 -3
- package/src/reasons.ts +8 -0
- package/src/render/explain.ts +72 -17
- package/src/render/options.ts +12 -6
- package/src/render/rules-json.ts +16 -2
- package/src/render/summary.ts +33 -4
- package/src/render/suppressions.ts +101 -4
- package/src/render/text.ts +20 -7
- package/src/rule-load.ts +3 -2
- package/src/run-in-title.ts +91 -0
- package/src/run.ts +53 -16
- package/src/scope-markers.ts +25 -0
- package/src/scope-problem-text.ts +21 -0
- package/src/scoped-sentences.ts +41 -0
- package/src/setting-problems.ts +4 -0
- package/src/spelling.ts +4 -4
- package/src/stet-body.ts +74 -0
- package/src/stet.ts +113 -32
- package/src/structure/alert-lines.ts +19 -0
- package/src/structure/catch-all-row-blank.ts +22 -0
- package/src/structure/change-rate-tied.ts +113 -0
- package/src/structure/cross-definitions.ts +6 -9
- package/src/structure/deadline-after-event.ts +49 -10
- package/src/structure/defining-names.ts +14 -1
- package/src/structure/definition-use.ts +15 -5
- package/src/structure/leg-times.ts +16 -1
- package/src/structure/net-amount.ts +44 -5
- package/src/structure/period-label-conflict.ts +22 -7
- package/src/structure/requirement-lists.ts +14 -2
- package/src/structure/serial-range.ts +14 -6
- package/src/structure/time-marks.ts +25 -0
- package/src/structure/version-mismatch.ts +41 -8
- package/src/structure/weekday.ts +14 -1
- package/src/table-cells.ts +2 -2
- package/src/term-form.ts +99 -0
- package/src/term-groups.ts +68 -0
- package/src/text-scope.ts +79 -0
- package/src/topic-clause.ts +96 -17
- package/src/unclosed-code-quote.ts +42 -0
- package/dist/honorific-group.d.ts +0 -8
- package/dist/honorific-group.d.ts.map +0 -1
- package/dist/honorific-group.js +0 -15
- package/dist/honorific-group.js.map +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Span } from "./plugin.ts";
|
|
2
|
+
|
|
3
|
+
// A news dateline at the head of a paragraph ("**AUSTIN, Texas — November 24, 2026** — Tallyroot today announced …"): the
|
|
4
|
+
// place in capitals, a comma, the date, then a dash. It opens the lead of a press release, whose first paragraphs tell the
|
|
5
|
+
// whole story before any heading. Pure.
|
|
6
|
+
|
|
7
|
+
/** Emphasis or a bracket a dateline may be set in. */
|
|
8
|
+
const SET_IN = /^[*_[(]+/u;
|
|
9
|
+
|
|
10
|
+
/** The place: a word in capitals (AUSTIN, ST. LOUIS, NEW YORK), then a comma. */
|
|
11
|
+
const PLACE = /^\p{Lu}\p{Lu}[\p{Lu}\s.'’-]*,/u;
|
|
12
|
+
|
|
13
|
+
/** The dash that ends the dateline right after its date, past the emphasis it is set in: an em or en dash, or two hyphens. */
|
|
14
|
+
const DATELINE_END = /^[*_)\]]*\s*(?:—|–|--)\s/u;
|
|
15
|
+
|
|
16
|
+
/** How far into the paragraph the date may end: a place, a state and a date. */
|
|
17
|
+
const DATELINE_REACH = 80;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Whether the paragraph at `paragraph` opens with a dateline: a place in capitals and a comma, then a date (`dates`, as
|
|
21
|
+
* the language read them) within the reach that a dash closes.
|
|
22
|
+
*/
|
|
23
|
+
export const opensWithDateline = (source: string, paragraph: Span, dates: readonly Span[]): boolean => {
|
|
24
|
+
const reach = Math.min(paragraph.end, paragraph.start + DATELINE_REACH);
|
|
25
|
+
const head = source.slice(paragraph.start, reach);
|
|
26
|
+
const marks = SET_IN.exec(head)?.[0].length ?? 0;
|
|
27
|
+
if (!PLACE.test(head.slice(marks))) return false;
|
|
28
|
+
return dates.some((date) => date.start > paragraph.start && date.end <= reach && DATELINE_END.test(source.slice(date.end, paragraph.end)));
|
|
29
|
+
};
|
package/src/phone-numbers.ts
CHANGED
|
@@ -94,13 +94,29 @@ const withoutUnclosedBracket = (written: string): string => written.replace(UNCL
|
|
|
94
94
|
/** URLs covered with spaces, so neither a path segment (/call/) nor an id in one is read. Offsets stay the same. */
|
|
95
95
|
export const withoutUrls = (text: string): string => text.replaceAll(URL, (url) => " ".repeat(url.length));
|
|
96
96
|
|
|
97
|
-
/**
|
|
98
|
-
|
|
97
|
+
/** Link words (at, on, us) written whole right before a number, as one run: "line at ", "us on ". */
|
|
98
|
+
const linkRunOf = (links: readonly string[]): RegExp | undefined =>
|
|
99
|
+
links.length === 0 ? undefined : new RegExp(String.raw`(?:(?<!\p{L})(?:${links.map(escapeRegExp).join("|")})\s+)+$`, "iu");
|
|
100
|
+
|
|
101
|
+
/** Where a number's label is looked for: before the link words that join it to the number (Call us on, our recall line at). */
|
|
102
|
+
const labelEnd = (text: string, offset: number, linkRun: RegExp | undefined): number => {
|
|
103
|
+
if (linkRun === undefined) return offset;
|
|
104
|
+
const lineStart = text.lastIndexOf("\n", offset - 1) + 1;
|
|
105
|
+
const run = linkRun.exec(text.slice(lineStart, offset));
|
|
106
|
+
return run === null ? offset : offset - run[0].length;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* The phone numbers of a text that have a label shortly before them on their line; unlabelled digits and URLs are not read.
|
|
111
|
+
* links are the words that may stand between a label and its number (the language's phone-label-link lexicon).
|
|
112
|
+
*/
|
|
113
|
+
export const labelledPhoneNumbers = (source: string, labels: readonly LexiconEntry[], links: readonly string[] = []): PhoneNumber[] => {
|
|
99
114
|
const text = withoutUrls(source);
|
|
115
|
+
const linkRun = linkRunOf(links);
|
|
100
116
|
const read = (match: RegExpExecArray, spaced: boolean): PhoneNumber[] => {
|
|
101
117
|
const digits = match[0].replaceAll(NOT_DIGIT, "");
|
|
102
118
|
if (digits.length < MIN_DIGITS || digits.length > MAX_DIGITS) return [];
|
|
103
|
-
const label = labelBefore(text, match.index, labels);
|
|
119
|
+
const label = labelBefore(text, labelEnd(text, match.index, linkRun), labels);
|
|
104
120
|
if (label === undefined) return [];
|
|
105
121
|
if (spaced && !COUNTRY_CODE_START.test(match[0]) && !LABEL_TO_NUMBER.test(label.between)) return [];
|
|
106
122
|
const matched = match[0].trim();
|
package/src/plugin.ts
CHANGED
|
@@ -75,10 +75,14 @@ export type LexiconEntry = {
|
|
|
75
75
|
readonly first_year?: number | undefined;
|
|
76
76
|
/** The genres or groups the entry holds in (legal, blog/tech). Without them, every genre. A detector reads them with entriesForGenre. */
|
|
77
77
|
readonly genres?: readonly string[] | undefined;
|
|
78
|
+
/** The parts of the document the entry counts in (prefer's object form). Without it, body text as always. preferred-term honours it. */
|
|
79
|
+
readonly scope?: ScopeSelector | undefined;
|
|
78
80
|
/** The entry counts only in a heading: a title phrase that body text uses plainly. A detector that reads headings honours it. */
|
|
79
81
|
readonly heading_only?: boolean | undefined;
|
|
80
82
|
/** The entry counts only where it opens the sentence (近年、… but not その後、近年の…). phrase-match honours it. */
|
|
81
83
|
readonly opens?: boolean | undefined;
|
|
84
|
+
/** The entry does not count where the next word has one of these parts of speech: "your welcome email" is a welcome email, not "you're welcome". phrase-match honours it when tokens are read. */
|
|
85
|
+
readonly not_before_pos?: readonly string[] | undefined;
|
|
82
86
|
/** pattern を adapter が語に分けたもの。品詞が読めるときだけ core が入れる。語彙表を書く側は書かない。 */
|
|
83
87
|
readonly tokens?: readonly Token[] | undefined;
|
|
84
88
|
};
|
|
@@ -389,8 +393,22 @@ export type ProseDocument = {
|
|
|
389
393
|
readonly dictionary?: (() => ReadonlySet<string>) | undefined;
|
|
390
394
|
/** 表の本体の升と、升ごとに解析した語(位置は source の上)。本文(prose)は表を覆うので、升の語は sentences に入らない。呼んだときに作る。 */
|
|
391
395
|
readonly tableCells?: (() => readonly TableCell[]) | undefined;
|
|
396
|
+
/** Every sentence with the parts it is in: body text, and the headings, table cells and quotations sentences leaves out. Made when called. */
|
|
397
|
+
readonly scopedSentences?: (() => readonly ScopedSentence[]) | undefined;
|
|
392
398
|
};
|
|
393
399
|
|
|
400
|
+
/**
|
|
401
|
+
* The parts of a document a team's rule can be limited to (custom_rules' and prefer's scope). paragraph is body text
|
|
402
|
+
* outside the others. A passage can be in two at once: a list item inside a quotation is list and quote.
|
|
403
|
+
*/
|
|
404
|
+
export type TextScope = "heading" | "list" | "table" | "quote" | "paragraph";
|
|
405
|
+
|
|
406
|
+
/** A scope as chaff.yaml writes it, read: the parts chosen (none: every part), then the parts taken away (~quote). */
|
|
407
|
+
export type ScopeSelector = { readonly include: readonly TextScope[]; readonly exclude: readonly TextScope[] };
|
|
408
|
+
|
|
409
|
+
/** A sentence and the parts of the document it is in. */
|
|
410
|
+
export type ScopedSentence = { readonly sentence: Sentence; readonly scopes: readonly TextScope[] };
|
|
411
|
+
|
|
394
412
|
/** 表の升一つ。text は区切りの | のあいだの字のまま。tokens は升の字を adapter が解析した語で、解析しない adapter では無い。 */
|
|
395
413
|
export type TableCell = Span & { readonly text: string; readonly tokens?: readonly Token[] };
|
|
396
414
|
|
|
@@ -533,6 +551,8 @@ export type RuleDefinition = {
|
|
|
533
551
|
readonly use_for: readonly string[];
|
|
534
552
|
/** Off unless chaff.yaml or its style gives the rule a level: a house style's own rule (a 公用文 spelling), wrong for other documents. */
|
|
535
553
|
readonly opt_in?: true;
|
|
554
|
+
/** The chaff.yaml key that fills the rule's word_list (terms, consistent). With nothing listed there, the rule does not run and says why. */
|
|
555
|
+
readonly team_list?: string;
|
|
536
556
|
readonly severity: Severity;
|
|
537
557
|
/** Options beyond the level (the direction and length for katakana-long-vowel). Most rules have none. */
|
|
538
558
|
readonly options?: Readonly<Record<string, RuleOption>>;
|
|
@@ -557,7 +577,7 @@ export type TokenCondition = {
|
|
|
557
577
|
* module: a detector the team wrote in JavaScript; module as written in chaff.yaml, file where it resolved to.
|
|
558
578
|
*/
|
|
559
579
|
export type CustomSpec =
|
|
560
|
-
| { readonly type: "words"; readonly words: readonly { readonly avoid: string; readonly use: string }[] }
|
|
561
|
-
| { readonly type: "pattern"; readonly pattern: string; readonly flags: string }
|
|
562
|
-
| { readonly type: "tokens"; readonly tokens: readonly TokenCondition[] }
|
|
580
|
+
| { readonly type: "words"; readonly words: readonly { readonly avoid: string; readonly use: string }[]; readonly scope?: ScopeSelector | undefined }
|
|
581
|
+
| { readonly type: "pattern"; readonly pattern: string; readonly flags: string; readonly scope?: ScopeSelector | undefined }
|
|
582
|
+
| { readonly type: "tokens"; readonly tokens: readonly TokenCondition[]; readonly scope?: ScopeSelector | undefined }
|
|
563
583
|
| { readonly type: "module"; readonly module: string; readonly file: string };
|
package/src/reasons.ts
CHANGED
|
@@ -12,6 +12,8 @@ export type Reasons = {
|
|
|
12
12
|
/** A rule of one house style: it runs when chaff.yaml names that style, or gives the rule a level. */
|
|
13
13
|
readonly optIn: string;
|
|
14
14
|
readonly turnedOff: string;
|
|
15
|
+
/** Turned off by one by_path entry, named as by-path-rules.ts names it. */
|
|
16
|
+
readonly turnedOffBy: (source: string) => string;
|
|
15
17
|
readonly presetOff: (genre: string) => string;
|
|
16
18
|
readonly noStructure: (language: string) => string;
|
|
17
19
|
readonly unreadStructure: (clauses: number, units: number) => string;
|
|
@@ -24,6 +26,8 @@ export type Reasons = {
|
|
|
24
26
|
readonly draftMessage: string;
|
|
25
27
|
/** A rule that compares documents, in a run of one: it runs when chaff is given two or more files, or a folder. */
|
|
26
28
|
readonly oneDocument: string;
|
|
29
|
+
/** A rule that checks only what the team lists in chaff.yaml, with nothing listed under its key. */
|
|
30
|
+
readonly noTeamList: (key: string) => string;
|
|
27
31
|
};
|
|
28
32
|
|
|
29
33
|
/** A plugin's word list is named <plugin>/<list> (@scope/foo/list too); a language package's has no slash. */
|
|
@@ -47,6 +51,7 @@ export const REASONS: Texts<Reasons> = {
|
|
|
47
51
|
experimental: "まだ試験中のため",
|
|
48
52
|
optIn: "決まった書き方(chaff.yaml の style)のための rule で、style か rules で動かすため",
|
|
49
53
|
turnedOff: "設定で止めているため",
|
|
54
|
+
turnedOffBy: (source) => `設定の ${source} で止めているため`,
|
|
50
55
|
presetOff: (genre) => `ジャンル ${genre} では見ないため`,
|
|
51
56
|
noStructure: (language) => `${language} のパッケージは文書の構造を読めないため`,
|
|
52
57
|
unreadStructure: (clauses, units) =>
|
|
@@ -61,6 +66,7 @@ export const REASONS: Texts<Reasons> = {
|
|
|
61
66
|
notMarkdown: "Markdown の文書ではないため",
|
|
62
67
|
draftMessage: "送る前の下書き(差出人や日時のヘッダーが無い)で、添付は送るときに付けるため本文からは見えないため",
|
|
63
68
|
oneDocument: "比べるほかの文書が無いため(ファイルを二つ以上かフォルダを渡すと動きます)",
|
|
69
|
+
noTeamList: (key) => `chaff.yaml の ${key} に何も並べていないため(チームが並べたものだけを見ます)`,
|
|
64
70
|
},
|
|
65
71
|
en: {
|
|
66
72
|
otherLanguage: (language) => `not a rule for ${language}`,
|
|
@@ -71,6 +77,7 @@ export const REASONS: Texts<Reasons> = {
|
|
|
71
77
|
experimental: "still experimental",
|
|
72
78
|
optIn: "it belongs to a house style, and runs when chaff.yaml names the style or gives it a level",
|
|
73
79
|
turnedOff: "turned off in the settings",
|
|
80
|
+
turnedOffBy: (source) => `turned off in the settings by ${source}`,
|
|
74
81
|
presetOff: (genre) => `the ${genre} genre does not check it`,
|
|
75
82
|
noStructure: (language) => `the ${language} package cannot read a document's structure`,
|
|
76
83
|
unreadStructure: (clauses, units) =>
|
|
@@ -85,5 +92,6 @@ export const REASONS: Texts<Reasons> = {
|
|
|
85
92
|
notMarkdown: "the document is not Markdown",
|
|
86
93
|
draftMessage: "the text is a draft (no From: or Date: header), and a draft's files are attached when sending, out of the text's sight",
|
|
87
94
|
oneDocument: "it compares documents, and there is only one to compare (it runs when chaff is given two or more files, or a folder)",
|
|
95
|
+
noTeamList: (key) => `nothing is listed under ${key} in chaff.yaml (it checks only what the team lists)`,
|
|
88
96
|
},
|
|
89
97
|
};
|
package/src/render/explain.ts
CHANGED
|
@@ -1,34 +1,46 @@
|
|
|
1
|
-
import { definedLevels, resolve, severityAt } from "../levels.ts";
|
|
1
|
+
import { definedLevels, genreKeyFor, resolve, severityAt } from "../levels.ts";
|
|
2
2
|
import { fill, localized, readableText } from "./text.ts";
|
|
3
3
|
import { SEVERITY_NAME } from "./severity-name.ts";
|
|
4
4
|
import { uiLanguageOf, type Texts } from "../ui.ts";
|
|
5
5
|
import type { Level, RuleDefinition } from "../plugin.ts";
|
|
6
6
|
import { optionLines } from "./options.ts";
|
|
7
7
|
import type { OptionLayer } from "../rule-options.ts";
|
|
8
|
+
import type { PathRuleLevel } from "../config/by-path-rules.ts";
|
|
8
9
|
import { depthMeaning } from "../rewrite-depth.ts";
|
|
10
|
+
import { writtenScope } from "../text-scope.ts";
|
|
9
11
|
|
|
10
12
|
const TEXT: Texts<{
|
|
11
13
|
readonly off: string;
|
|
12
|
-
readonly
|
|
13
|
-
readonly
|
|
14
|
+
readonly numbersFor: (key: string | undefined, genre: string | undefined) => string;
|
|
15
|
+
readonly othersOwn: (others: readonly string[]) => string;
|
|
16
|
+
readonly othersDefault: string;
|
|
17
|
+
readonly sentenceGap: string;
|
|
14
18
|
readonly experimental: string;
|
|
15
19
|
readonly alone: (id: string) => string;
|
|
16
20
|
readonly howToFix: string;
|
|
17
21
|
readonly depth: (depth: string, meaning: string) => string;
|
|
18
22
|
readonly example: string;
|
|
19
23
|
readonly definedIn: (plugin: string | undefined) => string;
|
|
24
|
+
readonly scope: (written: string) => string;
|
|
20
25
|
readonly values: string;
|
|
21
26
|
readonly times: string;
|
|
22
27
|
readonly severities: string;
|
|
23
28
|
readonly now: (level: string) => string;
|
|
24
29
|
readonly nowNumber: (limit: string) => string;
|
|
30
|
+
readonly notRun: (why: string) => string;
|
|
25
31
|
readonly from: (source: string) => string;
|
|
26
32
|
readonly change: (id: string) => string;
|
|
33
|
+
readonly byPath: string;
|
|
27
34
|
}> = {
|
|
28
35
|
ja: {
|
|
29
36
|
off: "見ない",
|
|
30
|
-
|
|
31
|
-
|
|
37
|
+
numbersFor: (key, genre) => {
|
|
38
|
+
const owner = key === undefined ? "既定" : ` ${key} `;
|
|
39
|
+
return genre === undefined || genre === key ? `この数字は${owner}のものです。` : `この数字は${owner}のもので、${genre} はこれを使います。`;
|
|
40
|
+
},
|
|
41
|
+
othersOwn: (others) => `${others.join(" / ")} は別の数字を持っています。`,
|
|
42
|
+
othersDefault: "ほかのジャンルは既定の数字を使います。",
|
|
43
|
+
sentenceGap: "",
|
|
32
44
|
experimental: "このルールはまだ試験中で、既定では動きません(--experimental で動きます)。",
|
|
33
45
|
alone: (id) => `このルールだけを動かす: npx chaffjs enable ${id}(chaff.yaml の rules に ${id}: normal と書くのと同じです)`,
|
|
34
46
|
howToFix: "直しかた",
|
|
@@ -37,18 +49,27 @@ const TEXT: Texts<{
|
|
|
37
49
|
example: "例",
|
|
38
50
|
definedIn: (plugin) =>
|
|
39
51
|
plugin === undefined ? "このルールはチームが chaff.yaml の custom_rules で決めたものです。" : `このルールはプラグイン ${plugin} のものです。`,
|
|
52
|
+
scope: (written) => `読む所: ${written}(chaff.yaml の scope)`,
|
|
40
53
|
values: "設定できる値:",
|
|
41
|
-
times: "回",
|
|
54
|
+
times: "{limit} 回",
|
|
42
55
|
severities: "設定できる値(数える上限は無く、指摘の重さが変わります):",
|
|
43
56
|
now: (level) => `いまは ${level} です。`,
|
|
44
57
|
nowNumber: (limit) => `いまは段階ではなく数です: ${limit}。`,
|
|
58
|
+
notRun: (why) => `いまは動きません(${why})。`,
|
|
45
59
|
from: (source) => `(${source} で決めています)`,
|
|
46
60
|
change: (id) => `変える: npx chaffjs relax ${id} --why "理由"`,
|
|
61
|
+
byPath: "chaff.yaml の by_path で、次のファイルだけ変えています(そのファイルでは上の段階より強く効きます):",
|
|
47
62
|
},
|
|
48
63
|
en: {
|
|
49
64
|
off: "not checked",
|
|
50
|
-
|
|
51
|
-
|
|
65
|
+
numbersFor: (key, genre) => {
|
|
66
|
+
if (key === undefined)
|
|
67
|
+
return genre === undefined ? "These numbers are for the default genre." : `These numbers are the default ones, which ${genre} takes.`;
|
|
68
|
+
return genre === key ? `These numbers are for ${key}.` : `These numbers are for ${key}, which ${genre} takes.`;
|
|
69
|
+
},
|
|
70
|
+
othersOwn: (others) => `${others.join(" / ")} ${others.length === 1 ? "has numbers of its own" : "have numbers of their own"}.`,
|
|
71
|
+
othersDefault: "Other genres take the default numbers.",
|
|
72
|
+
sentenceGap: " ",
|
|
52
73
|
experimental: "This rule is still experimental and does not run by default (--experimental runs it).",
|
|
53
74
|
alone: (id) => `Turn on this rule alone: npx chaffjs enable ${id} (the same as rules: { ${id}: normal } in chaff.yaml)`,
|
|
54
75
|
howToFix: "How to fix",
|
|
@@ -56,13 +77,16 @@ const TEXT: Texts<{
|
|
|
56
77
|
example: "Example",
|
|
57
78
|
definedIn: (plugin) =>
|
|
58
79
|
plugin === undefined ? "The team defined this rule under custom_rules in chaff.yaml." : `This rule comes from the plugin ${plugin}.`,
|
|
80
|
+
scope: (written) => `Reads: ${written} (scope in chaff.yaml)`,
|
|
59
81
|
values: "Levels:",
|
|
60
|
-
times: "times",
|
|
82
|
+
times: "{limit} {limit|time|times}",
|
|
61
83
|
severities: "Levels (there is no limit to count to; a level sets how a finding is marked):",
|
|
62
84
|
now: (level) => `Now: ${level}.`,
|
|
63
85
|
nowNumber: (limit) => `Now: ${limit}, set as a number rather than a level.`,
|
|
86
|
+
notRun: (why) => `Now: not run (${why}).`,
|
|
64
87
|
from: (source) => ` (set by ${source})`,
|
|
65
88
|
change: (id) => `Change it: npx chaffjs relax ${id} --why "reason"`,
|
|
89
|
+
byPath: "by_path in chaff.yaml changes it for these files (there it wins over the level above):",
|
|
66
90
|
},
|
|
67
91
|
};
|
|
68
92
|
|
|
@@ -72,7 +96,7 @@ const TEXT: Texts<{
|
|
|
72
96
|
*/
|
|
73
97
|
const limitText = (rule: RuleDefinition, limit: number, language: string): string => {
|
|
74
98
|
const meaning = localized(rule.guide?.levelMeaning ?? {}, language);
|
|
75
|
-
return meaning === "" ?
|
|
99
|
+
return fill(meaning === "" ? TEXT[uiLanguageOf(language)].times : meaning, { limit });
|
|
76
100
|
};
|
|
77
101
|
|
|
78
102
|
/** What a level holds: the limit a detector counts to, or the severity a rule with nothing to count gives. */
|
|
@@ -90,9 +114,11 @@ const levelLine = (rule: RuleDefinition, level: Level, current: Level | undefine
|
|
|
90
114
|
|
|
91
115
|
/** ジャンルで数字が変わる rule は、それを言わないと「設定したのに効かない」に見える。 */
|
|
92
116
|
const genreNote = (rule: RuleDefinition, genre: string | undefined, text: (typeof TEXT)["ja"]): string[] => {
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
|
|
117
|
+
const key = genreKeyFor(rule, genre);
|
|
118
|
+
const others = Object.keys(rule.by_genre).filter((other) => other !== key);
|
|
119
|
+
if (others.length === 0 && key === undefined) return [];
|
|
120
|
+
const othersLine = others.length === 0 ? text.othersDefault : text.othersOwn(others);
|
|
121
|
+
return ["", ` ${text.numbersFor(key, genre)}${text.sentenceGap}${othersLine}`];
|
|
96
122
|
};
|
|
97
123
|
|
|
98
124
|
/** A team's rule shows its example, before and after, and says where it was defined. */
|
|
@@ -100,7 +126,15 @@ const exampleLines = (rule: RuleDefinition, language: string, text: (typeof TEXT
|
|
|
100
126
|
const examples = rule.guide?.examples ?? {};
|
|
101
127
|
const example = examples[language] ?? examples["en"] ?? Object.values(examples)[0];
|
|
102
128
|
if (rule.custom === undefined || example === undefined) return [];
|
|
103
|
-
|
|
129
|
+
const scope = rule.custom.type === "module" ? undefined : rule.custom.scope;
|
|
130
|
+
return [
|
|
131
|
+
"",
|
|
132
|
+
` ${text.example}: ${example.before}`,
|
|
133
|
+
` → ${example.after}`,
|
|
134
|
+
...(scope === undefined ? [] : ["", ` ${text.scope(writtenScope(scope))}`]),
|
|
135
|
+
"",
|
|
136
|
+
` ${text.definedIn(rule.plugin)}`,
|
|
137
|
+
];
|
|
104
138
|
};
|
|
105
139
|
|
|
106
140
|
/** How deep the rule's rewrite direction reaches, for a rule that has one: what chaff fix-plan --depth compares. */
|
|
@@ -117,6 +151,21 @@ export type ExplainSettings = {
|
|
|
117
151
|
readonly limit?: number | undefined;
|
|
118
152
|
/** The rule is off only because it is experimental, so naming it would run it: say how. */
|
|
119
153
|
readonly offOnlyAsExperimental?: boolean;
|
|
154
|
+
/** Why the genre keeps the rule from running, as a run lists it: then no level is current. */
|
|
155
|
+
readonly genreStop?: string | undefined;
|
|
156
|
+
/** The by_path entries that set this rule for the files they match, in the order written. */
|
|
157
|
+
readonly byPath?: readonly PathRuleLevel[];
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
/** Each by_path entry that sets the rule, with the level or number it sets, so a rule off for one folder is not a surprise. */
|
|
161
|
+
const byPathLines = (byPath: readonly PathRuleLevel[], text: (typeof TEXT)["ja"]): string[] =>
|
|
162
|
+
byPath.length === 0
|
|
163
|
+
? []
|
|
164
|
+
: ["", ` ${text.byPath}`, ...byPath.map((entry) => ` ${entry.files.join(", ")}: ${entry.limit === undefined ? entry.level : String(entry.limit)}`)];
|
|
165
|
+
|
|
166
|
+
const nowLine = (rule: RuleDefinition, current: Level, limit: number | undefined, language: string): string => {
|
|
167
|
+
const text = TEXT[uiLanguageOf(language)];
|
|
168
|
+
return limit === undefined ? text.now(current) : text.nowNumber(limitText(rule, limit, language));
|
|
120
169
|
};
|
|
121
170
|
|
|
122
171
|
/** rule の意図と根拠を読む。指摘に納得できないときの入口。 */
|
|
@@ -124,10 +173,15 @@ export const renderExplain = (rule: RuleDefinition, current: Level, language: st
|
|
|
124
173
|
const { optionLayers = [], levelFrom } = settings;
|
|
125
174
|
// A rule with nothing to count has no number to set; chaff.yaml's number on it is reported as a problem and ignored.
|
|
126
175
|
const limit = rule.level_sets === "severity" ? undefined : settings.limit;
|
|
127
|
-
const
|
|
176
|
+
const { genreStop } = settings;
|
|
177
|
+
const marked = limit === undefined && genreStop === undefined ? current : undefined;
|
|
128
178
|
const text = TEXT[uiLanguageOf(language)];
|
|
129
179
|
const experimental =
|
|
130
|
-
rule.status === "experimental"
|
|
180
|
+
rule.status === "experimental" && genreStop === undefined
|
|
181
|
+
? [` ${text.experimental}`, ...(settings.offOnlyAsExperimental === true ? [` ${text.alone(rule.id)}`] : [])]
|
|
182
|
+
: [];
|
|
183
|
+
const from = levelFrom === undefined ? "" : text.from(levelFrom);
|
|
184
|
+
const now = genreStop === undefined ? `${nowLine(rule, current, limit, language)}${from}` : text.notRun(genreStop);
|
|
131
185
|
return [
|
|
132
186
|
"",
|
|
133
187
|
` ${readableText(rule, rule.name, language)} (${rule.id})`,
|
|
@@ -143,7 +197,8 @@ export const renderExplain = (rule: RuleDefinition, current: Level, language: st
|
|
|
143
197
|
...genreNote(rule, genre, text),
|
|
144
198
|
...optionLines(rule, optionLayers, language),
|
|
145
199
|
"",
|
|
146
|
-
` ${
|
|
200
|
+
` ${now}`,
|
|
201
|
+
...byPathLines(settings.byPath ?? [], text),
|
|
147
202
|
...experimental,
|
|
148
203
|
"",
|
|
149
204
|
` ${text.change(rule.id)}`,
|
package/src/render/options.ts
CHANGED
|
@@ -29,18 +29,23 @@ const TEXT: Texts<{ readonly heading: string; readonly byDefault: string; readon
|
|
|
29
29
|
{
|
|
30
30
|
ja: {
|
|
31
31
|
heading: "オプション(chaff.yaml の options で決めます):",
|
|
32
|
-
byDefault: "
|
|
33
|
-
from: (source) =>
|
|
32
|
+
byDefault: "(既定)",
|
|
33
|
+
from: (source) => `(${source} から)`,
|
|
34
34
|
howTo: (id) => `決める: chaff.yaml に options: { ${id}: { <名前>: <値> } } を書く`,
|
|
35
35
|
},
|
|
36
36
|
en: {
|
|
37
37
|
heading: "Options (set under options in chaff.yaml):",
|
|
38
|
-
byDefault: "default",
|
|
39
|
-
from: (source) => `from ${source}`,
|
|
38
|
+
byDefault: "(default)",
|
|
39
|
+
from: (source) => `(from ${source})`,
|
|
40
40
|
howTo: (id) => `Set one: write options: { ${id}: { <name>: <value> } } in chaff.yaml`,
|
|
41
41
|
},
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
+
/** The narrowest column a choice name is padded to, so short names line up as before. */
|
|
45
|
+
const CHOICE_COLUMN = 11;
|
|
46
|
+
/** The spaces between the longest choice name and its meaning. */
|
|
47
|
+
const CHOICE_GAP = 2;
|
|
48
|
+
|
|
44
49
|
/** A rule's options for explain: each one's value now and where it came from, what it decides, and each choice's meaning. */
|
|
45
50
|
export const optionLines = (rule: RuleDefinition, layers: readonly OptionLayer[], language: string): string[] => {
|
|
46
51
|
if (rule.options === undefined) return [];
|
|
@@ -49,10 +54,11 @@ export const optionLines = (rule: RuleDefinition, layers: readonly OptionLayer[]
|
|
|
49
54
|
const lines = Object.entries(rule.options).flatMap(([name, option]) => {
|
|
50
55
|
const now = settled[name];
|
|
51
56
|
const source = now === undefined || now.from === DEFAULT_SOURCE ? text.byDefault : text.from(now.from);
|
|
57
|
+
const width = Math.max(CHOICE_COLUMN, ...Object.keys(option.choiceNames).map((choice) => choice.length + CHOICE_GAP));
|
|
52
58
|
const choices = Object.entries(option.choiceNames).map(
|
|
53
|
-
([choice, meaning]) => ` ${choice === now?.value ? "→" : " "} ${choice.padEnd(
|
|
59
|
+
([choice, meaning]) => ` ${choice === now?.value ? "→" : " "} ${choice.padEnd(width)}${localized(meaning, language)}`,
|
|
54
60
|
);
|
|
55
|
-
return [` ${name}: ${printed(now?.value ?? option.default)}
|
|
61
|
+
return [` ${name}: ${printed(now?.value ?? option.default)} ${source}`, ` ${localized(option.about, language)}`, ...choices];
|
|
56
62
|
});
|
|
57
63
|
return ["", ` ${text.heading}`, ...lines, "", ` ${text.howTo(rule.id)}`];
|
|
58
64
|
};
|
package/src/render/rules-json.ts
CHANGED
|
@@ -15,6 +15,7 @@ import type { OptionLayer } from "../rule-options.ts";
|
|
|
15
15
|
import { CUSTOM_TYPES } from "../custom/parse.ts";
|
|
16
16
|
import { DEFAULT_DEPTH, REWRITE_DEPTHS, depthMeaning } from "../rewrite-depth.ts";
|
|
17
17
|
import type { ReportedGuide } from "../genre-guide/report.ts";
|
|
18
|
+
import { byPathSource, pathLevelsOf } from "../config/by-path-rules.ts";
|
|
18
19
|
|
|
19
20
|
const TEXT: Texts<{
|
|
20
21
|
readonly offBySetting: string;
|
|
@@ -26,6 +27,7 @@ const TEXT: Texts<{
|
|
|
26
27
|
readonly reason: string;
|
|
27
28
|
readonly byFile: string;
|
|
28
29
|
readonly optionsByFile: string;
|
|
30
|
+
readonly byPathFile: string;
|
|
29
31
|
readonly fromStyleNote: readonly string[];
|
|
30
32
|
}> = {
|
|
31
33
|
ja: {
|
|
@@ -38,11 +40,13 @@ const TEXT: Texts<{
|
|
|
38
40
|
reason: "<理由>",
|
|
39
41
|
byFile: "chaff.yaml の rules に <rule-id>: <level> を足す。既定のままのものは書かない。",
|
|
40
42
|
optionsByFile: "options を持つ rule は、chaff.yaml の options に <rule-id>: { <option>: <value> } を足す。",
|
|
43
|
+
byPathFile:
|
|
44
|
+
"一部のファイルだけ変えるときは、by_path の項目に files と rules(または options)を書く。強さは 既定 < ジャンル < style < rules < by_path の rules で、当たる項目が複数あれば後に書いたものが勝つ。",
|
|
41
45
|
fromStyleNote: [
|
|
42
46
|
"チームの書き方の決まり(例: です・ます、1 文 80 字まで)を一つずつ読む。",
|
|
43
47
|
"決まりごとに、summary と level_meaning が合う rule を選ぶ。数の決まりは levels の数と比べ、合う段階を選ぶか数を直接書く。",
|
|
44
48
|
"文書の種類が分かれば genre を決める。rules[].genres で、そのジャンルで動くか・止まるかを確かめる。",
|
|
45
|
-
"表記の決まりは prefer、社内用語は jargon、必須の見出しは required_sections に書く。",
|
|
49
|
+
"表記の決まりは prefer、決まった書き方の製品名・用語(GitHub)は terms、どちらも正しいが一つの文書でまぜない語の組(顧客/お客様)は consistent、社内用語は jargon、必須の見出しは required_sections に書く。",
|
|
46
50
|
"既定と同じものは書かない。書いたら npx chaffjs explain <rule-id> と、決まりに沿った短い見本で確かめる。",
|
|
47
51
|
],
|
|
48
52
|
},
|
|
@@ -56,11 +60,13 @@ const TEXT: Texts<{
|
|
|
56
60
|
reason: "<reason>",
|
|
57
61
|
byFile: "Add <rule-id>: <level> under rules in chaff.yaml. Leave out anything at its default.",
|
|
58
62
|
optionsByFile: "For a rule with options, add <rule-id>: { <option>: <value> } under options in chaff.yaml.",
|
|
63
|
+
byPathFile:
|
|
64
|
+
"To change a rule for some files only, add files with rules (or options) to a by_path entry. Weakest to strongest: the default, the genre, style, rules, by_path's rules; of several matching entries the later one wins.",
|
|
59
65
|
fromStyleNote: [
|
|
60
66
|
"Read the team's style note one requirement at a time (for example: polite endings, sentences of at most 80 characters).",
|
|
61
67
|
"For each requirement, pick the rule whose summary and level_meaning match. For a number, compare it with the rule's levels and pick a level, or write the number itself.",
|
|
62
68
|
"If the kind of document is known, set genre, and check rules[].genres for whether each rule runs or is off in it.",
|
|
63
|
-
"Put spellings under prefer, in-house words under jargon, and required headings under required_sections.",
|
|
69
|
+
"Put spellings under prefer, names and terms with one fixed form (GitHub) under terms, groups of words that are each right but not to be mixed (log in / sign in) under consistent, in-house words under jargon, and required headings under required_sections.",
|
|
64
70
|
"Leave out anything at its default. Then check each rule with npx chaffjs explain <rule-id> and a short sample that follows the note.",
|
|
65
71
|
],
|
|
66
72
|
},
|
|
@@ -103,6 +109,12 @@ const yourSetting = (rule: RuleDefinition, config: Config, limits: Limits): Reco
|
|
|
103
109
|
return limit === undefined ? { level, from } : { level, limit, from };
|
|
104
110
|
};
|
|
105
111
|
|
|
112
|
+
/** The by_path entries that set this rule for the files they match, in the order written: absent when none does. */
|
|
113
|
+
const byPathOf = (rule: RuleDefinition, config: Config): Record<string, unknown> => {
|
|
114
|
+
const entries = pathLevelsOf(config.byPath, rule.id);
|
|
115
|
+
return entries.length === 0 ? {} : { by_path: entries.map((entry) => ({ ...entry, from: byPathSource(entry) })) };
|
|
116
|
+
};
|
|
117
|
+
|
|
106
118
|
/** The house style chaff.yaml names: what it decides and the guideline it follows, so an AI can say where a setting came from. */
|
|
107
119
|
const styleOf = (config: Config): Record<string, unknown> | null => {
|
|
108
120
|
const style = [...loadStyles(), ...(config.extensions?.styles ?? [])].find((entry) => entry.id === config.applied?.style);
|
|
@@ -222,6 +234,7 @@ export const rulesJson = (
|
|
|
222
234
|
...levelsOf(rule, genre),
|
|
223
235
|
levels_you_can_set: definedLevels(rule),
|
|
224
236
|
your_setting: yourSetting(rule, config, limits),
|
|
237
|
+
...byPathOf(rule, config),
|
|
225
238
|
now: now(rule, config, limits, genre, preset, language),
|
|
226
239
|
...(rule.options === undefined ? {} : { options: optionsJson(rule, optionLayers) }),
|
|
227
240
|
...(rule.custom === undefined
|
|
@@ -234,6 +247,7 @@ export const rulesJson = (
|
|
|
234
247
|
by_command: ["relax", "strict", "off"].map((command) => `npx chaffjs ${command} <rule-id> --why "${text.reason}"`),
|
|
235
248
|
by_file: text.byFile,
|
|
236
249
|
options_by_file: text.optionsByFile,
|
|
250
|
+
by_path_file: text.byPathFile,
|
|
237
251
|
},
|
|
238
252
|
},
|
|
239
253
|
null,
|
package/src/render/summary.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Excluded } from "../files.ts";
|
|
1
2
|
import type { Finding } from "../plugin.ts";
|
|
2
3
|
import type { Texts, UiLanguage } from "../ui.ts";
|
|
3
4
|
import { counted } from "./plural.ts";
|
|
@@ -39,10 +40,38 @@ export const tally = (findings: readonly Finding[], ui: UiLanguage): string => {
|
|
|
39
40
|
return parts.length === 0 ? TEXT[ui].none : parts.join(TEXT[ui].join);
|
|
40
41
|
};
|
|
41
42
|
|
|
42
|
-
/** 複数ファイルを見たときの締め。1
|
|
43
|
-
export const renderSummary = (outcomes: readonly FileOutcome[], ui: UiLanguage): string[] => {
|
|
44
|
-
|
|
43
|
+
/** 複数ファイルを見たときの締め。1 ファイルのときは、外したファイルの行だけ。 */
|
|
44
|
+
export const renderSummary = (outcomes: readonly FileOutcome[], ui: UiLanguage, excluded: Excluded = { config: 0, gitignore: 0 }): string[] => {
|
|
45
|
+
const left = renderExcluded(excluded, ui);
|
|
46
|
+
if (outcomes.length < 2) return left;
|
|
45
47
|
const all = outcomes.flatMap((outcome) => outcome.findings);
|
|
46
48
|
const touched = outcomes.filter((outcome) => outcome.findings.length > 0).length;
|
|
47
|
-
return ["", "═".repeat(60), "", ` ${TEXT[ui].files(outcomes.length, touched)}`, ` ${tally(all, ui)}`, ""];
|
|
49
|
+
return ["", "═".repeat(60), "", ` ${TEXT[ui].files(outcomes.length, touched)}`, ` ${tally(all, ui)}`, ...left, ""];
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const EXCLUDED_TEXT: Texts<{
|
|
53
|
+
readonly line: (total: number, reasons: string) => string;
|
|
54
|
+
readonly join: string;
|
|
55
|
+
readonly config: (n: number) => string;
|
|
56
|
+
readonly ignored: (n: number) => string;
|
|
57
|
+
}> = {
|
|
58
|
+
ja: {
|
|
59
|
+
line: (total, reasons) => `検査から外したファイル: ${total} 件(${reasons})`,
|
|
60
|
+
join: "、",
|
|
61
|
+
config: (n) => `chaff.yaml の exclude で ${n} 件`,
|
|
62
|
+
ignored: (n) => `.gitignore で ${n} 件`,
|
|
63
|
+
},
|
|
64
|
+
en: {
|
|
65
|
+
line: (total, reasons) => `${counted(total, "file")} not checked (${reasons})`,
|
|
66
|
+
join: ", ",
|
|
67
|
+
config: (n) => `${n} by exclude in chaff.yaml`,
|
|
68
|
+
ignored: (n) => `${n} by .gitignore`,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/** How many files a walk found but did not check, and why: no findings from a file left out is not "checked and fine". */
|
|
73
|
+
export const renderExcluded = (excluded: Excluded, ui: UiLanguage): string[] => {
|
|
74
|
+
const text = EXCLUDED_TEXT[ui];
|
|
75
|
+
const reasons = [...(excluded.config > 0 ? [text.config(excluded.config)] : []), ...(excluded.gitignore > 0 ? [text.ignored(excluded.gitignore)] : [])];
|
|
76
|
+
return reasons.length === 0 ? [] : [` ${text.line(excluded.config + excluded.gitignore, reasons.join(text.join))}`];
|
|
48
77
|
};
|