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
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Suppressed, Suppression } from "../stet.ts";
|
|
1
|
+
import type { StetProblem, Suppressed, Suppression } from "../stet.ts";
|
|
2
|
+
import type { Allowed } from "../allow.ts";
|
|
2
3
|
import type { NotRun } from "../not-run.ts";
|
|
3
4
|
import type { Texts, UiLanguage } from "../ui.ts";
|
|
4
5
|
import { counted } from "./plural.ts";
|
|
@@ -14,6 +15,13 @@ const TEXT: Texts<{
|
|
|
14
15
|
readonly reasonless: (n: number) => string;
|
|
15
16
|
readonly notRun: string;
|
|
16
17
|
readonly runExperimental: string;
|
|
18
|
+
readonly ranges: string;
|
|
19
|
+
readonly noReason: string;
|
|
20
|
+
readonly problems: (n: number) => string;
|
|
21
|
+
readonly problem: Readonly<Record<StetProblem["kind"], (rule: string) => string>>;
|
|
22
|
+
readonly allowTotal: (n: number) => string;
|
|
23
|
+
readonly allowReason: (reason: string) => string;
|
|
24
|
+
readonly allowRules: (rules: string) => string;
|
|
17
25
|
}> = {
|
|
18
26
|
ja: {
|
|
19
27
|
nudge: " ← 設定の見直しを検討してください",
|
|
@@ -26,6 +34,19 @@ const TEXT: Texts<{
|
|
|
26
34
|
reasonless: (n) => `理由が書かれていない抑制: ${n} 件`,
|
|
27
35
|
notRun: "stet はあるが、今回動いていない rule(数えていません):",
|
|
28
36
|
runExperimental: "試験中の rule は --experimental を付けると数えます。",
|
|
37
|
+
ranges: "範囲の stet(stet-begin … stet-end):",
|
|
38
|
+
noReason: "(理由なし)",
|
|
39
|
+
problems: (n) => `効いていない、または書き方に問題のある stet: ${n} 件`,
|
|
40
|
+
problem: {
|
|
41
|
+
unclosed: () => "stet-begin に対応する stet-end がありません。何も黙らせていません",
|
|
42
|
+
"stray-end": () => "対応する stet-begin の無い stet-end です",
|
|
43
|
+
"no-rules": () => "ルール名がありません。黙らせるルールを書いてください(全ルールをまとめて黙らせる書き方はありません)",
|
|
44
|
+
"unknown-rule": (rule) => `「${rule}」というルールはありません`,
|
|
45
|
+
"no-matched-text": (rule) => `${rule} の指摘は見つけた語句を持たないので、rule["語句"] では黙りません`,
|
|
46
|
+
},
|
|
47
|
+
allowTotal: (n) => `chaff.yaml の allow で抑制されている指摘: ${n} 件`,
|
|
48
|
+
allowReason: (reason) => `理由: ${reason}`,
|
|
49
|
+
allowRules: (rules) => `rule: ${rules}`,
|
|
29
50
|
},
|
|
30
51
|
en: {
|
|
31
52
|
nudge: " <- consider changing the setting instead",
|
|
@@ -38,15 +59,32 @@ const TEXT: Texts<{
|
|
|
38
59
|
reasonless: (n) => `Silenced without a reason: ${n}`,
|
|
39
60
|
notRun: "Rules with a stet that did not run in this check (not counted):",
|
|
40
61
|
runExperimental: "Experimental rules are counted with --experimental.",
|
|
62
|
+
ranges: "Range stets (stet-begin … stet-end):",
|
|
63
|
+
noReason: "(no reason)",
|
|
64
|
+
problems: (n) => `Stets that do not work or are written wrong: ${n}`,
|
|
65
|
+
problem: {
|
|
66
|
+
unclosed: () => "stet-begin has no stet-end; it silences nothing",
|
|
67
|
+
"stray-end": () => "stet-end with no stet-begin to close",
|
|
68
|
+
"no-rules": () => "names no rule; write the rules to silence (there is no all-rules form)",
|
|
69
|
+
"unknown-rule": (rule) => `there is no rule named "${rule}"`,
|
|
70
|
+
"no-matched-text": (rule) => `${rule} findings carry no matched text, so rule["text"] silences none of them`,
|
|
71
|
+
},
|
|
72
|
+
allowTotal: (n) => `Silenced by allow in chaff.yaml: ${n}`,
|
|
73
|
+
allowReason: (reason) => `reason: ${reason}`,
|
|
74
|
+
allowRules: (rules) => `rules: ${rules}`,
|
|
41
75
|
},
|
|
42
76
|
};
|
|
43
77
|
|
|
44
78
|
export type PerFile = {
|
|
45
79
|
readonly path: string;
|
|
46
80
|
readonly suppressed: readonly Suppressed[];
|
|
81
|
+
/** Findings an entry of chaff.yaml's allow silenced, each with its entry (and so its reason). */
|
|
82
|
+
readonly allowed?: readonly Allowed[];
|
|
47
83
|
readonly reasonless: readonly Suppression[];
|
|
48
84
|
/** Rules a stet in the file names that did not run, so their silenced findings could not be counted. */
|
|
49
85
|
readonly notRun: readonly NotRun[];
|
|
86
|
+
readonly ranges: readonly Suppression[];
|
|
87
|
+
readonly problems: readonly StetProblem[];
|
|
50
88
|
};
|
|
51
89
|
|
|
52
90
|
/** これを超えたら、その rule は (b) ではなく (c) にすべきというサイン。 */
|
|
@@ -98,6 +136,62 @@ const notRunLines = (files: readonly PerFile[], ui: UiLanguage): string[] => {
|
|
|
98
136
|
return ["", ` ${text.notRun}`, ...lines, ...(rows.some((row) => row.needsExperimental) ? [` ${text.runExperimental}`] : [])];
|
|
99
137
|
};
|
|
100
138
|
|
|
139
|
+
/** Every range stet, with its lines, the rules it names and why, so a long silenced stretch is seen. */
|
|
140
|
+
const rangeLines = (files: readonly PerFile[], ui: UiLanguage): string[] => {
|
|
141
|
+
const text = TEXT[ui];
|
|
142
|
+
const rows = files.flatMap((file) =>
|
|
143
|
+
file.ranges.map((range) => ` ${file.path}:${range.line}-${range.blockEnd} ${range.rules.join(", ")} ${range.reason ?? text.noReason}`),
|
|
144
|
+
);
|
|
145
|
+
return rows.length === 0 ? [] : ["", ` ${text.ranges}`, ...rows];
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const problemLines = (files: readonly PerFile[], ui: UiLanguage): string[] => {
|
|
149
|
+
const text = TEXT[ui];
|
|
150
|
+
const rows = files.flatMap((file) =>
|
|
151
|
+
file.problems.map((problem) => ` ${file.path}:${problem.line} ${text.problem[problem.kind](problem.rule ?? "")}`),
|
|
152
|
+
);
|
|
153
|
+
return rows.length === 0 ? [] : ["", ` ${text.problems(rows.length)}`, ...rows];
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
type AllowGroup = { readonly entry: Allowed["entry"]; readonly count: number; readonly files: readonly string[] };
|
|
157
|
+
|
|
158
|
+
/** Findings silenced by allow, one group per entry, most first. */
|
|
159
|
+
const groupByEntry = (files: readonly PerFile[]): AllowGroup[] => {
|
|
160
|
+
const rows = files.flatMap((file) => (file.allowed ?? []).map((entry) => ({ path: file.path, entry: entry.entry })));
|
|
161
|
+
const ats = [...new Set(rows.map((row) => row.entry.at))];
|
|
162
|
+
return ats
|
|
163
|
+
.flatMap((at) => {
|
|
164
|
+
const mine = rows.filter((row) => row.entry.at === at);
|
|
165
|
+
const [first] = mine;
|
|
166
|
+
return first === undefined ? [] : [{ entry: first.entry, count: mine.length, files: [...new Set(mine.map((row) => row.path))] }];
|
|
167
|
+
})
|
|
168
|
+
.toSorted((left, right) => right.count - left.count);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const allowTarget = (entry: Allowed["entry"]): string => (entry.text === undefined ? ["/", entry.pattern ?? "", "/"].join("") : JSON.stringify(entry.text));
|
|
172
|
+
|
|
173
|
+
const allowLabel = (entry: Allowed["entry"]): string => `${entry.at} ${allowTarget(entry)}`;
|
|
174
|
+
|
|
175
|
+
const allowGroupLines = (group: AllowGroup, ui: UiLanguage): string[] => {
|
|
176
|
+
const text = TEXT[ui];
|
|
177
|
+
const shown = group.files.slice(0, 3).join(", ");
|
|
178
|
+
const rest = group.files.length > 3 ? text.more(group.files.length - 3) : "";
|
|
179
|
+
return [
|
|
180
|
+
"",
|
|
181
|
+
` ${allowLabel(group.entry).padEnd(26)}${text.count(group.count)}`,
|
|
182
|
+
` ${text.allowReason(group.entry.reason)}`,
|
|
183
|
+
...(group.entry.rules.length > 0 ? [` ${text.allowRules(group.entry.rules.join(", "))}`] : []),
|
|
184
|
+
` ${shown}${rest}`,
|
|
185
|
+
];
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
/** What chaff.yaml's allow silenced, each entry with its reason: an allowance must not make findings vanish unseen. */
|
|
189
|
+
const allowLines = (files: readonly PerFile[], ui: UiLanguage): string[] => {
|
|
190
|
+
const groups = groupByEntry(files);
|
|
191
|
+
const total = groups.reduce((sum, group) => sum + group.count, 0);
|
|
192
|
+
return total === 0 ? [] : ["", ` ${TEXT[ui].allowTotal(total)}`, ...groups.flatMap((group) => allowGroupLines(group, ui))];
|
|
193
|
+
};
|
|
194
|
+
|
|
101
195
|
/**
|
|
102
196
|
* 抑制が溜まったことに気づけないと、規範と現実の乖離が静かに進む。
|
|
103
197
|
* 同じ rule を何度も黙らせているなら、それは (b) ではなく (c) のサイン。
|
|
@@ -107,15 +201,18 @@ export const renderSuppressions = (files: readonly PerFile[], ui: UiLanguage = "
|
|
|
107
201
|
const text = TEXT[ui];
|
|
108
202
|
const groups = groupByRule(files);
|
|
109
203
|
const total = groups.reduce((sum, group) => sum + group.count, 0);
|
|
110
|
-
const
|
|
111
|
-
|
|
204
|
+
const allowed = allowLines(files, ui);
|
|
205
|
+
const trailing = [...notRunLines(files, ui), ...rangeLines(files, ui), ...problemLines(files, ui)];
|
|
206
|
+
if (total === 0 && allowed.length > 0) return [...allowed, ...trailing, ""].join("\n");
|
|
207
|
+
if (total === 0) return trailing.length === 0 ? text.none : [text.none.trimEnd(), ...trailing, ""].join("\n");
|
|
112
208
|
const reasonless = files.flatMap((file) => file.reasonless.map(() => file.path));
|
|
113
209
|
return [
|
|
114
210
|
"",
|
|
115
211
|
` ${text.total(total)}`,
|
|
116
212
|
...groups.flatMap((group) => groupLines(group, ui)),
|
|
117
213
|
...(reasonless.length > 0 ? ["", ` ${text.reasonless(reasonless.length)}`, ` ${[...new Set(reasonless)].join(", ")}`] : []),
|
|
118
|
-
...
|
|
214
|
+
...allowed,
|
|
215
|
+
...trailing,
|
|
119
216
|
"",
|
|
120
217
|
].join("\n");
|
|
121
218
|
};
|
package/src/render/text.ts
CHANGED
|
@@ -22,16 +22,29 @@ export const templateForReading = (template: string, readings: Readonly<Record<s
|
|
|
22
22
|
/** A rule's text for one finding, with the finding's values in it. */
|
|
23
23
|
export const filledText = (field: Localized, finding: Finding, language: string): string => fill(localized(field, language), finding.values);
|
|
24
24
|
|
|
25
|
+
/** An English reading that opens with a determiner (the word found) describes the value; one that does not (always, N) is a sample of it. */
|
|
26
|
+
const DESCRIBING = /^(?:the|a|an|another|one|how)\s/iu;
|
|
27
|
+
/** A stand-in for the value itself (〇〇), which reads as the word in quotation marks. */
|
|
28
|
+
const STAND_IN = /^〇+$/u;
|
|
29
|
+
const QUOTED_PLACEHOLDER = /([「『“"])\{(\w+)\}([」』”"])/gu;
|
|
30
|
+
const CLOSER: Readonly<Record<string, string>> = { "「": "」", "『": "』", "“": "”", '"': '"' };
|
|
31
|
+
|
|
32
|
+
/** A description in quotation marks reads as if it were the word itself (Change it to 「直した書き方」), so its marks go. */
|
|
33
|
+
const unquoteDescriptions = (template: string, describing: ReadonlySet<string>): string =>
|
|
34
|
+
template.replace(QUOTED_PLACEHOLDER, (whole, open: string, key: string, close: string) =>
|
|
35
|
+
CLOSER[open] === close && describing.has(key) ? `{${key}}` : whole,
|
|
36
|
+
);
|
|
37
|
+
|
|
25
38
|
/** A rule's text where no finding fills it (explain, rules --json, the rule reference): each value as the rule's words for it. */
|
|
26
39
|
export const readableText = (rule: Pick<RuleDefinition, "placeholders">, field: Localized, language: string): string => {
|
|
27
40
|
// The same fallback as the text itself: an English-only rule read in Japanese still gets its English words.
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
);
|
|
34
|
-
return templateForReading(localized(field, language), readings);
|
|
41
|
+
const entries = Object.entries(rule.placeholders ?? {}).flatMap(([key, reading]) => {
|
|
42
|
+
const words = localized(reading, language);
|
|
43
|
+
return words === "" ? [] : [{ key, words, describing: DESCRIBING.test(reading["en"] ?? "") && !STAND_IN.test(words) }];
|
|
44
|
+
});
|
|
45
|
+
const readings = Object.fromEntries(entries.map(({ key, words }) => [key, words]));
|
|
46
|
+
const describing = new Set(entries.filter((entry) => entry.describing).map(({ key }) => key));
|
|
47
|
+
return templateForReading(unquoteDescriptions(localized(field, language), describing), readings);
|
|
35
48
|
};
|
|
36
49
|
|
|
37
50
|
const templateOf = (rule: RuleDefinition, finding: Finding): Localized =>
|
package/src/rule-load.ts
CHANGED
|
@@ -105,11 +105,12 @@ const numberFor = (raw: unknown, language: string): number | undefined => {
|
|
|
105
105
|
|
|
106
106
|
const stringList = (value: unknown): string[] | undefined => (Array.isArray(value) ? value.map((entry) => String(entry)) : undefined);
|
|
107
107
|
|
|
108
|
-
/** What only some rules declare: options beyond the level, token features the adapter computes on request, and
|
|
109
|
-
const extrasOf = (raw: Record<string, unknown>, file: string): Pick<RuleDefinition, "options" | "token_features" | "opt_in"> => ({
|
|
108
|
+
/** What only some rules declare: options beyond the level, token features the adapter computes on request, opt_in and team_list. */
|
|
109
|
+
const extrasOf = (raw: Record<string, unknown>, file: string): Pick<RuleDefinition, "options" | "token_features" | "opt_in" | "team_list"> => ({
|
|
110
110
|
...(raw["options"] === undefined ? {} : { options: optionsOf(raw["options"], file) }),
|
|
111
111
|
...(raw["token_features"] === undefined ? {} : { token_features: stringList(raw["token_features"]) ?? [] }),
|
|
112
112
|
...(raw["opt_in"] === true ? { opt_in: true } : {}),
|
|
113
|
+
...(typeof raw["team_list"] === "string" ? { team_list: raw["team_list"] } : {}),
|
|
113
114
|
});
|
|
114
115
|
|
|
115
116
|
/** The table flattenLevels reads, before its severities become numbers. */
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Span } from "./plugin.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 紹介記事の一覧で、リンクを外して写した行の頭の題名(〜の取り組みについて(デジタル庁公式note) 〜を紹介しています。)。
|
|
5
|
+
* 題名は行の頭から、載せた媒体の名前を入れた全角の丸括弧まで。その後ろに半角の空白を一つ置いて、紹介の文が続く。
|
|
6
|
+
* 題名は行き先のページのもので、書き手は言い換えられない。括弧の中に「の」のほかのひらがなのある説明(写しが原本と同じことの認証)、
|
|
7
|
+
* 後ろが助詞で続く文の中の名前(〜(IPA) をご覧ください)、後ろが空白や記号の表((自己株式等) ---)は題名と見ない。
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const LINE_BREAKS = /[\n\r\u2028\u2029]/gu;
|
|
11
|
+
const INDENT = /[ \t]/u;
|
|
12
|
+
const BULLET_MARK = /[-*+]/u;
|
|
13
|
+
const DIGIT = /\d/u;
|
|
14
|
+
const NUMBER_CLOSE = /[.)]/u;
|
|
15
|
+
const MAX_NUMBER_DIGITS = 3;
|
|
16
|
+
/** 題名の字: 行の終わり、文の終わり、表の線のほか。 */
|
|
17
|
+
const TITLE_CHAR = /[^\n。|]/u;
|
|
18
|
+
const OPEN = "(";
|
|
19
|
+
const CLOSE = ")";
|
|
20
|
+
/** 媒体の名前の字: 閉じ括弧・改行と、「の」のほかのひらがなは入らない。 */
|
|
21
|
+
const NAME_STOP = /[)\n\p{Script=Hiragana}]/u;
|
|
22
|
+
const NAME_PARTICLE = "の";
|
|
23
|
+
const MAX_NAME_LENGTH = 30;
|
|
24
|
+
const BLURB_OPEN = "「";
|
|
25
|
+
/** 紹介の文の頭に来ない字: 空白、句読点・記号、文の中の名前に続く助詞。 */
|
|
26
|
+
const NOT_BLURB_HEAD = /[\s\p{P}\p{S}をがにへでとはもの]/u;
|
|
27
|
+
|
|
28
|
+
/** from から pattern の字が続く長さ(limit まで)。 */
|
|
29
|
+
const runLength = (text: string, from: number, pattern: RegExp, limit = Number.POSITIVE_INFINITY): number => {
|
|
30
|
+
const rest = text.slice(from, Math.min(text.length, from + limit));
|
|
31
|
+
const stop = rest.split("").findIndex((char) => !pattern.test(char));
|
|
32
|
+
return stop === -1 ? rest.length : stop;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** 長いほうから並べた from+length … from+1。 */
|
|
36
|
+
const longestFirst = (from: number, length: number): number[] => Array.from({ length }, (_, index) => from + length - index);
|
|
37
|
+
|
|
38
|
+
/** 箇条書きの印(- 、1. )とその後ろの空白の終わりの候補。正規表現が試す順(数字も空白も長いほうから)。 */
|
|
39
|
+
const bulletEnds = (text: string, at: number): number[] => {
|
|
40
|
+
const markEnds = BULLET_MARK.test(text.charAt(at))
|
|
41
|
+
? [at + 1]
|
|
42
|
+
: longestFirst(at, runLength(text, at, DIGIT, MAX_NUMBER_DIGITS))
|
|
43
|
+
.filter((digitsEnd) => NUMBER_CLOSE.test(text.charAt(digitsEnd)))
|
|
44
|
+
.map((digitsEnd) => digitsEnd + 1);
|
|
45
|
+
return markEnds.flatMap((markEnd) => longestFirst(markEnd, runLength(text, markEnd, INDENT)));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** 行の頭から題名が始まりうる位置。字下げを長いほうから、それぞれ印のある読み方を先に。 */
|
|
49
|
+
const titleStarts = (text: string, lineStart: number): number[] => {
|
|
50
|
+
const indents = [...longestFirst(lineStart, runLength(text, lineStart, INDENT)), lineStart];
|
|
51
|
+
return [...new Set(indents.flatMap((at) => [...bulletEnds(text, at), at]))];
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/** open の開き括弧から、媒体の名前を入れて閉じた括弧の後ろの位置。名前でなければ undefined。 */
|
|
55
|
+
const nameBracketEnd = (text: string, open: number): number | undefined => {
|
|
56
|
+
const chars = Array.from(text.slice(open + OPEN.length, open + OPEN.length + 2 * (MAX_NAME_LENGTH + 1)));
|
|
57
|
+
const length = chars.findIndex((char) => char !== NAME_PARTICLE && NAME_STOP.test(char));
|
|
58
|
+
if (length < 1 || length > MAX_NAME_LENGTH || chars[length] !== CLOSE) return undefined;
|
|
59
|
+
return open + OPEN.length + chars.slice(0, length).join("").length + CLOSE.length;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/** at から半角の空白一つと、紹介の文の頭の字が続くか。 */
|
|
63
|
+
const startsBlurb = (text: string, at: number): boolean => {
|
|
64
|
+
const head = text.codePointAt(at + 1);
|
|
65
|
+
if (text.charAt(at) !== " " || head === undefined) return false;
|
|
66
|
+
const char = String.fromCodePoint(head);
|
|
67
|
+
return char === BLURB_OPEN || !NOT_BLURB_HEAD.test(char);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/** start から始まる題名。題名の字は一字以上で、題名に入らない字の手前の開き括弧までを試す。 */
|
|
71
|
+
const titleFrom = (text: string, start: number): Span | undefined => {
|
|
72
|
+
const stop = start + runLength(text, start, TITLE_CHAR);
|
|
73
|
+
const opens = longestFirst(start, stop - start)
|
|
74
|
+
.toReversed()
|
|
75
|
+
.filter((open) => text.charAt(open) === OPEN);
|
|
76
|
+
return opens
|
|
77
|
+
.map((open) => ({ start, end: nameBracketEnd(text, open) }))
|
|
78
|
+
.find((title): title is Span => title.end !== undefined && startsBlurb(text, title.end));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const lineStarts = (text: string): number[] => [0, ...Array.from(text.matchAll(LINE_BREAKS), (match) => match.index + 1)];
|
|
82
|
+
|
|
83
|
+
/** 行の頭の、媒体の名前を括弧に入れた題名の範囲(行頭の箇条書きの印は含まない)。位置は source の上。 */
|
|
84
|
+
export const runInTitleSpans = (source: string): Span[] =>
|
|
85
|
+
lineStarts(source).reduce<Span[]>((titles, lineStart) => {
|
|
86
|
+
if (lineStart < (titles.at(-1)?.end ?? 0)) return titles;
|
|
87
|
+
const title = titleStarts(source, lineStart)
|
|
88
|
+
.map((start) => titleFrom(source, start))
|
|
89
|
+
.find((found) => found !== undefined);
|
|
90
|
+
return title === undefined ? titles : [...titles, title];
|
|
91
|
+
}, []);
|
package/src/run.ts
CHANGED
|
@@ -19,7 +19,7 @@ import { PatternTimeout } from "./custom/pattern-timeout.ts";
|
|
|
19
19
|
import { PluginRuleFailure } from "./extension/module-detector.ts";
|
|
20
20
|
import { failureReason } from "./extension/failure-text.ts";
|
|
21
21
|
import { tagCoverage } from "./tag-coverage.ts";
|
|
22
|
-
import { compositeSignals } from "./composite-signals.ts";
|
|
22
|
+
import { compositeSignals, signalNames } from "./composite-signals.ts";
|
|
23
23
|
|
|
24
24
|
export type Skipped = {
|
|
25
25
|
readonly rule: string;
|
|
@@ -53,9 +53,11 @@ export const levelFor = (rule: RuleDefinition, settings: Settings, experimental:
|
|
|
53
53
|
return "normal";
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
/** Why a rule at off did not run: chaff.yaml turned it off, the genre's preset did, it waits for a style, or it is experimental. */
|
|
57
|
-
const offSkip = (rule: RuleDefinition,
|
|
58
|
-
|
|
56
|
+
/** Why a rule at off did not run: a by_path entry or chaff.yaml turned it off, the genre's preset did, it waits for a style, or it is experimental. */
|
|
57
|
+
const offSkip = (rule: RuleDefinition, context: RunContext, preset: Settings, reasons: Reasons): Skipped => {
|
|
58
|
+
const { settings, genre } = context;
|
|
59
|
+
const byPath = context.levelsFrom?.[rule.id];
|
|
60
|
+
if (settings[rule.id] !== undefined) return { rule: rule.id, why: byPath === undefined ? reasons.turnedOff : reasons.turnedOffBy(byPath) };
|
|
59
61
|
if (preset[rule.id] !== undefined) return { rule: rule.id, why: reasons.presetOff(genre) };
|
|
60
62
|
if (rule.opt_in === true) return { rule: rule.id, why: reasons.optIn };
|
|
61
63
|
return { rule: rule.id, why: reasons.experimental, offUntilExperimental: true };
|
|
@@ -116,6 +118,17 @@ const documentNeed = (rule: RuleDefinition, doc: ProseDocument): string | undefi
|
|
|
116
118
|
return absent === undefined ? reasonsFor(doc).oneDocument : reasonsFor(doc).noLexicon(doc.language, absent);
|
|
117
119
|
};
|
|
118
120
|
|
|
121
|
+
/**
|
|
122
|
+
* 語彙表を要求する rule で、その言語に語彙表が無ければ動かせない。黙って通さない。
|
|
123
|
+
* A rule that reads only the team's list (team_list) has nothing to check while chaff.yaml lists nothing: its 0 findings would read as checked and fine.
|
|
124
|
+
*/
|
|
125
|
+
const listNeed = (rule: RuleDefinition, doc: ProseDocument): string | undefined => {
|
|
126
|
+
const absent = missingList(rule, doc.lexicons);
|
|
127
|
+
if (absent !== undefined) return reasonsFor(doc).noLexicon(doc.language, absent);
|
|
128
|
+
const listed = rule.word_list === undefined ? undefined : doc.lexicons[rule.word_list];
|
|
129
|
+
return rule.team_list !== undefined && (listed ?? []).length === 0 ? reasonsFor(doc).noTeamList(rule.team_list) : undefined;
|
|
130
|
+
};
|
|
131
|
+
|
|
119
132
|
/** 知らない要求は満たされていないものとして扱う。黙って無視すると、要求なしで動いてしまう。 */
|
|
120
133
|
const has = (capabilities: ProseDocument["capabilities"], need: string): boolean => {
|
|
121
134
|
if (need === "pos") return capabilities.pos;
|
|
@@ -157,6 +170,10 @@ const untagged = (rule: RuleDefinition, doc: ProseDocument): string | undefined
|
|
|
157
170
|
|
|
158
171
|
const suitsGenre = (rule: RuleDefinition, genre: string): boolean => rule.use_for.some((target) => genre.startsWith(target));
|
|
159
172
|
|
|
173
|
+
/** Why the genre keeps the rule from running, in a run's words: use_for leaves the genre out, or its preset turns the rule off and chaff.yaml does not name it. */
|
|
174
|
+
export const genreStop = (rule: RuleDefinition, settings: Settings, preset: Settings, genre: string, reasons: Reasons): string | undefined =>
|
|
175
|
+
!suitsGenre(rule, genre) || (settings[rule.id] === undefined && preset[rule.id] === "off") ? reasons.presetOff(genre) : undefined;
|
|
176
|
+
|
|
160
177
|
const forGenre = (rules: readonly RuleDefinition[], genre: string): RuleDefinition[] => rules.filter((rule) => suitsGenre(rule, genre));
|
|
161
178
|
|
|
162
179
|
/** A rule use_for keeps out of the genre. A rule for another language says that first: no genre would run it here. */
|
|
@@ -212,7 +229,10 @@ export const place = (starts: readonly number[], finding: Finding): Finding => {
|
|
|
212
229
|
* 元の指摘は消さない。`padded-intro` のように単独でも正しい指摘が混ざっており、
|
|
213
230
|
* まとめるために消すと本物の指摘が見えなくなる。
|
|
214
231
|
*/
|
|
215
|
-
|
|
232
|
+
type CompositeContext = { readonly starts: readonly number[]; readonly language: string; readonly rules: readonly RuleDefinition[] };
|
|
233
|
+
|
|
234
|
+
const compositeOf = (rule: RuleDefinition, found: readonly Finding[], limit: number, context: CompositeContext): Finding[] => {
|
|
235
|
+
const { starts, language, rules } = context;
|
|
216
236
|
const fired = compositeSignals(rule.from, found);
|
|
217
237
|
if (fired.length < limit) return [];
|
|
218
238
|
// 数えなかった signal も含めて、最初に出た所に置く。同じ形を 1 種に数えても、指摘の位置は動かない。
|
|
@@ -224,7 +244,13 @@ const compositeOf = (rule: RuleDefinition, found: readonly Finding[], limit: num
|
|
|
224
244
|
line: 0,
|
|
225
245
|
column: 0,
|
|
226
246
|
quote: first?.quote ?? "",
|
|
227
|
-
values: {
|
|
247
|
+
values: {
|
|
248
|
+
word: joinWords(fired, language),
|
|
249
|
+
signals: joinWords(signalNames(fired, rules, uiLanguageOf(language)), language),
|
|
250
|
+
count: fired.length,
|
|
251
|
+
limit,
|
|
252
|
+
offset: first === undefined ? 0 : Number(first.values["offset"] ?? 0),
|
|
253
|
+
},
|
|
228
254
|
}),
|
|
229
255
|
];
|
|
230
256
|
};
|
|
@@ -234,6 +260,17 @@ export type Limits = Readonly<Record<string, number>>;
|
|
|
234
260
|
|
|
235
261
|
export const limitFor = (rule: RuleDefinition, level: Level, genre: string, limits: Limits): number => limits[rule.id] ?? resolve(rule, level, genre).limit;
|
|
236
262
|
|
|
263
|
+
type CompositeLevels = {
|
|
264
|
+
readonly levelOf: (rule: RuleDefinition) => Level;
|
|
265
|
+
readonly limitOf: (rule: RuleDefinition, level: Level) => number;
|
|
266
|
+
readonly context: CompositeContext;
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
const compositesOf = (applicable: readonly RuleDefinition[], found: readonly Finding[], levels: CompositeLevels): Finding[] =>
|
|
270
|
+
applicable
|
|
271
|
+
.filter((rule) => rule.from.length > 0 && levels.levelOf(rule) !== "off")
|
|
272
|
+
.flatMap((rule) => compositeOf(rule, found, levels.limitOf(rule, levels.levelOf(rule)), levels.context));
|
|
273
|
+
|
|
237
274
|
/** 文書と違う言語で書いた文の上限。chaff.yaml の数値は文書の言語の単位で書いたものなので、ここには効かせない。 */
|
|
238
275
|
const embeddedLimitsFor = (rule: RuleDefinition, level: Level, genre: string, embedded: readonly string[]): Record<string, number> =>
|
|
239
276
|
Object.fromEntries(
|
|
@@ -257,6 +294,8 @@ export type RunContext = {
|
|
|
257
294
|
readonly optionLayers?: readonly OptionLayer[];
|
|
258
295
|
/** The detectors loaded from the code chaff.yaml names, by rule id. They come before chaff's own table. */
|
|
259
296
|
readonly detectors?: Readonly<Record<string, Detector>>;
|
|
297
|
+
/** For each rule a by_path entry set, which entry: a rule it turns off says so where the rules that did not run are listed. */
|
|
298
|
+
readonly levelsFrom?: Readonly<Record<string, string>>;
|
|
260
299
|
};
|
|
261
300
|
|
|
262
301
|
export const runRules = (
|
|
@@ -285,7 +324,7 @@ export const runRulesWith = (doc: ProseDocument, rules: readonly RuleDefinition[
|
|
|
285
324
|
const blocked = unmet(rule, doc);
|
|
286
325
|
if (blocked !== undefined) return { findings: acc.findings, skipped: [...acc.skipped, { rule: rule.id, why: blocked }] };
|
|
287
326
|
const level = levelFor(rule, settings, experimental, preset);
|
|
288
|
-
if (level === "off") return { findings: acc.findings, skipped: [...acc.skipped, offSkip(rule,
|
|
327
|
+
if (level === "off") return { findings: acc.findings, skipped: [...acc.skipped, offSkip(rule, context, preset, reasonsFor(doc))] };
|
|
289
328
|
const noTags = untagged(rule, doc);
|
|
290
329
|
if (noTags !== undefined) return { findings: acc.findings, skipped: [...acc.skipped, { rule: rule.id, why: noTags }] };
|
|
291
330
|
// 木は capability ではなく、adapter が structure を持つかで決まる。持たない言語で動かすと「参照先が無い」が 0 件に見える。
|
|
@@ -299,10 +338,8 @@ export const runRulesWith = (doc: ProseDocument, rules: readonly RuleDefinition[
|
|
|
299
338
|
const detector = detectors[rule.id] ?? DETECTORS[rule.how_to_find];
|
|
300
339
|
if (detector === undefined)
|
|
301
340
|
return { findings: acc.findings, skipped: [...acc.skipped, { rule: rule.id, why: reasonsFor(doc).noDetector(rule.how_to_find) }] };
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
if (absent !== undefined)
|
|
305
|
-
return { findings: acc.findings, skipped: [...acc.skipped, { rule: rule.id, why: reasonsFor(doc).noLexicon(doc.language, absent) }] };
|
|
341
|
+
const noList = listNeed(rule, doc);
|
|
342
|
+
if (noList !== undefined) return { findings: acc.findings, skipped: [...acc.skipped, { rule: rule.id, why: noList }] };
|
|
306
343
|
const options = {
|
|
307
344
|
limit: limitFor(rule, level, genre, limits),
|
|
308
345
|
lexicon: rule.word_list === undefined ? undefined : doc.lexicons[rule.word_list],
|
|
@@ -326,11 +363,11 @@ export const runRulesWith = (doc: ProseDocument, rules: readonly RuleDefinition[
|
|
|
326
363
|
},
|
|
327
364
|
{ findings: [], skipped: [] },
|
|
328
365
|
);
|
|
329
|
-
const composites = applicable
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
366
|
+
const composites = compositesOf(applicable, outcome.findings, {
|
|
367
|
+
levelOf: (rule) => levelFor(rule, settings, experimental, preset),
|
|
368
|
+
limitOf: (rule, level) => limitFor(rule, level, genre, limits),
|
|
369
|
+
context: { starts, language: doc.language, rules },
|
|
370
|
+
});
|
|
334
371
|
const all = [...outcome.findings, ...composites];
|
|
335
372
|
return { ...outcome, findings: all.toSorted(byPosition), forcedExperimental: forced, presetExperimental: presetOn };
|
|
336
373
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Span } from "./plugin.ts";
|
|
2
|
+
|
|
3
|
+
// The marks of a heading or a quotation that are syntax, not words: what a rule limited to headings or quotations must
|
|
4
|
+
// not read (`## 概要` reads 概要). Positions are in the text given. Pure.
|
|
5
|
+
|
|
6
|
+
const QUOTE_MARKS = /^[ \t]*(?:>[ \t]?)+/gmu;
|
|
7
|
+
const ATX_OPENING = /^[ \t]*#{1,6}(?=[ \t]|$)/gmu;
|
|
8
|
+
const ATX_CLOSING = /(?<![ \t])[ \t]+#+[ \t]*$/gmu;
|
|
9
|
+
const SETEXT_UNDERLINE = /^[ \t]*(?:=+|-+)[ \t]*$/gmu;
|
|
10
|
+
|
|
11
|
+
const spansOf = (text: string, pattern: RegExp): Span[] =>
|
|
12
|
+
[...text.matchAll(pattern)].flatMap((match) => (match[0] === "" ? [] : [{ start: match.index, end: match.index + match[0].length }]));
|
|
13
|
+
|
|
14
|
+
/** The `>` opening each line of a quotation, nested ones too (`> > `). */
|
|
15
|
+
export const quoteMarkers = (text: string): Span[] => spansOf(text, QUOTE_MARKS);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* One heading's `#` run, its closing `#` run and a setext underline (`===`), its quotation marks already blanked. The
|
|
19
|
+
* `#` of `C#` is a word: a closing run follows a space.
|
|
20
|
+
*/
|
|
21
|
+
export const headingMarkers = (heading: string): Span[] => [
|
|
22
|
+
...spansOf(heading, ATX_OPENING),
|
|
23
|
+
...spansOf(heading, ATX_CLOSING),
|
|
24
|
+
...spansOf(heading, SETEXT_UNDERLINE),
|
|
25
|
+
];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Texts, UiLanguage } from "./ui.ts";
|
|
2
|
+
import { TEXT_SCOPES, type ScopeProblem } from "./text-scope.ts";
|
|
3
|
+
|
|
4
|
+
// What is wrong with a scope written in chaff.yaml (custom_rules or prefer), as one sentence in the reader's language.
|
|
5
|
+
|
|
6
|
+
const NAMES = TEXT_SCOPES.join(" / ");
|
|
7
|
+
|
|
8
|
+
const TEXT: Texts<Readonly<Record<ScopeProblem["kind"], (written: string) => string>>> = {
|
|
9
|
+
ja: {
|
|
10
|
+
unknown: (written) => `scope の ${written} は知りません(${NAMES}。外すものは ~quote のように前に ~ を付けます)`,
|
|
11
|
+
"not-a-list": (written) => `scope: ${written} は読めません。[heading] や [list, table]、[~quote] のように名前を並べてください`,
|
|
12
|
+
empty: (written) => `scope: ${written} では読む所が残りません。選んだものをすべて ~ で外しています`,
|
|
13
|
+
},
|
|
14
|
+
en: {
|
|
15
|
+
unknown: (written) => `unknown scope ${written} (${NAMES}; put ~ in front of one to leave it out, as in ~quote)`,
|
|
16
|
+
"not-a-list": (written) => `cannot read scope: ${written}. Write a list of names, such as [heading], [list, table] or [~quote]`,
|
|
17
|
+
empty: (written) => `scope: ${written} leaves nothing to read: every part it chooses is also left out with ~`,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const scopeProblemSentence = (kind: ScopeProblem["kind"], written: string, ui: UiLanguage): string => TEXT[ui][kind](written);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ProseDocument, ScopedSentence, ScopeSelector, Sentence, TableCell } from "./plugin.ts";
|
|
2
|
+
import { inScope, scopesOf, type ScopeRegions } from "./text-scope.ts";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* What a rule limited to some parts of a document (scope:) reads from: the body's sentences, the sentences of the headings
|
|
6
|
+
* and of the quotations (which the body leaves out), the table cells, and where the list items and quotations are.
|
|
7
|
+
*/
|
|
8
|
+
type ScopeSources = {
|
|
9
|
+
readonly body: readonly Sentence[];
|
|
10
|
+
readonly headings: readonly Sentence[];
|
|
11
|
+
readonly quoted: readonly Sentence[];
|
|
12
|
+
readonly cells: readonly TableCell[];
|
|
13
|
+
readonly regions: ScopeRegions;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** A table cell read as one sentence: a cell has no sentence ending to split at. */
|
|
17
|
+
const cellSentence = (cell: TableCell): Sentence => ({
|
|
18
|
+
span: { start: cell.start, end: cell.end },
|
|
19
|
+
text: cell.text,
|
|
20
|
+
...(cell.tokens === undefined ? {} : { tokens: cell.tokens }),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
/** Every sentence a scope can choose from, in the order of the document, with the parts it is in. */
|
|
24
|
+
export const scopedSentences = (sources: ScopeSources): ScopedSentence[] =>
|
|
25
|
+
[
|
|
26
|
+
...sources.body.map((sentence) => ({ sentence, scopes: scopesOf(sentence.span, sources.regions) })),
|
|
27
|
+
...sources.quoted.map((sentence) => ({ sentence, scopes: scopesOf(sentence.span, sources.regions) })),
|
|
28
|
+
...sources.headings.map((sentence) => ({ sentence, scopes: scopesOf(sentence.span, sources.regions, "heading") })),
|
|
29
|
+
...sources.cells.map((cell) => ({ sentence: cellSentence(cell), scopes: scopesOf(cell, sources.regions, "table") })),
|
|
30
|
+
].toSorted((left, right) => left.sentence.span.start - right.sentence.span.start);
|
|
31
|
+
|
|
32
|
+
/** A document built without its scoped sentences (a test's, a plugin's): the body alone, list items and reply quotes found in it. */
|
|
33
|
+
const bodyOnly = (doc: ProseDocument): ScopedSentence[] =>
|
|
34
|
+
scopedSentences({ body: doc.sentences, headings: [], quoted: [], cells: [], regions: { list: doc.listSpans, quote: doc.replyQuotes ?? [] } });
|
|
35
|
+
|
|
36
|
+
/** Every sentence of the document with the parts it is in. */
|
|
37
|
+
export const scopedSentencesOf = (doc: ProseDocument): readonly ScopedSentence[] => doc.scopedSentences?.() ?? bodyOnly(doc);
|
|
38
|
+
|
|
39
|
+
/** The sentences a rule with this scope reads. Without a scope, the body's sentences, as every rule has always read. */
|
|
40
|
+
export const sentencesInScope = (doc: ProseDocument, scope: ScopeSelector | undefined): readonly Sentence[] =>
|
|
41
|
+
scope === undefined ? doc.sentences : scopedSentencesOf(doc).flatMap((scoped) => (inScope(scope, scoped.scopes) ? [scoped.sentence] : []));
|
package/src/setting-problems.ts
CHANGED
|
@@ -4,6 +4,8 @@ import type { UiLanguage } from "./ui.ts";
|
|
|
4
4
|
import { styleProblems } from "./config/style.ts";
|
|
5
5
|
import { loadStyles } from "./style-load.ts";
|
|
6
6
|
import { customRuleProblems } from "./custom/problems.ts";
|
|
7
|
+
import { preferProblems } from "./config/prefer-problems.ts";
|
|
8
|
+
import { allowProblems } from "./config/allow-problems.ts";
|
|
7
9
|
import { extensionProblems } from "./extension/problem-text.ts";
|
|
8
10
|
import { GENRES } from "./genre.ts";
|
|
9
11
|
import { unknownGenres, writtenGenres } from "./genre-check.ts";
|
|
@@ -28,5 +30,7 @@ export const settingProblems = (command: string, genreFlag: string | undefined,
|
|
|
28
30
|
...profileProblems(command, config, text),
|
|
29
31
|
...styleProblems(config, [...loadStyles(), ...(config.extensions?.styles ?? [])], ui),
|
|
30
32
|
...customRuleProblems(config, ui),
|
|
33
|
+
...preferProblems(config, ui),
|
|
34
|
+
...allowProblems(config, ui),
|
|
31
35
|
...extensionProblems(config, ui),
|
|
32
36
|
];
|
package/src/spelling.ts
CHANGED
|
@@ -110,10 +110,10 @@ export const wordsToCheck = (text: string, minLength: number, maxLength: number)
|
|
|
110
110
|
.map((match) => ({ offset: match.index, word: match[0] }));
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
/** 頭の字を強調(**G**lobally)や角括弧(引用を変えた [e]xpressions)で分けた語の残りの、直前の形。 */
|
|
114
|
-
const SPLIT_HEAD = /(?:\p{L}[*_~]
|
|
115
|
-
/**
|
|
116
|
-
const SPLIT_LOOKBACK =
|
|
113
|
+
/** 頭の字を強調(**G**lobally、<strong>E</strong>dition)や角括弧(引用を変えた [e]xpressions)で分けた語の残りの、直前の形。 */
|
|
114
|
+
const SPLIT_HEAD = /(?:\p{L}(?:[*_~]+|<\/[a-z]+>)|\[\p{L}\])$/u;
|
|
115
|
+
/** 直前を見る字の数。強調の印か閉じのタグ(</strong>)と頭の字が収まればよい。 */
|
|
116
|
+
const SPLIT_LOOKBACK = 16;
|
|
117
117
|
|
|
118
118
|
/** source(Markdown のままの文書)の offset から始まる語が、頭の字を分けた語の残りか。 */
|
|
119
119
|
export const isSplitWord = (source: string, offset: number): boolean => SPLIT_HEAD.test(source.slice(Math.max(0, offset - SPLIT_LOOKBACK), offset));
|