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
package/src/cli.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
3
|
import { packageFor } from "./adapter-load.ts";
|
|
4
|
-
import { checkSource, crossChecked, type SourceCheck } from "./check-source.ts";
|
|
4
|
+
import { checkSource, crossChecked, silencedOf, type SourceCheck } from "./check-source.ts";
|
|
5
5
|
import { CONFIG_FILE, type Config } from "./config/load.ts";
|
|
6
6
|
import { applyLevel } from "./config/write.ts";
|
|
7
|
-
import { collectTargets, readDocumentFile } from "./files.ts";
|
|
7
|
+
import { collectFiles, collectTargets, readDocumentFile } from "./files.ts";
|
|
8
8
|
import { BASELINE_FILE, fingerprints, readBaseline, splitByBaseline, writeBaseline } from "./baseline.ts";
|
|
9
9
|
import type { PerFile } from "./render/suppressions.ts";
|
|
10
10
|
import { runSuppressions } from "./commands/suppressions.ts";
|
|
@@ -40,7 +40,7 @@ import { homedir } from "node:os";
|
|
|
40
40
|
import { settingWarnings } from "./config/warnings.ts";
|
|
41
41
|
import { readConfigIn } from "./config/read.ts";
|
|
42
42
|
import { settingSourcesOf } from "./config/option-problems.ts";
|
|
43
|
-
import { renderSummary, type FileOutcome } from "./render/summary.ts";
|
|
43
|
+
import { renderExcluded, renderSummary, type FileOutcome } from "./render/summary.ts";
|
|
44
44
|
import { aiScoreLineOf } from "./ai-score/lint-line.ts";
|
|
45
45
|
|
|
46
46
|
import type { Finding, Level, RuleDefinition } from "./plugin.ts";
|
|
@@ -50,7 +50,8 @@ import { notRunAmong } from "./not-run.ts";
|
|
|
50
50
|
import { settingProblems } from "./setting-problems.ts";
|
|
51
51
|
import { withExtensions } from "./extension/load.ts";
|
|
52
52
|
import { offOnlyAsExperimental } from "./experimental-alone.ts";
|
|
53
|
-
import { levelFor } from "./run.ts";
|
|
53
|
+
import { genreStop, levelFor } from "./run.ts";
|
|
54
|
+
import { REASONS } from "./reasons.ts";
|
|
54
55
|
import { DEFAULT_GENRE } from "./init-choice.ts";
|
|
55
56
|
import { stoppingOnYamlFileError } from "./config/yaml-file.ts";
|
|
56
57
|
|
|
@@ -110,7 +111,8 @@ const present = (check: SourceCheck, argv: readonly string[]): Inspected => {
|
|
|
110
111
|
const baseline = argv.includes("--show-baseline") ? undefined : readBaseline(join(process.cwd(), BASELINE_FILE));
|
|
111
112
|
const split = splitByBaseline(path, applied.kept, baseline, process.cwd());
|
|
112
113
|
const result = { ...raw, findings: split.fresh };
|
|
113
|
-
const
|
|
114
|
+
const counts = { shelved: split.shelved, hushed: applied.suppressed.length, allowed: applied.allowed.length };
|
|
115
|
+
const { header, notes } = fileHeader(path, source, language, { genre, from, unread }, counts);
|
|
114
116
|
const notRun = notRunAmong(applied.named, raw.skipped);
|
|
115
117
|
const text = argv.includes("--compact")
|
|
116
118
|
? renderCompact(header, result, rules, language)
|
|
@@ -121,7 +123,7 @@ const present = (check: SourceCheck, argv: readonly string[]): Inspected => {
|
|
|
121
123
|
language,
|
|
122
124
|
genre,
|
|
123
125
|
outcome: { path, findings: split.fresh, notRun: raw.skipped.length },
|
|
124
|
-
perFile: { path,
|
|
126
|
+
perFile: { path, notRun, ...silencedOf(applied) },
|
|
125
127
|
checked: { findings: split.fresh, rules, language, genre, genreFrom: from, skipped: raw.skipped },
|
|
126
128
|
kept: applied.kept,
|
|
127
129
|
};
|
|
@@ -161,10 +163,14 @@ const summaryLanguage = (results: readonly Inspected[], config: Config): UiLangu
|
|
|
161
163
|
};
|
|
162
164
|
|
|
163
165
|
const lint = async (targets: readonly string[], argv: readonly string[], config: Config): Promise<number> => {
|
|
164
|
-
const paths =
|
|
166
|
+
const { paths, excluded } = collectFiles(targets, config.include, config);
|
|
165
167
|
if (paths.length === 0) {
|
|
166
168
|
// 0 件を成功にすると「CI は通っているが何も検証していない」状態が続く。§14。
|
|
167
|
-
console.error(
|
|
169
|
+
console.error(
|
|
170
|
+
[hostText(config).noMarkdown(targets.join(", "), config.include ?? []), ...renderExcluded(excluded, hostLanguage(config.language, process.env))].join(
|
|
171
|
+
"\n",
|
|
172
|
+
),
|
|
173
|
+
);
|
|
168
174
|
return 1;
|
|
169
175
|
}
|
|
170
176
|
const language = config.language ?? "ja";
|
|
@@ -185,6 +191,7 @@ const lint = async (targets: readonly string[], argv: readonly string[], config:
|
|
|
185
191
|
renderSummary(
|
|
186
192
|
results.map((result) => result.outcome),
|
|
187
193
|
summaryLanguage(results, config),
|
|
194
|
+
excluded,
|
|
188
195
|
).forEach((line) => console.log(line));
|
|
189
196
|
return results.some((result) => result.outcome.findings.some((finding) => finding.severity === "error")) ? 1 : 0;
|
|
190
197
|
};
|
|
@@ -194,7 +201,7 @@ const lint = async (targets: readonly string[], argv: readonly string[], config:
|
|
|
194
201
|
* 差分だけを出す。workflow spec §11。
|
|
195
202
|
*/
|
|
196
203
|
const runWatch = async (targets: readonly string[], argv: readonly string[], config: Config): Promise<number> => {
|
|
197
|
-
const paths = collectTargets(targets, config.include);
|
|
204
|
+
const paths = collectTargets(targets, config.include, config);
|
|
198
205
|
const text = hostText(config);
|
|
199
206
|
if (paths.length === 0) {
|
|
200
207
|
console.error(text.noMarkdown(targets.join(", "), config.include ?? []));
|
|
@@ -239,12 +246,13 @@ const explain = (config: Config, ruleId: string | undefined, genreFlag: string |
|
|
|
239
246
|
const preset = genre === undefined ? {} : presetLevels(genre);
|
|
240
247
|
const current = levelFor(rule, config.rules, config.experimental, preset);
|
|
241
248
|
const alone = offOnlyAsExperimental(rule, config, genre ?? DEFAULT_GENRE, preset, language);
|
|
242
|
-
|
|
249
|
+
const stop = genre === undefined ? undefined : genreStop(rule, config.rules, preset, genre, REASONS[uiLanguageOf(language)]);
|
|
250
|
+
console.log(renderExplain(rule, current, language, genre, { ...settingSourcesOf(config, rule.id, language), offOnlyAsExperimental: alone, genreStop: stop }));
|
|
243
251
|
return 0;
|
|
244
252
|
};
|
|
245
253
|
|
|
246
254
|
const runBaseline = async (targets: readonly string[], argv: readonly string[], config: Config): Promise<number> => {
|
|
247
|
-
const paths = collectTargets(targets.length > 0 ? targets : ["."], config.include);
|
|
255
|
+
const paths = collectTargets(targets.length > 0 ? targets : ["."], config.include, config);
|
|
248
256
|
if (paths.length === 0) {
|
|
249
257
|
console.error(hostText(config).noMarkdownHere(config.include ?? []));
|
|
250
258
|
return 1;
|
|
@@ -295,12 +303,7 @@ const HANDLERS: Readonly<Record<string, Handler>> = {
|
|
|
295
303
|
runFixPlan(fixPlanTargets(argv), argv, { ...treeContext(config), check: async (path) => (await inspectAll(config, argv)(path)).checked }),
|
|
296
304
|
baseline: (argv, config) => runBaseline(positional(argv), argv, config),
|
|
297
305
|
suppressions: (argv, config) =>
|
|
298
|
-
runSuppressions(
|
|
299
|
-
positional(argv),
|
|
300
|
-
(paths) => inspectRun(paths, config, [...argv, "--show-baseline"]),
|
|
301
|
-
hostLanguage(config.language, process.env),
|
|
302
|
-
config.include,
|
|
303
|
-
),
|
|
306
|
+
runSuppressions(positional(argv), (paths) => inspectRun(paths, config, [...argv, "--show-baseline"]), hostLanguage(config.language, process.env), config),
|
|
304
307
|
relax: (argv, config) => changeSetting(config, "relaxed", argv[1], flag(argv, "--why")),
|
|
305
308
|
strict: (argv, config) => changeSetting(config, "strict", argv[1], flag(argv, "--why")),
|
|
306
309
|
off: (argv, config) => changeSetting(config, "off", argv[1], flag(argv, "--why")),
|
package/src/commands/eval.ts
CHANGED
|
@@ -53,7 +53,7 @@ export type Context = {
|
|
|
53
53
|
* 測った結果は文書の言語で出す(混ざっていれば測らないので、言語は 1 つ)。断りは ui の言語。
|
|
54
54
|
*/
|
|
55
55
|
export const runEval = async (targets: readonly string[], argv: readonly string[], context: Context): Promise<number> => {
|
|
56
|
-
const paths = collectTargets(targets.length > 0 ? targets : ["."], context.config.include);
|
|
56
|
+
const paths = collectTargets(targets.length > 0 ? targets : ["."], context.config.include, context.config);
|
|
57
57
|
if (paths.length === 0) {
|
|
58
58
|
console.error(CLI_TEXT[context.ui].noMarkdown(targets.join(", "), context.config.include ?? []));
|
|
59
59
|
return 1;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { collectTargets } from "../files.ts";
|
|
1
|
+
import { collectTargets, type Exclusion } from "../files.ts";
|
|
2
2
|
import { renderSuppressions, type PerFile } from "../render/suppressions.ts";
|
|
3
3
|
import type { UiLanguage } from "../ui.ts";
|
|
4
4
|
|
|
@@ -7,9 +7,9 @@ export const runSuppressions = async (
|
|
|
7
7
|
targets: readonly string[],
|
|
8
8
|
inspectRun: (paths: readonly string[]) => Promise<readonly { readonly perFile: PerFile }[]>,
|
|
9
9
|
ui: UiLanguage,
|
|
10
|
-
|
|
10
|
+
files: Exclusion & { readonly include?: readonly string[] | undefined },
|
|
11
11
|
): Promise<number> => {
|
|
12
|
-
const inspected = await inspectRun(collectTargets(targets.length > 0 ? targets : ["."], include));
|
|
12
|
+
const inspected = await inspectRun(collectTargets(targets.length > 0 ? targets : ["."], files.include, files));
|
|
13
13
|
console.log(
|
|
14
14
|
renderSuppressions(
|
|
15
15
|
inspected.map((file) => file.perFile),
|
package/src/commands/test.ts
CHANGED
|
@@ -163,7 +163,7 @@ const notRunNotice = (why: string, what: string, envFile: string | undefined, la
|
|
|
163
163
|
* 見出しと指摘は文書の言語、締めは文書がそろっていればその言語、混ざっていれば ui の言語。
|
|
164
164
|
*/
|
|
165
165
|
export const runTest = async (targets: readonly string[], argv: readonly string[], context: TestContext): Promise<number> => {
|
|
166
|
-
const paths = collectTargets(targets.length > 0 ? targets : ["."], context.config.include);
|
|
166
|
+
const paths = collectTargets(targets.length > 0 ? targets : ["."], context.config.include, context.config);
|
|
167
167
|
if (paths.length === 0) {
|
|
168
168
|
console.error(CLI_TEXT[context.ui].noMarkdown(targets.join(", "), context.config.include ?? []));
|
|
169
169
|
return 1;
|
package/src/composite-signals.ts
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
import type { Finding } from "./plugin.ts";
|
|
1
|
+
import type { Finding, RuleDefinition } from "./plugin.ts";
|
|
2
|
+
import { localized } from "./render/text.ts";
|
|
3
|
+
|
|
4
|
+
/** The signals as a reader knows them: each rule's name in the language, its id where no rule of that id is loaded. */
|
|
5
|
+
export const signalNames = (ids: readonly string[], rules: readonly Pick<RuleDefinition, "id" | "name">[], language: string): string[] =>
|
|
6
|
+
ids.map((id) => {
|
|
7
|
+
const name = rules.find((rule) => rule.id === id)?.name;
|
|
8
|
+
const words = name === undefined ? "" : localized(name, language);
|
|
9
|
+
return words === "" ? id : words;
|
|
10
|
+
});
|
|
2
11
|
|
|
3
12
|
/** A finding that adds up measures names here the rules that read the same shapes as some of them (ai-structure). */
|
|
4
13
|
export const SAME_SHAPE_VALUE = "same_shape_rules";
|
package/src/compound-head.ts
CHANGED
|
@@ -9,17 +9,26 @@ const isTouching = (left: Token | undefined, right: Token | undefined): boolean
|
|
|
9
9
|
const isNounBefore = (token: Token, next: Token | undefined, suffixes: ReadonlySet<string>): next is Token =>
|
|
10
10
|
next?.pos === "NOUN" && isTouching(token, next) && !suffixes.has(next.surface);
|
|
11
11
|
|
|
12
|
-
/** A noun alone in brackets that close onto a noun (卒業(見込)証明書): the brackets mark it optional inside one compound. */
|
|
13
|
-
const
|
|
12
|
+
/** A noun alone in brackets that close onto a noun (卒業(見込)証明書): the brackets mark it optional inside one compound. That noun. */
|
|
13
|
+
const nounAfterBrackets = (token: Token, tokens: readonly Token[], at: number, suffixes: ReadonlySet<string>): Token | undefined => {
|
|
14
14
|
const [opening, closing] = [tokens[at - 1], tokens[at + 1]];
|
|
15
|
-
if (opening === undefined || closing === undefined) return
|
|
16
|
-
if (!OPENING.has(opening.surface) || !CLOSING.has(closing.surface) || !isTouching(opening, token) || !isTouching(token, closing)) return
|
|
17
|
-
|
|
15
|
+
if (opening === undefined || closing === undefined) return undefined;
|
|
16
|
+
if (!OPENING.has(opening.surface) || !CLOSING.has(closing.surface) || !isTouching(opening, token) || !isTouching(token, closing)) return undefined;
|
|
17
|
+
const next = tokens[at + 2];
|
|
18
|
+
return isNounBefore(closing, next, suffixes) ? next : undefined;
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
|
-
*
|
|
22
|
-
* drop its okurigana. A listed phrase suffix (割当て等) does not make a compound. `token`
|
|
22
|
+
* The noun `token`, read at `at` in `tokens`, is written onto (事業者 of 取扱事業者), when `token` is a noun at the head of a
|
|
23
|
+
* compound, so official Japanese may drop its okurigana. A listed phrase suffix (割当て等) does not make a compound. `token`
|
|
24
|
+
* may be tokens[at] read as a noun.
|
|
23
25
|
*/
|
|
26
|
+
export const compoundTailOf = (token: Token, tokens: readonly Token[], at: number, suffixes: ReadonlySet<string>): Token | undefined => {
|
|
27
|
+
if (token.pos !== "NOUN") return undefined;
|
|
28
|
+
const next = tokens[at + 1];
|
|
29
|
+
return isNounBefore(token, next, suffixes) ? next : nounAfterBrackets(token, tokens, at, suffixes);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/** Whether `token`, read at `at` in `tokens`, is a noun written onto the noun after it (取扱事業者). */
|
|
24
33
|
export const isCompoundHead = (token: Token, tokens: readonly Token[], at: number, suffixes: ReadonlySet<string>): boolean =>
|
|
25
|
-
|
|
34
|
+
compoundTailOf(token, tokens, at, suffixes) !== undefined;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { Config } from "./load.ts";
|
|
2
|
+
import type { RuleDefinition } from "../plugin.ts";
|
|
3
|
+
import type { Texts, UiLanguage } from "../ui.ts";
|
|
4
|
+
import { allowOf, type AllowProblem } from "../allow.ts";
|
|
5
|
+
import { MAX_PATTERN_LENGTH, MAX_REPEATS, type RegexRefusal } from "../custom/regex-safety.ts";
|
|
6
|
+
|
|
7
|
+
type Text = {
|
|
8
|
+
readonly problem: Readonly<Record<AllowProblem["kind"], (at: string) => string>>;
|
|
9
|
+
readonly refusal: Readonly<Record<RegexRefusal, string>>;
|
|
10
|
+
readonly unknownRule: (at: string, id: string) => string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const TEXT: Texts<Text> = {
|
|
14
|
+
ja: {
|
|
15
|
+
problem: {
|
|
16
|
+
"not-a-list": (written) => `allow は項目の並びで書いてください(- text: … と reason: …)。読めなかった値: ${written}`,
|
|
17
|
+
"not-a-map": (at) => `${at}: text(または pattern)と reason を持つ項目として書いてください`,
|
|
18
|
+
"no-reason": (at) => `${at}: reason がありません。なぜ指摘しなくてよいのかを書いてください(chaff suppressions に並びます)`,
|
|
19
|
+
"no-target": (at) => `${at}: text(そのままの文字列)か pattern(正規表現)のどちらかを書いてください`,
|
|
20
|
+
"both-targets": (at) => `${at}: text と pattern の両方があります。どちらか一つにしてください`,
|
|
21
|
+
"bad-rules": (at) => `${at}: rules はルール名の並びで書いてください([preferred-term] や [preferred-term, spelling-consistency])`,
|
|
22
|
+
"bad-files": (at) => `${at}: files は glob の並びで書いてください(["docs/**/*.md"])`,
|
|
23
|
+
"bad-pattern": (at) => `${at}: pattern を使えません。`,
|
|
24
|
+
},
|
|
25
|
+
refusal: {
|
|
26
|
+
"too-long": `${String(MAX_PATTERN_LENGTH)} 字を超えています。いくつかの項目に分けてください`,
|
|
27
|
+
"nested-quantifier": "繰り返しの中に繰り返しがあります((a+)+ のような形)。長い行で止まらなくなるので使えません",
|
|
28
|
+
"too-many-repeats": `回数の決まらない繰り返し(* や + や {1,9})が ${String(MAX_REPEATS)} つを超えています。長い行で止まらなくなることがあります`,
|
|
29
|
+
backreference: "後方参照(\\1)は使えません。長い行で止まらなくなることがあるためです",
|
|
30
|
+
"empty-match": "何も無い所にも当たります。すべての指摘が消えてしまいます",
|
|
31
|
+
invalid: "正規表現として読めません",
|
|
32
|
+
},
|
|
33
|
+
unknownRule: (at, id) => `${at}: rules の ${id} というルールはありません(npx chaffjs rules --json で一覧が出ます)`,
|
|
34
|
+
},
|
|
35
|
+
en: {
|
|
36
|
+
problem: {
|
|
37
|
+
"not-a-list": (written) => `write allow as a list of entries (- text: … with reason: …); could not read ${written}`,
|
|
38
|
+
"not-a-map": (at) => `${at}: write each entry with text (or pattern) and reason`,
|
|
39
|
+
"no-reason": (at) => `${at}: reason is missing; say why this need not be reported (chaff suppressions lists it)`,
|
|
40
|
+
"no-target": (at) => `${at}: write either text (a literal string) or pattern (a regular expression)`,
|
|
41
|
+
"both-targets": (at) => `${at}: has both text and pattern; keep one`,
|
|
42
|
+
"bad-rules": (at) => `${at}: write rules as a list of rule ids ([preferred-term] or [preferred-term, spelling-consistency])`,
|
|
43
|
+
"bad-files": (at) => `${at}: write files as a list of globs (["docs/**/*.md"])`,
|
|
44
|
+
"bad-pattern": (at) => `${at}: the pattern cannot be used: `,
|
|
45
|
+
},
|
|
46
|
+
refusal: {
|
|
47
|
+
"too-long": `it is longer than ${String(MAX_PATTERN_LENGTH)} characters; split it into several entries`,
|
|
48
|
+
"nested-quantifier": "it repeats something that repeats (a shape like (a+)+), which can run for minutes on a long line",
|
|
49
|
+
"too-many-repeats": `it has more than ${String(MAX_REPEATS)} repeats of varying count (*, + or {1,9}), which can run for minutes on a long line`,
|
|
50
|
+
backreference: "backreferences (\\1) are not allowed, since they can run for minutes on a long line",
|
|
51
|
+
"empty-match": "it matches an empty string, so it would silence every finding",
|
|
52
|
+
invalid: "it is not a regular expression",
|
|
53
|
+
},
|
|
54
|
+
unknownRule: (at, id) => `${at}: there is no rule named ${id} under rules (npx chaffjs rules --json lists them)`,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const sentenceOf = (problem: AllowProblem, text: Text): string => {
|
|
59
|
+
if (problem.kind === "not-a-list") return text.problem[problem.kind](problem.written);
|
|
60
|
+
const head = text.problem[problem.kind](problem.at);
|
|
61
|
+
return problem.kind === "bad-pattern" ? `${head}${text.refusal[problem.refusal]}` : head;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/** What in allow: cannot be used. Each stops the run, as an unreadable custom rule does: an allowance without its reason is not taken. */
|
|
65
|
+
export const allowProblems = (config: Pick<Config, "allow" | "path">, ui: UiLanguage): string[] =>
|
|
66
|
+
allowOf(config.allow).problems.map((problem) => `chaff: ${config.path ?? "chaff.yaml"}: ${sentenceOf(problem, TEXT[ui])}`);
|
|
67
|
+
|
|
68
|
+
/** Rule ids under an entry's rules: that chaff does not have. Said before the results, like an unknown id under rules:. */
|
|
69
|
+
export const allowRuleWarnings = (config: Pick<Config, "allow" | "path">, known: readonly Pick<RuleDefinition, "id">[], ui: UiLanguage): string[] => {
|
|
70
|
+
const ids = new Set(known.map((rule) => rule.id));
|
|
71
|
+
const where = config.path ?? "chaff.yaml";
|
|
72
|
+
return allowOf(config.allow).entries.flatMap((entry) =>
|
|
73
|
+
entry.rules.filter((id) => !ids.has(id)).map((id) => `${where}: ${TEXT[ui].unknownRule(entry.at, id)}`),
|
|
74
|
+
);
|
|
75
|
+
};
|
|
@@ -1,17 +1,43 @@
|
|
|
1
1
|
import type { Config } from "./load.ts";
|
|
2
|
+
import type { PathRule } from "./by-path.ts";
|
|
3
|
+
import { byPathSource } from "./by-path-rules.ts";
|
|
4
|
+
import { ruleProblems } from "./rule-problems.ts";
|
|
5
|
+
import { configOptionProblems } from "./option-problems.ts";
|
|
6
|
+
import type { RuleDefinition } from "../plugin.ts";
|
|
2
7
|
import type { Texts, UiLanguage } from "../ui.ts";
|
|
3
8
|
|
|
4
|
-
const TEXT: Texts<{ readonly unreadable: (where: string, value: string) => string }> = {
|
|
9
|
+
const TEXT: Texts<{ readonly unreadable: (where: string, value: string) => string; readonly rulesNotAMap: (where: string, value: string) => string }> = {
|
|
5
10
|
ja: {
|
|
6
11
|
unreadable: (where, value) =>
|
|
7
|
-
`${where}: by_path の ${value} は読めないので使いません。by_path は files と、genre・language・profile の組を並べます(- files: ["guides/**/*.md"] と genre: docs/manual)`,
|
|
12
|
+
`${where}: by_path の ${value} は読めないので使いません。by_path は files と、genre・language・profile・rules・options の組を並べます(- files: ["guides/**/*.md"] と genre: docs/manual)`,
|
|
13
|
+
rulesNotAMap: (where, value) =>
|
|
14
|
+
`${where}: rules の ${value} は読めません。ルールの名前と段階(strict / normal / relaxed / off か、正の数)を並べてください`,
|
|
8
15
|
},
|
|
9
16
|
en: {
|
|
10
17
|
unreadable: (where, value) =>
|
|
11
|
-
`${where}: cannot read ${value} under by_path, so it is not used. by_path is a list of files with genre, language or
|
|
18
|
+
`${where}: cannot read ${value} under by_path, so it is not used. by_path is a list of files with genre, language, profile, rules or options (- files: ["guides/**/*.md"] with genre: docs/manual)`,
|
|
19
|
+
rulesNotAMap: (where, value) =>
|
|
20
|
+
`${where}: cannot read ${value} under rules. List rule names with a level (strict / normal / relaxed / off, or a positive number)`,
|
|
12
21
|
},
|
|
13
22
|
};
|
|
14
23
|
|
|
15
24
|
/** chaff.yaml の by_path のうち、読めなかったもの。 */
|
|
16
25
|
export const byPathProblems = (config: Pick<Config, "unreadableByPath" | "path">, ui: UiLanguage = "ja"): string[] =>
|
|
17
26
|
(config.unreadableByPath ?? []).map((value) => TEXT[ui].unreadable(config.path ?? "chaff.yaml", value));
|
|
27
|
+
|
|
28
|
+
/** One entry's rules: and options: that change nothing, said as the top-level ones are, with the entry named. */
|
|
29
|
+
const entryProblems = (entry: PathRule, file: string, rules: readonly RuleDefinition[], ui: UiLanguage): string[] => {
|
|
30
|
+
const where = `${file} (${byPathSource(entry)})`;
|
|
31
|
+
const blocks = entry.unreadableBlocks ?? [];
|
|
32
|
+
const rulesBlock = blocks.find((block) => block.key === "rules");
|
|
33
|
+
const optionsBlock = blocks.find((block) => block.key === "options");
|
|
34
|
+
return [
|
|
35
|
+
...(rulesBlock === undefined ? [] : [TEXT[ui].rulesNotAMap(where, rulesBlock.value)]),
|
|
36
|
+
...ruleProblems({ rules: entry.rules ?? {}, limits: entry.limits ?? {}, unreadableRules: entry.unreadableRules ?? [], path: where }, rules, ui),
|
|
37
|
+
...configOptionProblems({ options: entry.options ?? {}, unreadableOptions: optionsBlock?.value, path: where }, rules, ui),
|
|
38
|
+
];
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** The by_path entries' rules: and options: that have no effect: an unknown rule, a value that is not a level, an option that does not apply. */
|
|
42
|
+
export const byPathRuleProblems = (config: Pick<Config, "byPath" | "path">, rules: readonly RuleDefinition[], ui: UiLanguage = "ja"): string[] =>
|
|
43
|
+
config.byPath.flatMap((entry) => entryProblems(entry, config.path ?? "chaff.yaml", rules, ui));
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { matches, type PathRule } from "./by-path.ts";
|
|
2
|
+
import type { Config } from "./load.ts";
|
|
3
|
+
import type { Level } from "../plugin.ts";
|
|
4
|
+
import type { OptionLayer } from "../rule-options.ts";
|
|
5
|
+
|
|
6
|
+
/** How a by_path entry is named where a setting's source is shown (the rules that did not run, explain, rules --json). */
|
|
7
|
+
export const byPathSource = (entry: Pick<PathRule, "files">): string => `by_path: ${entry.files.join(", ")}`;
|
|
8
|
+
|
|
9
|
+
/** What the by_path entries matching one file set on rules, merged: the later entry wins, as it does for genre. */
|
|
10
|
+
export type PathRuleSettings = {
|
|
11
|
+
readonly rules: Readonly<Record<string, Level>>;
|
|
12
|
+
readonly limits: Readonly<Record<string, number>>;
|
|
13
|
+
/** For each rule whose level an entry set, the entry that set it last. */
|
|
14
|
+
readonly levelsFrom: Readonly<Record<string, string>>;
|
|
15
|
+
/** The entries' options, strongest (latest) first. */
|
|
16
|
+
readonly optionLayers: readonly OptionLayer[];
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const NOTHING: PathRuleSettings = { rules: {}, limits: {}, levelsFrom: {}, optionLayers: [] };
|
|
20
|
+
|
|
21
|
+
const without = <T>(record: Readonly<Record<string, T>>, ids: readonly string[]): Record<string, T> =>
|
|
22
|
+
Object.fromEntries(Object.entries(record).filter(([id]) => !ids.includes(id)));
|
|
23
|
+
|
|
24
|
+
/** One more entry over what the earlier ones set. A word it writes drops an earlier number for that rule: the word is the newer setting. */
|
|
25
|
+
const overlay = (settings: PathRuleSettings, entry: PathRule): PathRuleSettings => {
|
|
26
|
+
const source = byPathSource(entry);
|
|
27
|
+
const levels = entry.rules ?? {};
|
|
28
|
+
const ids = Object.keys(levels);
|
|
29
|
+
const options = entry.options ?? {};
|
|
30
|
+
return {
|
|
31
|
+
rules: { ...settings.rules, ...levels },
|
|
32
|
+
limits: { ...without(settings.limits, ids), ...entry.limits },
|
|
33
|
+
levelsFrom: { ...settings.levelsFrom, ...Object.fromEntries(ids.map((id) => [id, source])) },
|
|
34
|
+
optionLayers: Object.keys(options).length === 0 ? settings.optionLayers : [{ from: source, values: options }, ...settings.optionLayers],
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** The entries in the order written, merged. */
|
|
39
|
+
export const mergePathRules = (entries: readonly PathRule[]): PathRuleSettings => entries.reduce(overlay, NOTHING);
|
|
40
|
+
|
|
41
|
+
/** The by_path entries whose files match this path, matched from the folder of the settings file, in the order written. */
|
|
42
|
+
export const entriesFor = (byPath: readonly PathRule[], base: string, path: string): PathRule[] =>
|
|
43
|
+
byPath.filter((entry) => entry.files.some((glob) => matches(glob, base, path)));
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The settings one file is checked with. Strongest first: the matching by_path entries' rules and options (the last one
|
|
47
|
+
* written first), chaff.yaml's own rules and options, its style, the genre's preset, the rule's default.
|
|
48
|
+
* A level by_path sets also drops a number chaff.yaml or the style set for that rule, since the level is the closer setting.
|
|
49
|
+
*/
|
|
50
|
+
export const configForPath = (config: Config, path: string): Config => {
|
|
51
|
+
const settings = mergePathRules(entriesFor(config.byPath, config.baseDir, path));
|
|
52
|
+
const ids = Object.keys(settings.rules);
|
|
53
|
+
if (ids.length === 0 && settings.optionLayers.length === 0) return config;
|
|
54
|
+
const { applied } = config;
|
|
55
|
+
return {
|
|
56
|
+
...config,
|
|
57
|
+
rules: { ...config.rules, ...settings.rules },
|
|
58
|
+
limits: { ...without(config.limits, ids), ...settings.limits },
|
|
59
|
+
applied:
|
|
60
|
+
applied === undefined
|
|
61
|
+
? undefined
|
|
62
|
+
: { ...applied, levelsFrom: applied.levelsFrom.filter((id) => !ids.includes(id)), limits: without(applied.limits, ids) },
|
|
63
|
+
pathLevelsFrom: settings.levelsFrom,
|
|
64
|
+
pathOptionLayers: settings.optionLayers,
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** One by_path entry's setting for one rule, for explain and rules --json, which speak of no one file. */
|
|
69
|
+
export type PathRuleLevel = { readonly files: readonly string[]; readonly level: Level; readonly limit?: number };
|
|
70
|
+
|
|
71
|
+
/** Every by_path entry that sets this rule's level or number, in the order written. */
|
|
72
|
+
export const pathLevelsOf = (byPath: readonly PathRule[], ruleId: string): PathRuleLevel[] =>
|
|
73
|
+
byPath.flatMap((entry): PathRuleLevel[] => {
|
|
74
|
+
const level = entry.rules?.[ruleId];
|
|
75
|
+
if (level === undefined) return [];
|
|
76
|
+
const limit = entry.limits?.[ruleId];
|
|
77
|
+
return [limit === undefined ? { files: entry.files, level } : { files: entry.files, level, limit }];
|
|
78
|
+
});
|
package/src/config/by-path.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { relative, sep } from "node:path";
|
|
2
|
+
import type { Level } from "../plugin.ts";
|
|
2
3
|
|
|
3
4
|
export type PathRule = {
|
|
4
5
|
readonly files: readonly string[];
|
|
5
6
|
readonly genre: string | undefined;
|
|
6
7
|
readonly language: string | undefined;
|
|
7
8
|
readonly profile?: string | undefined;
|
|
9
|
+
/** The entry's rules:, read as the top-level rules: is (levels; a number counts as normal and sits in limits). */
|
|
10
|
+
readonly rules?: Readonly<Record<string, Level>>;
|
|
11
|
+
readonly limits?: Readonly<Record<string, number>>;
|
|
12
|
+
readonly unreadableRules?: readonly { readonly id: string; readonly value: string }[];
|
|
13
|
+
/** The entry's options:, shaped as the top-level options: is ({ rule id: { option: value } }). */
|
|
14
|
+
readonly options?: Readonly<Record<string, unknown>>;
|
|
15
|
+
/** rules: or options: written as something other than a map, as written. */
|
|
16
|
+
readonly unreadableBlocks?: readonly { readonly key: "rules" | "options"; readonly value: string }[];
|
|
8
17
|
};
|
|
9
18
|
|
|
10
19
|
/**
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Config } from "./load.ts";
|
|
2
|
+
import type { Texts, UiLanguage } from "../ui.ts";
|
|
3
|
+
|
|
4
|
+
type ConsistentTexts = {
|
|
5
|
+
readonly unreadable: (where: string, value: string) => string;
|
|
6
|
+
readonly twice: (where: string, member: string) => string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const TEXT: Texts<ConsistentTexts> = {
|
|
10
|
+
ja: {
|
|
11
|
+
unreadable: (where, value) =>
|
|
12
|
+
`${where}: consistent の ${value} は組として読めません。consistent には、まぜない語の組を、違う語 2 つ以上の並びで 1 行に 1 つずつ書いてください(- [顧客, お客様])`,
|
|
13
|
+
twice: (where, member) =>
|
|
14
|
+
`${where}: consistent で「${member}」が二つの組に入っています。どちらの組の語と比べるか決まらないので、一つの組にまとめてください`,
|
|
15
|
+
},
|
|
16
|
+
en: {
|
|
17
|
+
unreadable: (where, value) =>
|
|
18
|
+
`${where}: cannot read ${value} under consistent as a group. Write each group as a list of two or more different words, one group per line (- [log in, sign in])`,
|
|
19
|
+
twice: (where, member) => `${where}: "${member}" is in two groups under consistent. It cannot be told which to compare it with; put them in one group`,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** Members listed in more than one group, each once, in the order they first repeat. */
|
|
24
|
+
const repeatedMembers = (groups: readonly (readonly string[])[]): string[] => {
|
|
25
|
+
const members = groups.flatMap((group) => [...new Set(group)]);
|
|
26
|
+
return [...new Set(members.filter((member, at) => members.indexOf(member) !== at))];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** What under consistent in chaff.yaml has no effect or no clear effect: values not read as groups, and words in two groups. */
|
|
30
|
+
export const consistentProblems = (config: Pick<Config, "consistent" | "unreadableConsistent" | "path">, ui: UiLanguage = "ja"): string[] => {
|
|
31
|
+
const where = config.path ?? "chaff.yaml";
|
|
32
|
+
return [
|
|
33
|
+
...(config.unreadableConsistent ?? []).map((value) => TEXT[ui].unreadable(where, value)),
|
|
34
|
+
...repeatedMembers(config.consistent ?? []).map((member) => TEXT[ui].twice(where, member)),
|
|
35
|
+
];
|
|
36
|
+
};
|