@redocly/recheck 0.14.0 → 2.58.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.md +71 -1869
- package/examples/appendices/google.appendix.yaml +1 -1
- package/examples/appendices/inclusive-language.appendix.yaml +1 -1
- package/examples/appendices/microsoft.appendix.yaml +1 -1
- package/examples/appendices/plain-language.appendix.yaml +1 -1
- package/examples/appendices/technical-english.appendix.yaml +1 -1
- package/examples/google.yaml +7 -7
- package/examples/inclusive-language.yaml +7 -7
- package/examples/microsoft.yaml +7 -7
- package/examples/plain-language.yaml +7 -7
- package/examples/technical-english.yaml +7 -7
- package/lib/actions/baseline.d.ts +15 -0
- package/lib/actions/baseline.d.ts.map +1 -0
- package/lib/actions/baseline.js +51 -0
- package/lib/actions/baseline.js.map +1 -0
- package/lib/actions/lint.d.ts +51 -0
- package/lib/actions/lint.d.ts.map +1 -0
- package/lib/actions/lint.js +123 -0
- package/lib/actions/lint.js.map +1 -0
- package/lib/actions/markdoc-schema.d.ts +34 -0
- package/lib/actions/markdoc-schema.d.ts.map +1 -0
- package/lib/actions/markdoc-schema.js +106 -0
- package/lib/actions/markdoc-schema.js.map +1 -0
- package/lib/actions/readability.d.ts +25 -0
- package/lib/actions/readability.d.ts.map +1 -0
- package/lib/actions/readability.js +47 -0
- package/lib/actions/readability.js.map +1 -0
- package/lib/actions/roots.d.ts +7 -0
- package/lib/actions/roots.d.ts.map +1 -0
- package/lib/actions/roots.js +36 -0
- package/lib/actions/roots.js.map +1 -0
- package/lib/config/presets/api-descriptions.d.ts +8 -0
- package/lib/config/presets/api-descriptions.d.ts.map +1 -0
- package/lib/config/presets/api-descriptions.js +24 -0
- package/lib/config/presets/api-descriptions.js.map +1 -0
- package/lib/config/presets/google.d.ts +3 -0
- package/lib/config/presets/google.d.ts.map +1 -0
- package/lib/config/presets/google.js +1086 -0
- package/lib/config/presets/google.js.map +1 -0
- package/lib/config/presets/inclusive-language.d.ts +3 -0
- package/lib/config/presets/inclusive-language.d.ts.map +1 -0
- package/lib/config/presets/inclusive-language.js +151 -0
- package/lib/config/presets/inclusive-language.js.map +1 -0
- package/lib/config/presets/index.d.ts +16 -0
- package/lib/config/presets/index.d.ts.map +1 -0
- package/lib/config/presets/index.js +38 -0
- package/lib/config/presets/index.js.map +1 -0
- package/lib/config/presets/markdoc.d.ts +3 -0
- package/lib/config/presets/markdoc.d.ts.map +1 -0
- package/lib/config/presets/markdoc.js +45 -0
- package/lib/config/presets/markdoc.js.map +1 -0
- package/lib/config/presets/markdown-relaxed.d.ts +3 -0
- package/lib/config/presets/markdown-relaxed.d.ts.map +1 -0
- package/lib/config/presets/markdown-relaxed.js +34 -0
- package/lib/config/presets/markdown-relaxed.js.map +1 -0
- package/lib/config/presets/markdown.d.ts +11 -0
- package/lib/config/presets/markdown.d.ts.map +1 -0
- package/lib/config/presets/markdown.js +73 -0
- package/lib/config/presets/markdown.js.map +1 -0
- package/lib/config/presets/microsoft.d.ts +3 -0
- package/lib/config/presets/microsoft.d.ts.map +1 -0
- package/lib/config/presets/microsoft.js +1260 -0
- package/lib/config/presets/microsoft.js.map +1 -0
- package/lib/config/presets/minimal.d.ts +3 -0
- package/lib/config/presets/minimal.d.ts.map +1 -0
- package/lib/config/presets/minimal.js +13 -0
- package/lib/config/presets/minimal.js.map +1 -0
- package/lib/config/presets/plain-language.d.ts +3 -0
- package/lib/config/presets/plain-language.d.ts.map +1 -0
- package/lib/config/presets/plain-language.js +175 -0
- package/lib/config/presets/plain-language.js.map +1 -0
- package/lib/config/presets/prose.d.ts +3 -0
- package/lib/config/presets/prose.d.ts.map +1 -0
- package/lib/config/presets/prose.js +60 -0
- package/lib/config/presets/prose.js.map +1 -0
- package/lib/config/presets/technical-english.d.ts +22 -0
- package/lib/config/presets/technical-english.d.ts.map +1 -0
- package/lib/config/presets/technical-english.js +61 -0
- package/lib/config/presets/technical-english.js.map +1 -0
- package/lib/config/resolve.d.ts +36 -0
- package/lib/config/resolve.d.ts.map +1 -0
- package/lib/config/resolve.js +106 -0
- package/lib/config/resolve.js.map +1 -0
- package/lib/config/schema.d.ts +215 -0
- package/lib/config/schema.d.ts.map +1 -0
- package/lib/config/schema.js +152 -0
- package/lib/config/schema.js.map +1 -0
- package/lib/config/validate.d.ts +19 -0
- package/lib/config/validate.d.ts.map +1 -0
- package/lib/config/validate.js +1049 -0
- package/lib/config/validate.js.map +1 -0
- package/lib/core/auto-fix.d.ts.map +1 -0
- package/lib/core/auto-fix.js +94 -0
- package/lib/core/auto-fix.js.map +1 -0
- package/lib/core/baseline.d.ts +43 -0
- package/lib/core/baseline.d.ts.map +1 -0
- package/lib/core/baseline.js +142 -0
- package/lib/core/baseline.js.map +1 -0
- package/lib/core/case-preserve.d.ts +11 -0
- package/lib/core/case-preserve.d.ts.map +1 -0
- package/lib/core/case-preserve.js +22 -0
- package/lib/core/case-preserve.js.map +1 -0
- package/lib/core/directives.d.ts.map +1 -0
- package/lib/core/directives.js +66 -0
- package/lib/core/directives.js.map +1 -0
- package/lib/core/files.d.ts +31 -0
- package/lib/core/files.d.ts.map +1 -0
- package/lib/core/files.js +184 -0
- package/lib/core/files.js.map +1 -0
- package/lib/core/inline-code.d.ts +33 -0
- package/lib/core/inline-code.d.ts.map +1 -0
- package/lib/core/inline-code.js +50 -0
- package/lib/core/inline-code.js.map +1 -0
- package/lib/core/line-endings.d.ts +13 -0
- package/lib/core/line-endings.d.ts.map +1 -0
- package/lib/core/line-endings.js +39 -0
- package/lib/core/line-endings.js.map +1 -0
- package/lib/core/markdoc-tags.d.ts +48 -0
- package/lib/core/markdoc-tags.d.ts.map +1 -0
- package/lib/core/markdoc-tags.js +102 -0
- package/lib/core/markdoc-tags.js.map +1 -0
- package/lib/core/prose-extract.d.ts +6 -0
- package/lib/core/prose-extract.d.ts.map +1 -0
- package/lib/core/prose-extract.js +71 -0
- package/lib/core/prose-extract.js.map +1 -0
- package/lib/core/readability.d.ts +17 -0
- package/lib/core/readability.d.ts.map +1 -0
- package/lib/core/readability.js +34 -0
- package/lib/core/readability.js.map +1 -0
- package/lib/core/rule-filters.d.ts +29 -0
- package/lib/core/rule-filters.d.ts.map +1 -0
- package/lib/core/rule-filters.js +88 -0
- package/lib/core/rule-filters.js.map +1 -0
- package/lib/core/runner.d.ts +60 -0
- package/lib/core/runner.d.ts.map +1 -0
- package/lib/core/runner.js +305 -0
- package/lib/core/runner.js.map +1 -0
- package/lib/core/summary.d.ts +4 -0
- package/lib/core/summary.d.ts.map +1 -0
- package/lib/core/summary.js +37 -0
- package/lib/core/summary.js.map +1 -0
- package/lib/core/timing.d.ts +9 -0
- package/lib/core/timing.d.ts.map +1 -0
- package/lib/core/timing.js +19 -0
- package/lib/core/timing.js.map +1 -0
- package/lib/data/markdoc-realm-schema.d.ts.map +1 -0
- package/lib/data/markdoc-realm-schema.js +782 -0
- package/lib/data/markdoc-realm-schema.js.map +1 -0
- package/lib/data/proper-nouns.d.ts.map +1 -0
- package/lib/data/proper-nouns.js +42 -0
- package/lib/data/proper-nouns.js.map +1 -0
- package/lib/data/realm-front-matter-schema.d.ts +12 -0
- package/lib/data/realm-front-matter-schema.d.ts.map +1 -0
- package/lib/data/realm-front-matter-schema.js +51 -0
- package/lib/data/realm-front-matter-schema.js.map +1 -0
- package/lib/index.d.ts +81 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +114 -0
- package/lib/index.js.map +1 -0
- package/lib/metrics/formulas.d.ts +9 -0
- package/lib/metrics/formulas.d.ts.map +1 -0
- package/lib/metrics/formulas.js +59 -0
- package/lib/metrics/formulas.js.map +1 -0
- package/lib/metrics/statistics.d.ts +14 -0
- package/lib/metrics/statistics.d.ts.map +1 -0
- package/lib/metrics/statistics.js +35 -0
- package/lib/metrics/statistics.js.map +1 -0
- package/lib/parser/index.d.ts +13 -0
- package/lib/parser/index.d.ts.map +1 -0
- package/lib/parser/index.js +123 -0
- package/lib/parser/index.js.map +1 -0
- package/lib/parser/markdoc/extract-statics.d.ts +28 -0
- package/lib/parser/markdoc/extract-statics.d.ts.map +1 -0
- package/lib/parser/markdoc/extract-statics.js +80 -0
- package/lib/parser/markdoc/extract-statics.js.map +1 -0
- package/lib/parser/markdoc/pairing.d.ts +38 -0
- package/lib/parser/markdoc/pairing.d.ts.map +1 -0
- package/lib/parser/markdoc/pairing.js +77 -0
- package/lib/parser/markdoc/pairing.js.map +1 -0
- package/lib/parser/markdoc/schema.d.ts +56 -0
- package/lib/parser/markdoc/schema.d.ts.map +1 -0
- package/lib/parser/markdoc/schema.js +60 -0
- package/lib/parser/markdoc/schema.js.map +1 -0
- package/lib/parser/markdoc/span.d.ts +52 -0
- package/lib/parser/markdoc/span.d.ts.map +1 -0
- package/lib/parser/markdoc/span.js +577 -0
- package/lib/parser/markdoc/span.js.map +1 -0
- package/lib/parser/markdoc/structure.d.ts +17 -0
- package/lib/parser/markdoc/structure.d.ts.map +1 -0
- package/lib/parser/markdoc/structure.js +121 -0
- package/lib/parser/markdoc/structure.js.map +1 -0
- package/lib/parser/markdoc/syntax.d.ts +17 -0
- package/lib/parser/markdoc/syntax.d.ts.map +1 -0
- package/lib/parser/markdoc/syntax.js +262 -0
- package/lib/parser/markdoc/syntax.js.map +1 -0
- package/lib/parser/types.d.ts.map +1 -0
- package/lib/presets.d.ts +6 -0
- package/lib/presets.d.ts.map +1 -0
- package/lib/presets.js +12 -0
- package/lib/presets.js.map +1 -0
- package/lib/rules/registry.d.ts +13 -0
- package/lib/rules/registry.d.ts.map +1 -0
- package/lib/rules/registry.js +54 -0
- package/lib/rules/registry.js.map +1 -0
- package/lib/rules/scope/capitalization.d.ts.map +1 -0
- package/lib/rules/scope/capitalization.js +128 -0
- package/lib/rules/scope/capitalization.js.map +1 -0
- package/lib/rules/scope/conditional.d.ts.map +1 -0
- package/lib/rules/scope/conditional.js +93 -0
- package/lib/rules/scope/conditional.js.map +1 -0
- package/lib/rules/scope/consistency.d.ts.map +1 -0
- package/lib/rules/scope/consistency.js +118 -0
- package/lib/rules/scope/consistency.js.map +1 -0
- package/lib/rules/scope/length.d.ts.map +1 -0
- package/lib/rules/scope/length.js +50 -0
- package/lib/rules/scope/length.js.map +1 -0
- package/lib/rules/scope/max-image-size.d.ts.map +1 -0
- package/lib/rules/scope/max-image-size.js +55 -0
- package/lib/rules/scope/max-image-size.js.map +1 -0
- package/lib/rules/scope/metric.d.ts +3 -0
- package/lib/rules/scope/metric.d.ts.map +1 -0
- package/lib/rules/scope/metric.js +59 -0
- package/lib/rules/scope/metric.js.map +1 -0
- package/lib/rules/scope/occurrence.d.ts.map +1 -0
- package/lib/rules/scope/occurrence.js +41 -0
- package/lib/rules/scope/occurrence.js.map +1 -0
- package/lib/rules/scope/pattern.d.ts.map +1 -0
- package/lib/rules/scope/pattern.js +58 -0
- package/lib/rules/scope/pattern.js.map +1 -0
- package/lib/rules/scope/repetition.d.ts.map +1 -0
- package/lib/rules/scope/repetition.js +134 -0
- package/lib/rules/scope/repetition.js.map +1 -0
- package/lib/rules/scope/semantic-line-breaks.d.ts.map +1 -0
- package/lib/rules/scope/semantic-line-breaks.js +180 -0
- package/lib/rules/scope/semantic-line-breaks.js.map +1 -0
- package/lib/rules/scope/spelling.d.ts +11 -0
- package/lib/rules/scope/spelling.d.ts.map +1 -0
- package/lib/rules/scope/spelling.js +146 -0
- package/lib/rules/scope/spelling.js.map +1 -0
- package/lib/rules/scope/swap.d.ts.map +1 -0
- package/lib/rules/scope/swap.js +111 -0
- package/lib/rules/scope/swap.js.map +1 -0
- package/lib/rules/scope/title-case.d.ts +24 -0
- package/lib/rules/scope/title-case.d.ts.map +1 -0
- package/lib/rules/scope/title-case.js +216 -0
- package/lib/rules/scope/title-case.js.map +1 -0
- package/lib/rules/token/blanks-around-fences.d.ts.map +1 -0
- package/lib/rules/token/blanks-around-fences.js.map +1 -0
- package/lib/rules/token/blanks-around-headings.d.ts.map +1 -0
- package/lib/rules/token/blanks-around-headings.js +96 -0
- package/lib/rules/token/blanks-around-headings.js.map +1 -0
- package/lib/rules/token/blanks-around-lists.d.ts.map +1 -0
- package/lib/rules/token/blanks-around-lists.js +48 -0
- package/lib/rules/token/blanks-around-lists.js.map +1 -0
- package/lib/rules/token/blanks-around-tables.d.ts.map +1 -0
- package/lib/rules/token/blanks-around-tables.js +40 -0
- package/lib/rules/token/blanks-around-tables.js.map +1 -0
- package/lib/rules/token/code-block-style.d.ts.map +1 -0
- package/lib/rules/token/code-block-style.js.map +1 -0
- package/lib/rules/token/code-fence-style.d.ts.map +1 -0
- package/lib/rules/token/code-fence-style.js.map +1 -0
- package/lib/rules/token/commands-show-output.d.ts.map +1 -0
- package/lib/rules/token/commands-show-output.js.map +1 -0
- package/lib/rules/token/descriptive-link-text.d.ts.map +1 -0
- package/lib/rules/token/descriptive-link-text.js +46 -0
- package/lib/rules/token/descriptive-link-text.js.map +1 -0
- package/lib/rules/token/fenced-code-language.d.ts.map +1 -0
- package/lib/rules/token/fenced-code-language.js.map +1 -0
- package/lib/rules/token/first-line-h1.d.ts.map +1 -0
- package/lib/rules/token/first-line-h1.js +83 -0
- package/lib/rules/token/first-line-h1.js.map +1 -0
- package/lib/rules/token/front-matter.d.ts.map +1 -0
- package/lib/rules/token/front-matter.js +169 -0
- package/lib/rules/token/front-matter.js.map +1 -0
- package/lib/rules/token/heading-increment.d.ts.map +1 -0
- package/lib/rules/token/heading-increment.js +26 -0
- package/lib/rules/token/heading-increment.js.map +1 -0
- package/lib/rules/token/heading-start-left.d.ts.map +1 -0
- package/lib/rules/token/heading-start-left.js.map +1 -0
- package/lib/rules/token/heading-style.d.ts.map +1 -0
- package/lib/rules/token/heading-style.js.map +1 -0
- package/lib/rules/token/helpers.d.ts +115 -0
- package/lib/rules/token/helpers.d.ts.map +1 -0
- package/lib/rules/token/helpers.js +502 -0
- package/lib/rules/token/helpers.js.map +1 -0
- package/lib/rules/token/hr-style.d.ts.map +1 -0
- package/lib/rules/token/hr-style.js.map +1 -0
- package/lib/rules/token/index.d.ts +65 -0
- package/lib/rules/token/index.d.ts.map +1 -0
- package/lib/rules/token/index.js +157 -0
- package/lib/rules/token/index.js.map +1 -0
- package/lib/rules/token/line-length.d.ts.map +1 -0
- package/lib/rules/token/line-length.js +96 -0
- package/lib/rules/token/line-length.js.map +1 -0
- package/lib/rules/token/link-fragments.d.ts.map +1 -0
- package/lib/rules/token/link-fragments.js +398 -0
- package/lib/rules/token/link-fragments.js.map +1 -0
- package/lib/rules/token/link-image-reference-definitions.d.ts.map +1 -0
- package/lib/rules/token/link-image-reference-definitions.js.map +1 -0
- package/lib/rules/token/link-image-style.d.ts.map +1 -0
- package/lib/rules/token/link-image-style.js +138 -0
- package/lib/rules/token/link-image-style.js.map +1 -0
- package/lib/rules/token/list-indent.d.ts.map +1 -0
- package/lib/rules/token/list-indent.js.map +1 -0
- package/lib/rules/token/list-length.d.ts.map +1 -0
- package/lib/rules/token/list-length.js +31 -0
- package/lib/rules/token/list-length.js.map +1 -0
- package/lib/rules/token/list-marker-space.d.ts.map +1 -0
- package/lib/rules/token/list-marker-space.js.map +1 -0
- package/lib/rules/token/markdoc-attributes.d.ts.map +1 -0
- package/lib/rules/token/markdoc-attributes.js +198 -0
- package/lib/rules/token/markdoc-attributes.js.map +1 -0
- package/lib/rules/token/markdoc-pairing.d.ts.map +1 -0
- package/lib/rules/token/markdoc-pairing.js +65 -0
- package/lib/rules/token/markdoc-pairing.js.map +1 -0
- package/lib/rules/token/markdoc-syntax.d.ts.map +1 -0
- package/lib/rules/token/markdoc-syntax.js +84 -0
- package/lib/rules/token/markdoc-syntax.js.map +1 -0
- package/lib/rules/token/markdoc-unknown-tag.d.ts.map +1 -0
- package/lib/rules/token/markdoc-unknown-tag.js +44 -0
- package/lib/rules/token/markdoc-unknown-tag.js.map +1 -0
- package/lib/rules/token/no-alt-text.d.ts.map +1 -0
- package/lib/rules/token/no-alt-text.js +43 -0
- package/lib/rules/token/no-alt-text.js.map +1 -0
- package/lib/rules/token/no-bare-urls.d.ts.map +1 -0
- package/lib/rules/token/no-bare-urls.js +74 -0
- package/lib/rules/token/no-bare-urls.js.map +1 -0
- package/lib/rules/token/no-blanks-blockquote.d.ts.map +1 -0
- package/lib/rules/token/no-blanks-blockquote.js.map +1 -0
- package/lib/rules/token/no-duplicate-heading.d.ts.map +1 -0
- package/lib/rules/token/no-duplicate-heading.js +89 -0
- package/lib/rules/token/no-duplicate-heading.js.map +1 -0
- package/lib/rules/token/no-duplicate-link-destinations.d.ts.map +1 -0
- package/lib/rules/token/no-duplicate-link-destinations.js +54 -0
- package/lib/rules/token/no-duplicate-link-destinations.js.map +1 -0
- package/lib/rules/token/no-emphasis-as-heading.d.ts.map +1 -0
- package/lib/rules/token/no-emphasis-as-heading.js +39 -0
- package/lib/rules/token/no-emphasis-as-heading.js.map +1 -0
- package/lib/rules/token/no-empty-headings.d.ts.map +1 -0
- package/lib/rules/token/no-empty-headings.js +21 -0
- package/lib/rules/token/no-empty-headings.js.map +1 -0
- package/lib/rules/token/no-empty-links.d.ts.map +1 -0
- package/lib/rules/token/no-empty-links.js.map +1 -0
- package/lib/rules/token/no-hard-tabs.d.ts.map +1 -0
- package/lib/rules/token/no-hard-tabs.js.map +1 -0
- package/lib/rules/token/no-inline-html.d.ts.map +1 -0
- package/lib/rules/token/no-inline-html.js +41 -0
- package/lib/rules/token/no-inline-html.js.map +1 -0
- package/lib/rules/token/no-multiple-blanks.d.ts.map +1 -0
- package/lib/rules/token/no-multiple-blanks.js.map +1 -0
- package/lib/rules/token/no-multiple-space-atx.d.ts +9 -0
- package/lib/rules/token/no-multiple-space-atx.d.ts.map +1 -0
- package/lib/rules/token/no-multiple-space-atx.js +46 -0
- package/lib/rules/token/no-multiple-space-atx.js.map +1 -0
- package/lib/rules/token/no-multiple-space-closed-atx.d.ts.map +1 -0
- package/lib/rules/token/no-multiple-space-closed-atx.js.map +1 -0
- package/lib/rules/token/no-reversed-links.d.ts.map +1 -0
- package/lib/rules/token/no-reversed-links.js.map +1 -0
- package/lib/rules/token/no-space-in-code.d.ts.map +1 -0
- package/lib/rules/token/no-space-in-code.js.map +1 -0
- package/lib/rules/token/no-space-in-emphasis.d.ts.map +1 -0
- package/lib/rules/token/no-space-in-emphasis.js +72 -0
- package/lib/rules/token/no-space-in-emphasis.js.map +1 -0
- package/lib/rules/token/no-space-in-links.d.ts.map +1 -0
- package/lib/rules/token/no-space-in-links.js.map +1 -0
- package/lib/rules/token/no-trailing-punctuation.d.ts.map +1 -0
- package/lib/rules/token/no-trailing-punctuation.js.map +1 -0
- package/lib/rules/token/no-trailing-spaces.d.ts.map +1 -0
- package/lib/rules/token/no-trailing-spaces.js.map +1 -0
- package/lib/rules/token/ol-prefix.d.ts.map +1 -0
- package/lib/rules/token/ol-prefix.js.map +1 -0
- package/lib/rules/token/proper-names.d.ts.map +1 -0
- package/lib/rules/token/proper-names.js +87 -0
- package/lib/rules/token/proper-names.js.map +1 -0
- package/lib/rules/token/reference-links-images.d.ts.map +1 -0
- package/lib/rules/token/reference-links-images.js.map +1 -0
- package/lib/rules/token/required-headings.d.ts.map +1 -0
- package/lib/rules/token/required-headings.js +73 -0
- package/lib/rules/token/required-headings.js.map +1 -0
- package/lib/rules/token/single-h1.d.ts.map +1 -0
- package/lib/rules/token/single-h1.js +43 -0
- package/lib/rules/token/single-h1.js.map +1 -0
- package/lib/rules/token/table-column-count.d.ts.map +1 -0
- package/lib/rules/token/table-column-count.js.map +1 -0
- package/lib/rules/token/table-column-style.d.ts.map +1 -0
- package/lib/rules/token/table-column-style.js +162 -0
- package/lib/rules/token/table-column-style.js.map +1 -0
- package/lib/rules/token/table-pipe-style.d.ts.map +1 -0
- package/lib/rules/token/table-pipe-style.js.map +1 -0
- package/lib/rules/token/ul-indent.d.ts.map +1 -0
- package/lib/rules/token/ul-indent.js.map +1 -0
- package/lib/rules/token/ul-style.d.ts.map +1 -0
- package/lib/rules/token/ul-style.js +70 -0
- package/lib/rules/token/ul-style.js.map +1 -0
- package/lib/rules/types.d.ts +62 -0
- package/lib/rules/types.d.ts.map +1 -0
- package/lib/rules/utils.d.ts +18 -0
- package/lib/rules/utils.d.ts.map +1 -0
- package/lib/rules/utils.js +75 -0
- package/lib/rules/utils.js.map +1 -0
- package/lib/scopes/extractor.d.ts +6 -0
- package/lib/scopes/extractor.d.ts.map +1 -0
- package/lib/scopes/extractor.js +398 -0
- package/lib/scopes/extractor.js.map +1 -0
- package/lib/scopes/selector.d.ts +26 -0
- package/lib/scopes/selector.d.ts.map +1 -0
- package/lib/scopes/selector.js +78 -0
- package/lib/scopes/selector.js.map +1 -0
- package/lib/scopes/sentences.d.ts +13 -0
- package/lib/scopes/sentences.d.ts.map +1 -0
- package/lib/scopes/sentences.js +237 -0
- package/lib/scopes/sentences.js.map +1 -0
- package/lib/scopes/types.d.ts +35 -0
- package/lib/scopes/types.d.ts.map +1 -0
- package/lib/scopes/vocabulary.d.ts +12 -0
- package/lib/scopes/vocabulary.d.ts.map +1 -0
- package/lib/scopes/vocabulary.js +56 -0
- package/lib/scopes/vocabulary.js.map +1 -0
- package/lib/types/assertions.d.ts +97 -0
- package/lib/types/assertions.d.ts.map +1 -0
- package/lib/types/reporting.d.ts +23 -0
- package/lib/types/reporting.d.ts.map +1 -0
- package/lib/types/rules.d.ts +53 -0
- package/lib/types/rules.d.ts.map +1 -0
- package/lib/types/validation.d.ts +5 -0
- package/lib/types/validation.d.ts.map +1 -0
- package/lib/utils/is-plain-object.d.ts +2 -0
- package/lib/utils/is-plain-object.d.ts.map +1 -0
- package/lib/utils/is-plain-object.js +5 -0
- package/lib/utils/is-plain-object.js.map +1 -0
- package/package.json +58 -61
- package/presets/google/PROVENANCE.md +217 -221
- package/presets/inclusive-language/PROVENANCE.md +20 -19
- package/presets/microsoft/PROVENANCE.md +242 -243
- package/presets/plain-language/PROVENANCE.md +66 -60
- package/presets/technical-english/PROVENANCE.md +5 -5
- package/skills/recheck-config/SKILL.md +70 -20
- package/skills/recheck-lint/SKILL.md +37 -13
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -228
- package/dist/cli.js.map +0 -1
- package/dist/commands/baseline.d.ts +0 -10
- package/dist/commands/baseline.d.ts.map +0 -1
- package/dist/commands/baseline.js +0 -59
- package/dist/commands/baseline.js.map +0 -1
- package/dist/commands/markdoc-schema.d.ts +0 -17
- package/dist/commands/markdoc-schema.d.ts.map +0 -1
- package/dist/commands/markdoc-schema.js +0 -127
- package/dist/commands/markdoc-schema.js.map +0 -1
- package/dist/commands/readability.d.ts +0 -10
- package/dist/commands/readability.d.ts.map +0 -1
- package/dist/commands/readability.js +0 -90
- package/dist/commands/readability.js.map +0 -1
- package/dist/commands/run.d.ts +0 -21
- package/dist/commands/run.d.ts.map +0 -1
- package/dist/commands/run.js +0 -236
- package/dist/commands/run.js.map +0 -1
- package/dist/commands/validate.d.ts +0 -8
- package/dist/commands/validate.d.ts.map +0 -1
- package/dist/commands/validate.js +0 -43
- package/dist/commands/validate.js.map +0 -1
- package/dist/config/load.d.ts +0 -33
- package/dist/config/load.d.ts.map +0 -1
- package/dist/config/load.js +0 -98
- package/dist/config/load.js.map +0 -1
- package/dist/config/presets/api-descriptions.d.ts +0 -8
- package/dist/config/presets/api-descriptions.d.ts.map +0 -1
- package/dist/config/presets/api-descriptions.js +0 -24
- package/dist/config/presets/api-descriptions.js.map +0 -1
- package/dist/config/presets/google.d.ts +0 -3
- package/dist/config/presets/google.d.ts.map +0 -1
- package/dist/config/presets/google.js +0 -1671
- package/dist/config/presets/google.js.map +0 -1
- package/dist/config/presets/inclusive-language.d.ts +0 -3
- package/dist/config/presets/inclusive-language.d.ts.map +0 -1
- package/dist/config/presets/inclusive-language.js +0 -321
- package/dist/config/presets/inclusive-language.js.map +0 -1
- package/dist/config/presets/index.d.ts +0 -67
- package/dist/config/presets/index.d.ts.map +0 -1
- package/dist/config/presets/index.js +0 -141
- package/dist/config/presets/index.js.map +0 -1
- package/dist/config/presets/markdoc.d.ts +0 -21
- package/dist/config/presets/markdoc.d.ts.map +0 -1
- package/dist/config/presets/markdoc.js +0 -101
- package/dist/config/presets/markdoc.js.map +0 -1
- package/dist/config/presets/markdown-relaxed.d.ts +0 -3
- package/dist/config/presets/markdown-relaxed.d.ts.map +0 -1
- package/dist/config/presets/markdown-relaxed.js +0 -98
- package/dist/config/presets/markdown-relaxed.js.map +0 -1
- package/dist/config/presets/markdown.d.ts +0 -43
- package/dist/config/presets/markdown.d.ts.map +0 -1
- package/dist/config/presets/markdown.js +0 -132
- package/dist/config/presets/markdown.js.map +0 -1
- package/dist/config/presets/microsoft.d.ts +0 -3
- package/dist/config/presets/microsoft.d.ts.map +0 -1
- package/dist/config/presets/microsoft.js +0 -2268
- package/dist/config/presets/microsoft.js.map +0 -1
- package/dist/config/presets/minimal.d.ts +0 -3
- package/dist/config/presets/minimal.d.ts.map +0 -1
- package/dist/config/presets/minimal.js +0 -21
- package/dist/config/presets/minimal.js.map +0 -1
- package/dist/config/presets/plain-language.d.ts +0 -3
- package/dist/config/presets/plain-language.d.ts.map +0 -1
- package/dist/config/presets/plain-language.js +0 -351
- package/dist/config/presets/plain-language.js.map +0 -1
- package/dist/config/presets/prose.d.ts +0 -52
- package/dist/config/presets/prose.d.ts.map +0 -1
- package/dist/config/presets/prose.js +0 -138
- package/dist/config/presets/prose.js.map +0 -1
- package/dist/config/presets/technical-english.d.ts +0 -34
- package/dist/config/presets/technical-english.d.ts.map +0 -1
- package/dist/config/presets/technical-english.js +0 -79
- package/dist/config/presets/technical-english.js.map +0 -1
- package/dist/config/schema.d.ts +0 -226
- package/dist/config/schema.d.ts.map +0 -1
- package/dist/config/schema.js +0 -196
- package/dist/config/schema.js.map +0 -1
- package/dist/config/validate.d.ts +0 -22
- package/dist/config/validate.d.ts.map +0 -1
- package/dist/config/validate.js +0 -1296
- package/dist/config/validate.js.map +0 -1
- package/dist/core/auto-fix.d.ts.map +0 -1
- package/dist/core/auto-fix.js +0 -101
- package/dist/core/auto-fix.js.map +0 -1
- package/dist/core/baseline.d.ts +0 -49
- package/dist/core/baseline.d.ts.map +0 -1
- package/dist/core/baseline.js +0 -0
- package/dist/core/baseline.js.map +0 -1
- package/dist/core/case-preserve.d.ts +0 -46
- package/dist/core/case-preserve.d.ts.map +0 -1
- package/dist/core/case-preserve.js +0 -57
- package/dist/core/case-preserve.js.map +0 -1
- package/dist/core/directives.d.ts.map +0 -1
- package/dist/core/directives.js +0 -73
- package/dist/core/directives.js.map +0 -1
- package/dist/core/files.d.ts +0 -69
- package/dist/core/files.d.ts.map +0 -1
- package/dist/core/files.js +0 -260
- package/dist/core/files.js.map +0 -1
- package/dist/core/inline-code.d.ts +0 -87
- package/dist/core/inline-code.d.ts.map +0 -1
- package/dist/core/inline-code.js +0 -104
- package/dist/core/inline-code.js.map +0 -1
- package/dist/core/line-endings.d.ts +0 -32
- package/dist/core/line-endings.d.ts.map +0 -1
- package/dist/core/line-endings.js +0 -65
- package/dist/core/line-endings.js.map +0 -1
- package/dist/core/markdoc-tags.d.ts +0 -79
- package/dist/core/markdoc-tags.d.ts.map +0 -1
- package/dist/core/markdoc-tags.js +0 -131
- package/dist/core/markdoc-tags.js.map +0 -1
- package/dist/core/prose-extract.d.ts +0 -6
- package/dist/core/prose-extract.d.ts.map +0 -1
- package/dist/core/prose-extract.js +0 -79
- package/dist/core/prose-extract.js.map +0 -1
- package/dist/core/readability.d.ts +0 -17
- package/dist/core/readability.d.ts.map +0 -1
- package/dist/core/readability.js +0 -37
- package/dist/core/readability.js.map +0 -1
- package/dist/core/rule-filters.d.ts +0 -45
- package/dist/core/rule-filters.d.ts.map +0 -1
- package/dist/core/rule-filters.js +0 -118
- package/dist/core/rule-filters.js.map +0 -1
- package/dist/core/runner.d.ts +0 -99
- package/dist/core/runner.d.ts.map +0 -1
- package/dist/core/runner.js +0 -401
- package/dist/core/runner.js.map +0 -1
- package/dist/core/timing.d.ts +0 -24
- package/dist/core/timing.d.ts.map +0 -1
- package/dist/core/timing.js +0 -39
- package/dist/core/timing.js.map +0 -1
- package/dist/data/markdoc-realm-schema.d.ts.map +0 -1
- package/dist/data/markdoc-realm-schema.js +0 -798
- package/dist/data/markdoc-realm-schema.js.map +0 -1
- package/dist/data/proper-nouns.d.ts.map +0 -1
- package/dist/data/proper-nouns.js +0 -47
- package/dist/data/proper-nouns.js.map +0 -1
- package/dist/data/realm-front-matter-schema.d.ts +0 -28
- package/dist/data/realm-front-matter-schema.d.ts.map +0 -1
- package/dist/data/realm-front-matter-schema.js +0 -73
- package/dist/data/realm-front-matter-schema.js.map +0 -1
- package/dist/index.d.ts +0 -90
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -152
- package/dist/index.js.map +0 -1
- package/dist/metrics/formulas.d.ts +0 -17
- package/dist/metrics/formulas.d.ts.map +0 -1
- package/dist/metrics/formulas.js +0 -70
- package/dist/metrics/formulas.js.map +0 -1
- package/dist/metrics/statistics.d.ts +0 -27
- package/dist/metrics/statistics.d.ts.map +0 -1
- package/dist/metrics/statistics.js +0 -56
- package/dist/metrics/statistics.js.map +0 -1
- package/dist/parser/index.d.ts +0 -19
- package/dist/parser/index.d.ts.map +0 -1
- package/dist/parser/index.js +0 -174
- package/dist/parser/index.js.map +0 -1
- package/dist/parser/markdoc/extract-statics.d.ts +0 -45
- package/dist/parser/markdoc/extract-statics.d.ts.map +0 -1
- package/dist/parser/markdoc/extract-statics.js +0 -139
- package/dist/parser/markdoc/extract-statics.js.map +0 -1
- package/dist/parser/markdoc/pairing.d.ts +0 -63
- package/dist/parser/markdoc/pairing.d.ts.map +0 -1
- package/dist/parser/markdoc/pairing.js +0 -94
- package/dist/parser/markdoc/pairing.js.map +0 -1
- package/dist/parser/markdoc/schema.d.ts +0 -85
- package/dist/parser/markdoc/schema.d.ts.map +0 -1
- package/dist/parser/markdoc/schema.js +0 -86
- package/dist/parser/markdoc/schema.js.map +0 -1
- package/dist/parser/markdoc/span.d.ts +0 -64
- package/dist/parser/markdoc/span.d.ts.map +0 -1
- package/dist/parser/markdoc/span.js +0 -729
- package/dist/parser/markdoc/span.js.map +0 -1
- package/dist/parser/markdoc/structure.d.ts +0 -28
- package/dist/parser/markdoc/structure.d.ts.map +0 -1
- package/dist/parser/markdoc/structure.js +0 -153
- package/dist/parser/markdoc/structure.js.map +0 -1
- package/dist/parser/markdoc/syntax.d.ts +0 -44
- package/dist/parser/markdoc/syntax.d.ts.map +0 -1
- package/dist/parser/markdoc/syntax.js +0 -317
- package/dist/parser/markdoc/syntax.js.map +0 -1
- package/dist/parser/types.d.ts.map +0 -1
- package/dist/reporter/fixes.d.ts +0 -3
- package/dist/reporter/fixes.d.ts.map +0 -1
- package/dist/reporter/fixes.js +0 -41
- package/dist/reporter/fixes.js.map +0 -1
- package/dist/reporter/formats/github-actions.d.ts +0 -6
- package/dist/reporter/formats/github-actions.d.ts.map +0 -1
- package/dist/reporter/formats/github-actions.js +0 -20
- package/dist/reporter/formats/github-actions.js.map +0 -1
- package/dist/reporter/formats/json.d.ts +0 -10
- package/dist/reporter/formats/json.d.ts.map +0 -1
- package/dist/reporter/formats/json.js +0 -25
- package/dist/reporter/formats/json.js.map +0 -1
- package/dist/reporter/formats/sarif.d.ts +0 -10
- package/dist/reporter/formats/sarif.d.ts.map +0 -1
- package/dist/reporter/formats/sarif.js +0 -66
- package/dist/reporter/formats/sarif.js.map +0 -1
- package/dist/reporter/formats/table.d.ts +0 -6
- package/dist/reporter/formats/table.d.ts.map +0 -1
- package/dist/reporter/formats/table.js +0 -43
- package/dist/reporter/formats/table.js.map +0 -1
- package/dist/reporter/index.d.ts +0 -10
- package/dist/reporter/index.d.ts.map +0 -1
- package/dist/reporter/index.js +0 -42
- package/dist/reporter/index.js.map +0 -1
- package/dist/reporter/prioritize-problems.d.ts +0 -7
- package/dist/reporter/prioritize-problems.d.ts.map +0 -1
- package/dist/reporter/prioritize-problems.js +0 -29
- package/dist/reporter/prioritize-problems.js.map +0 -1
- package/dist/reporter/statistics.d.ts +0 -10
- package/dist/reporter/statistics.d.ts.map +0 -1
- package/dist/reporter/statistics.js +0 -52
- package/dist/reporter/statistics.js.map +0 -1
- package/dist/reporter/summary.d.ts +0 -10
- package/dist/reporter/summary.d.ts.map +0 -1
- package/dist/reporter/summary.js +0 -49
- package/dist/reporter/summary.js.map +0 -1
- package/dist/rules/registry.d.ts +0 -15
- package/dist/rules/registry.d.ts.map +0 -1
- package/dist/rules/registry.js +0 -81
- package/dist/rules/registry.js.map +0 -1
- package/dist/rules/scope/capitalization.d.ts.map +0 -1
- package/dist/rules/scope/capitalization.js +0 -164
- package/dist/rules/scope/capitalization.js.map +0 -1
- package/dist/rules/scope/conditional.d.ts.map +0 -1
- package/dist/rules/scope/conditional.js +0 -112
- package/dist/rules/scope/conditional.js.map +0 -1
- package/dist/rules/scope/consistency.d.ts.map +0 -1
- package/dist/rules/scope/consistency.js +0 -179
- package/dist/rules/scope/consistency.js.map +0 -1
- package/dist/rules/scope/length.d.ts.map +0 -1
- package/dist/rules/scope/length.js +0 -73
- package/dist/rules/scope/length.js.map +0 -1
- package/dist/rules/scope/max-image-size.d.ts.map +0 -1
- package/dist/rules/scope/max-image-size.js +0 -65
- package/dist/rules/scope/max-image-size.js.map +0 -1
- package/dist/rules/scope/metric.d.ts +0 -5
- package/dist/rules/scope/metric.d.ts.map +0 -1
- package/dist/rules/scope/metric.js +0 -59
- package/dist/rules/scope/metric.js.map +0 -1
- package/dist/rules/scope/occurrence.d.ts.map +0 -1
- package/dist/rules/scope/occurrence.js +0 -48
- package/dist/rules/scope/occurrence.js.map +0 -1
- package/dist/rules/scope/pattern.d.ts.map +0 -1
- package/dist/rules/scope/pattern.js +0 -75
- package/dist/rules/scope/pattern.js.map +0 -1
- package/dist/rules/scope/repetition.d.ts.map +0 -1
- package/dist/rules/scope/repetition.js +0 -139
- package/dist/rules/scope/repetition.js.map +0 -1
- package/dist/rules/scope/semantic-line-breaks.d.ts.map +0 -1
- package/dist/rules/scope/semantic-line-breaks.js +0 -236
- package/dist/rules/scope/semantic-line-breaks.js.map +0 -1
- package/dist/rules/scope/spelling.d.ts +0 -27
- package/dist/rules/scope/spelling.d.ts.map +0 -1
- package/dist/rules/scope/spelling.js +0 -227
- package/dist/rules/scope/spelling.js.map +0 -1
- package/dist/rules/scope/swap.d.ts.map +0 -1
- package/dist/rules/scope/swap.js +0 -149
- package/dist/rules/scope/swap.js.map +0 -1
- package/dist/rules/scope/title-case.d.ts +0 -46
- package/dist/rules/scope/title-case.d.ts.map +0 -1
- package/dist/rules/scope/title-case.js +0 -301
- package/dist/rules/scope/title-case.js.map +0 -1
- package/dist/rules/token/blanks-around-fences.d.ts.map +0 -1
- package/dist/rules/token/blanks-around-fences.js.map +0 -1
- package/dist/rules/token/blanks-around-headings.d.ts.map +0 -1
- package/dist/rules/token/blanks-around-headings.js +0 -108
- package/dist/rules/token/blanks-around-headings.js.map +0 -1
- package/dist/rules/token/blanks-around-lists.d.ts.map +0 -1
- package/dist/rules/token/blanks-around-lists.js +0 -56
- package/dist/rules/token/blanks-around-lists.js.map +0 -1
- package/dist/rules/token/blanks-around-tables.d.ts.map +0 -1
- package/dist/rules/token/blanks-around-tables.js +0 -42
- package/dist/rules/token/blanks-around-tables.js.map +0 -1
- package/dist/rules/token/code-block-style.d.ts.map +0 -1
- package/dist/rules/token/code-block-style.js.map +0 -1
- package/dist/rules/token/code-fence-style.d.ts.map +0 -1
- package/dist/rules/token/code-fence-style.js.map +0 -1
- package/dist/rules/token/commands-show-output.d.ts.map +0 -1
- package/dist/rules/token/commands-show-output.js.map +0 -1
- package/dist/rules/token/descriptive-link-text.d.ts.map +0 -1
- package/dist/rules/token/descriptive-link-text.js +0 -53
- package/dist/rules/token/descriptive-link-text.js.map +0 -1
- package/dist/rules/token/fenced-code-language.d.ts.map +0 -1
- package/dist/rules/token/fenced-code-language.js.map +0 -1
- package/dist/rules/token/first-line-h1.d.ts.map +0 -1
- package/dist/rules/token/first-line-h1.js +0 -107
- package/dist/rules/token/first-line-h1.js.map +0 -1
- package/dist/rules/token/front-matter.d.ts.map +0 -1
- package/dist/rules/token/front-matter.js +0 -177
- package/dist/rules/token/front-matter.js.map +0 -1
- package/dist/rules/token/heading-increment.d.ts.map +0 -1
- package/dist/rules/token/heading-increment.js +0 -27
- package/dist/rules/token/heading-increment.js.map +0 -1
- package/dist/rules/token/heading-start-left.d.ts.map +0 -1
- package/dist/rules/token/heading-start-left.js.map +0 -1
- package/dist/rules/token/heading-style.d.ts.map +0 -1
- package/dist/rules/token/heading-style.js.map +0 -1
- package/dist/rules/token/helpers.d.ts +0 -313
- package/dist/rules/token/helpers.d.ts.map +0 -1
- package/dist/rules/token/helpers.js +0 -746
- package/dist/rules/token/helpers.js.map +0 -1
- package/dist/rules/token/hr-style.d.ts.map +0 -1
- package/dist/rules/token/hr-style.js.map +0 -1
- package/dist/rules/token/index.d.ts +0 -76
- package/dist/rules/token/index.d.ts.map +0 -1
- package/dist/rules/token/index.js +0 -229
- package/dist/rules/token/index.js.map +0 -1
- package/dist/rules/token/line-length.d.ts.map +0 -1
- package/dist/rules/token/line-length.js +0 -120
- package/dist/rules/token/line-length.js.map +0 -1
- package/dist/rules/token/link-fragments.d.ts.map +0 -1
- package/dist/rules/token/link-fragments.js +0 -393
- package/dist/rules/token/link-fragments.js.map +0 -1
- package/dist/rules/token/link-image-reference-definitions.d.ts.map +0 -1
- package/dist/rules/token/link-image-reference-definitions.js.map +0 -1
- package/dist/rules/token/link-image-style.d.ts.map +0 -1
- package/dist/rules/token/link-image-style.js +0 -131
- package/dist/rules/token/link-image-style.js.map +0 -1
- package/dist/rules/token/list-indent.d.ts.map +0 -1
- package/dist/rules/token/list-indent.js.map +0 -1
- package/dist/rules/token/list-length.d.ts.map +0 -1
- package/dist/rules/token/list-length.js +0 -55
- package/dist/rules/token/list-length.js.map +0 -1
- package/dist/rules/token/list-marker-space.d.ts.map +0 -1
- package/dist/rules/token/list-marker-space.js.map +0 -1
- package/dist/rules/token/markdoc-attributes.d.ts.map +0 -1
- package/dist/rules/token/markdoc-attributes.js +0 -269
- package/dist/rules/token/markdoc-attributes.js.map +0 -1
- package/dist/rules/token/markdoc-pairing.d.ts.map +0 -1
- package/dist/rules/token/markdoc-pairing.js +0 -73
- package/dist/rules/token/markdoc-pairing.js.map +0 -1
- package/dist/rules/token/markdoc-syntax.d.ts.map +0 -1
- package/dist/rules/token/markdoc-syntax.js +0 -119
- package/dist/rules/token/markdoc-syntax.js.map +0 -1
- package/dist/rules/token/markdoc-unknown-tag.d.ts.map +0 -1
- package/dist/rules/token/markdoc-unknown-tag.js +0 -64
- package/dist/rules/token/markdoc-unknown-tag.js.map +0 -1
- package/dist/rules/token/no-alt-text.d.ts.map +0 -1
- package/dist/rules/token/no-alt-text.js +0 -47
- package/dist/rules/token/no-alt-text.js.map +0 -1
- package/dist/rules/token/no-bare-urls.d.ts.map +0 -1
- package/dist/rules/token/no-bare-urls.js +0 -88
- package/dist/rules/token/no-bare-urls.js.map +0 -1
- package/dist/rules/token/no-blanks-blockquote.d.ts.map +0 -1
- package/dist/rules/token/no-blanks-blockquote.js.map +0 -1
- package/dist/rules/token/no-duplicate-heading.d.ts.map +0 -1
- package/dist/rules/token/no-duplicate-heading.js +0 -101
- package/dist/rules/token/no-duplicate-heading.js.map +0 -1
- package/dist/rules/token/no-duplicate-link-destinations.d.ts.map +0 -1
- package/dist/rules/token/no-duplicate-link-destinations.js +0 -65
- package/dist/rules/token/no-duplicate-link-destinations.js.map +0 -1
- package/dist/rules/token/no-emphasis-as-heading.d.ts.map +0 -1
- package/dist/rules/token/no-emphasis-as-heading.js +0 -44
- package/dist/rules/token/no-emphasis-as-heading.js.map +0 -1
- package/dist/rules/token/no-empty-headings.d.ts.map +0 -1
- package/dist/rules/token/no-empty-headings.js +0 -28
- package/dist/rules/token/no-empty-headings.js.map +0 -1
- package/dist/rules/token/no-empty-links.d.ts.map +0 -1
- package/dist/rules/token/no-empty-links.js.map +0 -1
- package/dist/rules/token/no-hard-tabs.d.ts.map +0 -1
- package/dist/rules/token/no-hard-tabs.js.map +0 -1
- package/dist/rules/token/no-inline-html.d.ts.map +0 -1
- package/dist/rules/token/no-inline-html.js +0 -45
- package/dist/rules/token/no-inline-html.js.map +0 -1
- package/dist/rules/token/no-multiple-blanks.d.ts.map +0 -1
- package/dist/rules/token/no-multiple-blanks.js.map +0 -1
- package/dist/rules/token/no-multiple-space-atx.d.ts +0 -13
- package/dist/rules/token/no-multiple-space-atx.d.ts.map +0 -1
- package/dist/rules/token/no-multiple-space-atx.js +0 -50
- package/dist/rules/token/no-multiple-space-atx.js.map +0 -1
- package/dist/rules/token/no-multiple-space-closed-atx.d.ts.map +0 -1
- package/dist/rules/token/no-multiple-space-closed-atx.js.map +0 -1
- package/dist/rules/token/no-reversed-links.d.ts.map +0 -1
- package/dist/rules/token/no-reversed-links.js.map +0 -1
- package/dist/rules/token/no-space-in-code.d.ts.map +0 -1
- package/dist/rules/token/no-space-in-code.js.map +0 -1
- package/dist/rules/token/no-space-in-emphasis.d.ts.map +0 -1
- package/dist/rules/token/no-space-in-emphasis.js +0 -79
- package/dist/rules/token/no-space-in-emphasis.js.map +0 -1
- package/dist/rules/token/no-space-in-links.d.ts.map +0 -1
- package/dist/rules/token/no-space-in-links.js.map +0 -1
- package/dist/rules/token/no-trailing-punctuation.d.ts.map +0 -1
- package/dist/rules/token/no-trailing-punctuation.js.map +0 -1
- package/dist/rules/token/no-trailing-spaces.d.ts.map +0 -1
- package/dist/rules/token/no-trailing-spaces.js.map +0 -1
- package/dist/rules/token/ol-prefix.d.ts.map +0 -1
- package/dist/rules/token/ol-prefix.js.map +0 -1
- package/dist/rules/token/proper-names.d.ts.map +0 -1
- package/dist/rules/token/proper-names.js +0 -93
- package/dist/rules/token/proper-names.js.map +0 -1
- package/dist/rules/token/reference-links-images.d.ts.map +0 -1
- package/dist/rules/token/reference-links-images.js.map +0 -1
- package/dist/rules/token/required-headings.d.ts.map +0 -1
- package/dist/rules/token/required-headings.js +0 -83
- package/dist/rules/token/required-headings.js.map +0 -1
- package/dist/rules/token/single-h1.d.ts.map +0 -1
- package/dist/rules/token/single-h1.js +0 -56
- package/dist/rules/token/single-h1.js.map +0 -1
- package/dist/rules/token/table-column-count.d.ts.map +0 -1
- package/dist/rules/token/table-column-count.js.map +0 -1
- package/dist/rules/token/table-column-style.d.ts.map +0 -1
- package/dist/rules/token/table-column-style.js +0 -179
- package/dist/rules/token/table-column-style.js.map +0 -1
- package/dist/rules/token/table-pipe-style.d.ts.map +0 -1
- package/dist/rules/token/table-pipe-style.js.map +0 -1
- package/dist/rules/token/ul-indent.d.ts.map +0 -1
- package/dist/rules/token/ul-indent.js.map +0 -1
- package/dist/rules/token/ul-style.d.ts.map +0 -1
- package/dist/rules/token/ul-style.js +0 -80
- package/dist/rules/token/ul-style.js.map +0 -1
- package/dist/rules/types.d.ts +0 -83
- package/dist/rules/types.d.ts.map +0 -1
- package/dist/rules/utils.d.ts +0 -31
- package/dist/rules/utils.d.ts.map +0 -1
- package/dist/rules/utils.js +0 -90
- package/dist/rules/utils.js.map +0 -1
- package/dist/scopes/extractor.d.ts +0 -7
- package/dist/scopes/extractor.d.ts.map +0 -1
- package/dist/scopes/extractor.js +0 -536
- package/dist/scopes/extractor.js.map +0 -1
- package/dist/scopes/selector.d.ts +0 -51
- package/dist/scopes/selector.d.ts.map +0 -1
- package/dist/scopes/selector.js +0 -121
- package/dist/scopes/selector.js.map +0 -1
- package/dist/scopes/sentences.d.ts +0 -15
- package/dist/scopes/sentences.d.ts.map +0 -1
- package/dist/scopes/sentences.js +0 -202
- package/dist/scopes/sentences.js.map +0 -1
- package/dist/scopes/types.d.ts +0 -46
- package/dist/scopes/types.d.ts.map +0 -1
- package/dist/scopes/vocabulary.d.ts +0 -16
- package/dist/scopes/vocabulary.d.ts.map +0 -1
- package/dist/scopes/vocabulary.js +0 -70
- package/dist/scopes/vocabulary.js.map +0 -1
- package/dist/types/assertions.d.ts +0 -119
- package/dist/types/assertions.d.ts.map +0 -1
- package/dist/types/reporting.d.ts +0 -32
- package/dist/types/reporting.d.ts.map +0 -1
- package/dist/types/rules.d.ts +0 -41
- package/dist/types/rules.d.ts.map +0 -1
- package/dist/types/validation.d.ts +0 -6
- package/dist/types/validation.d.ts.map +0 -1
- /package/{dist → lib}/core/auto-fix.d.ts +0 -0
- /package/{dist → lib}/core/directives.d.ts +0 -0
- /package/{dist → lib}/data/markdoc-realm-schema.d.ts +0 -0
- /package/{dist → lib}/data/proper-nouns.d.ts +0 -0
- /package/{dist → lib}/metrics/index.d.ts +0 -0
- /package/{dist → lib}/metrics/index.d.ts.map +0 -0
- /package/{dist → lib}/metrics/index.js +0 -0
- /package/{dist → lib}/metrics/index.js.map +0 -0
- /package/{dist → lib}/parser/types.d.ts +0 -0
- /package/{dist → lib}/parser/types.js +0 -0
- /package/{dist → lib}/parser/types.js.map +0 -0
- /package/{dist → lib}/rules/scope/capitalization.d.ts +0 -0
- /package/{dist → lib}/rules/scope/conditional.d.ts +0 -0
- /package/{dist → lib}/rules/scope/consistency.d.ts +0 -0
- /package/{dist → lib}/rules/scope/length.d.ts +0 -0
- /package/{dist → lib}/rules/scope/max-image-size.d.ts +0 -0
- /package/{dist → lib}/rules/scope/occurrence.d.ts +0 -0
- /package/{dist → lib}/rules/scope/pattern.d.ts +0 -0
- /package/{dist → lib}/rules/scope/repetition.d.ts +0 -0
- /package/{dist → lib}/rules/scope/semantic-line-breaks.d.ts +0 -0
- /package/{dist → lib}/rules/scope/swap.d.ts +0 -0
- /package/{dist → lib}/rules/token/blanks-around-fences.d.ts +0 -0
- /package/{dist → lib}/rules/token/blanks-around-fences.js +0 -0
- /package/{dist → lib}/rules/token/blanks-around-headings.d.ts +0 -0
- /package/{dist → lib}/rules/token/blanks-around-lists.d.ts +0 -0
- /package/{dist → lib}/rules/token/blanks-around-tables.d.ts +0 -0
- /package/{dist → lib}/rules/token/code-block-style.d.ts +0 -0
- /package/{dist → lib}/rules/token/code-block-style.js +0 -0
- /package/{dist → lib}/rules/token/code-fence-style.d.ts +0 -0
- /package/{dist → lib}/rules/token/code-fence-style.js +0 -0
- /package/{dist → lib}/rules/token/commands-show-output.d.ts +0 -0
- /package/{dist → lib}/rules/token/commands-show-output.js +0 -0
- /package/{dist → lib}/rules/token/descriptive-link-text.d.ts +0 -0
- /package/{dist → lib}/rules/token/emphasis-style.d.ts +0 -0
- /package/{dist → lib}/rules/token/emphasis-style.d.ts.map +0 -0
- /package/{dist → lib}/rules/token/emphasis-style.js +0 -0
- /package/{dist → lib}/rules/token/emphasis-style.js.map +0 -0
- /package/{dist → lib}/rules/token/fenced-code-language.d.ts +0 -0
- /package/{dist → lib}/rules/token/fenced-code-language.js +0 -0
- /package/{dist → lib}/rules/token/first-line-h1.d.ts +0 -0
- /package/{dist → lib}/rules/token/front-matter.d.ts +0 -0
- /package/{dist → lib}/rules/token/heading-increment.d.ts +0 -0
- /package/{dist → lib}/rules/token/heading-start-left.d.ts +0 -0
- /package/{dist → lib}/rules/token/heading-start-left.js +0 -0
- /package/{dist → lib}/rules/token/heading-style.d.ts +0 -0
- /package/{dist → lib}/rules/token/heading-style.js +0 -0
- /package/{dist → lib}/rules/token/hr-style.d.ts +0 -0
- /package/{dist → lib}/rules/token/hr-style.js +0 -0
- /package/{dist → lib}/rules/token/line-length.d.ts +0 -0
- /package/{dist → lib}/rules/token/link-fragments.d.ts +0 -0
- /package/{dist → lib}/rules/token/link-image-reference-definitions.d.ts +0 -0
- /package/{dist → lib}/rules/token/link-image-reference-definitions.js +0 -0
- /package/{dist → lib}/rules/token/link-image-style.d.ts +0 -0
- /package/{dist → lib}/rules/token/list-indent.d.ts +0 -0
- /package/{dist → lib}/rules/token/list-indent.js +0 -0
- /package/{dist → lib}/rules/token/list-length.d.ts +0 -0
- /package/{dist → lib}/rules/token/list-marker-space.d.ts +0 -0
- /package/{dist → lib}/rules/token/list-marker-space.js +0 -0
- /package/{dist → lib}/rules/token/markdoc-attributes.d.ts +0 -0
- /package/{dist → lib}/rules/token/markdoc-pairing.d.ts +0 -0
- /package/{dist → lib}/rules/token/markdoc-syntax.d.ts +0 -0
- /package/{dist → lib}/rules/token/markdoc-unknown-tag.d.ts +0 -0
- /package/{dist → lib}/rules/token/messages.d.ts +0 -0
- /package/{dist → lib}/rules/token/messages.d.ts.map +0 -0
- /package/{dist → lib}/rules/token/messages.js +0 -0
- /package/{dist → lib}/rules/token/messages.js.map +0 -0
- /package/{dist → lib}/rules/token/no-alt-text.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-bare-urls.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-blanks-blockquote.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-blanks-blockquote.js +0 -0
- /package/{dist → lib}/rules/token/no-duplicate-heading.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-duplicate-link-destinations.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-emphasis-as-heading.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-empty-headings.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-empty-links.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-empty-links.js +0 -0
- /package/{dist → lib}/rules/token/no-hard-tabs.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-hard-tabs.js +0 -0
- /package/{dist → lib}/rules/token/no-inline-html.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-missing-space-atx.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-missing-space-atx.d.ts.map +0 -0
- /package/{dist → lib}/rules/token/no-missing-space-atx.js +0 -0
- /package/{dist → lib}/rules/token/no-missing-space-atx.js.map +0 -0
- /package/{dist → lib}/rules/token/no-missing-space-closed-atx.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-missing-space-closed-atx.d.ts.map +0 -0
- /package/{dist → lib}/rules/token/no-missing-space-closed-atx.js +0 -0
- /package/{dist → lib}/rules/token/no-missing-space-closed-atx.js.map +0 -0
- /package/{dist → lib}/rules/token/no-multiple-blanks.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-multiple-blanks.js +0 -0
- /package/{dist → lib}/rules/token/no-multiple-space-blockquote.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-multiple-space-blockquote.d.ts.map +0 -0
- /package/{dist → lib}/rules/token/no-multiple-space-blockquote.js +0 -0
- /package/{dist → lib}/rules/token/no-multiple-space-blockquote.js.map +0 -0
- /package/{dist → lib}/rules/token/no-multiple-space-closed-atx.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-multiple-space-closed-atx.js +0 -0
- /package/{dist → lib}/rules/token/no-reversed-links.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-reversed-links.js +0 -0
- /package/{dist → lib}/rules/token/no-space-in-code.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-space-in-code.js +0 -0
- /package/{dist → lib}/rules/token/no-space-in-emphasis.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-space-in-links.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-space-in-links.js +0 -0
- /package/{dist → lib}/rules/token/no-trailing-punctuation.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-trailing-punctuation.js +0 -0
- /package/{dist → lib}/rules/token/no-trailing-spaces.d.ts +0 -0
- /package/{dist → lib}/rules/token/no-trailing-spaces.js +0 -0
- /package/{dist → lib}/rules/token/ol-prefix.d.ts +0 -0
- /package/{dist → lib}/rules/token/ol-prefix.js +0 -0
- /package/{dist → lib}/rules/token/proper-names.d.ts +0 -0
- /package/{dist → lib}/rules/token/reference-links-images.d.ts +0 -0
- /package/{dist → lib}/rules/token/reference-links-images.js +0 -0
- /package/{dist → lib}/rules/token/required-headings.d.ts +0 -0
- /package/{dist → lib}/rules/token/single-h1.d.ts +0 -0
- /package/{dist → lib}/rules/token/single-trailing-newline.d.ts +0 -0
- /package/{dist → lib}/rules/token/single-trailing-newline.d.ts.map +0 -0
- /package/{dist → lib}/rules/token/single-trailing-newline.js +0 -0
- /package/{dist → lib}/rules/token/single-trailing-newline.js.map +0 -0
- /package/{dist → lib}/rules/token/strong-style.d.ts +0 -0
- /package/{dist → lib}/rules/token/strong-style.d.ts.map +0 -0
- /package/{dist → lib}/rules/token/strong-style.js +0 -0
- /package/{dist → lib}/rules/token/strong-style.js.map +0 -0
- /package/{dist → lib}/rules/token/table-column-count.d.ts +0 -0
- /package/{dist → lib}/rules/token/table-column-count.js +0 -0
- /package/{dist → lib}/rules/token/table-column-style.d.ts +0 -0
- /package/{dist → lib}/rules/token/table-pipe-style.d.ts +0 -0
- /package/{dist → lib}/rules/token/table-pipe-style.js +0 -0
- /package/{dist → lib}/rules/token/ul-indent.d.ts +0 -0
- /package/{dist → lib}/rules/token/ul-indent.js +0 -0
- /package/{dist → lib}/rules/token/ul-style.d.ts +0 -0
- /package/{dist → lib}/rules/types.js +0 -0
- /package/{dist → lib}/rules/types.js.map +0 -0
- /package/{dist → lib}/scopes/types.js +0 -0
- /package/{dist → lib}/scopes/types.js.map +0 -0
- /package/{dist → lib}/types/assertions.js +0 -0
- /package/{dist → lib}/types/assertions.js.map +0 -0
- /package/{dist → lib}/types/index.d.ts +0 -0
- /package/{dist → lib}/types/index.d.ts.map +0 -0
- /package/{dist → lib}/types/index.js +0 -0
- /package/{dist → lib}/types/index.js.map +0 -0
- /package/{dist → lib}/types/problems.d.ts +0 -0
- /package/{dist → lib}/types/problems.d.ts.map +0 -0
- /package/{dist → lib}/types/problems.js +0 -0
- /package/{dist → lib}/types/problems.js.map +0 -0
- /package/{dist → lib}/types/reporting.js +0 -0
- /package/{dist → lib}/types/reporting.js.map +0 -0
- /package/{dist → lib}/types/rules.js +0 -0
- /package/{dist → lib}/types/rules.js.map +0 -0
- /package/{dist → lib}/types/validation.js +0 -0
- /package/{dist → lib}/types/validation.js.map +0 -0
package/dist/rules/registry.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { swap } from './scope/swap.js';
|
|
2
|
-
import { pattern } from './scope/pattern.js';
|
|
3
|
-
import { semanticLineBreaks } from './scope/semantic-line-breaks.js';
|
|
4
|
-
import { maxImageSize } from './scope/max-image-size.js';
|
|
5
|
-
import { occurrence } from './scope/occurrence.js';
|
|
6
|
-
import { repetition } from './scope/repetition.js';
|
|
7
|
-
import { consistency } from './scope/consistency.js';
|
|
8
|
-
import { conditional } from './scope/conditional.js';
|
|
9
|
-
import { capitalization } from './scope/capitalization.js';
|
|
10
|
-
import { metric } from './scope/metric.js';
|
|
11
|
-
import { spelling } from './scope/spelling.js';
|
|
12
|
-
import { length } from './scope/length.js';
|
|
13
|
-
import { allTokenRules } from './token/index.js';
|
|
14
|
-
// `no-trailing-spaces` and `no-hard-tabs` are token rules with no legacy
|
|
15
|
-
// scope-rule entry under their own id, so `resolveAssertion` falls straight
|
|
16
|
-
// through to them with no alias needed. `single-h1`/`first-line-h1` each
|
|
17
|
-
// carry a permanent, warning-free `aliases` entry (`single-title`/
|
|
18
|
-
// `first-line-heading`) for their upstream markdownlint synonym — see
|
|
19
|
-
// TokenRule.aliases below and each rule's own file. That's the only
|
|
20
|
-
// remaining use of the alias mechanism: the pre-parity native rule ids this
|
|
21
|
-
// registry used to translate (`max-line-length`, `bullet-style`,
|
|
22
|
-
// `no-duplicate-headings`, `no-broken-fragment-links`) were removed
|
|
23
|
-
// entirely rather than kept as deprecated aliases (see PR #24801) — using
|
|
24
|
-
// one of those old ids in a config is now an unknown-assertion validation
|
|
25
|
-
// error, like any other unrecognized id.
|
|
26
|
-
export const scopeRules = {
|
|
27
|
-
swap,
|
|
28
|
-
pattern,
|
|
29
|
-
'semantic-line-breaks': semanticLineBreaks,
|
|
30
|
-
'max-image-size': maxImageSize,
|
|
31
|
-
occurrence,
|
|
32
|
-
repetition,
|
|
33
|
-
consistency,
|
|
34
|
-
conditional,
|
|
35
|
-
capitalization,
|
|
36
|
-
metric,
|
|
37
|
-
spelling,
|
|
38
|
-
length,
|
|
39
|
-
};
|
|
40
|
-
export const tokenRules = [];
|
|
41
|
-
export function getScopeRule(id) {
|
|
42
|
-
const rule = scopeRules[id];
|
|
43
|
-
if (!rule)
|
|
44
|
-
throw new Error(`Unknown assertion: ${id}`);
|
|
45
|
-
return rule;
|
|
46
|
-
}
|
|
47
|
-
const tokenRulesByName = new Map();
|
|
48
|
-
export function registerTokenRules(rules) {
|
|
49
|
-
for (const rule of rules) {
|
|
50
|
-
// Dedupe is by object identity — re-registering the same module is a no-op; two different objects sharing a name would both land in tokenRules (last one wins in the name map).
|
|
51
|
-
if (!tokenRules.includes(rule))
|
|
52
|
-
tokenRules.push(rule);
|
|
53
|
-
tokenRulesByName.set(rule.name, rule);
|
|
54
|
-
for (const alias of rule.aliases ?? []) {
|
|
55
|
-
tokenRulesByName.set(alias, rule);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
export function clearTokenRulesForTests() {
|
|
60
|
-
tokenRules.length = 0;
|
|
61
|
-
tokenRulesByName.clear();
|
|
62
|
-
}
|
|
63
|
-
export function resolveAssertion(id) {
|
|
64
|
-
const scopeRule = scopeRules[id];
|
|
65
|
-
if (scopeRule)
|
|
66
|
-
return { kind: 'scope', rule: scopeRule };
|
|
67
|
-
const rule = tokenRulesByName.get(id);
|
|
68
|
-
if (rule)
|
|
69
|
-
return { kind: 'token', rule };
|
|
70
|
-
throw new Error(`Unknown assertion: ${id}`);
|
|
71
|
-
}
|
|
72
|
-
// Registers every ported markdownlint token rule (see ./token/index.ts) so
|
|
73
|
-
// production entry points (the CLI, the public library API) have the full
|
|
74
|
-
// rule set available without each one needing its own registration wiring
|
|
75
|
-
// — mirroring how `scopeRules` above is populated by direct imports in
|
|
76
|
-
// this same file. Runs once at module load, after registerTokenRules is
|
|
77
|
-
// defined; token/index.ts has no dependency back on this module (it only
|
|
78
|
-
// imports rule types), so this is a plain one-directional import, not a
|
|
79
|
-
// circular one.
|
|
80
|
-
registerTokenRules(allTokenRules);
|
|
81
|
-
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/rules/registry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE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-
{"version":3,"file":"capitalization.d.ts","sourceRoot":"","sources":["../../../src/rules/scope/capitalization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,aAAa,CAAC;AAqM/D,eAAO,MAAM,cAAc,EAAE,SAAiE,CAAC"}
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { formatTemplate } from '../token/messages.js';
|
|
2
|
-
import { newLineRe } from '../../core/line-endings.js';
|
|
3
|
-
import { maskInlineCode, restoreInlineCode } from '../../core/inline-code.js';
|
|
4
|
-
import { apTitleCase, chicagoTitleCase, keepsOwnCasing, buildExceptionPlan, recaseWords, } from './title-case.js';
|
|
5
|
-
import { TECHNICAL_PROPER_NOUNS } from '../../data/proper-nouns.js';
|
|
6
|
-
// Fallback when a programmatically-built rule has no `message` (validate()
|
|
7
|
-
// requires one). %s slots: the segment's first line, then the `match` value.
|
|
8
|
-
const FALLBACK_MESSAGE = '"%s" should use %s capitalization.';
|
|
9
|
-
const DOLLAR_STYLES = new Set(['$title', '$sentence', '$lower', '$upper']);
|
|
10
|
-
// Inline code spans (e.g. '## the `configFile` option') must never be
|
|
11
|
-
// flagged or rewritten by the `$`-styles: they're masked out with the
|
|
12
|
-
// shared, length-preserving maskInlineCode/restoreInlineCode pair
|
|
13
|
-
// (core/inline-code.ts) -- see there for the CommonMark span-recognition
|
|
14
|
-
// and offset-preservation contract. Segments here are always single-line
|
|
15
|
-
// by the time masking runs (see collectSites' multi-line skip below),
|
|
16
|
-
// matching BACKTICK_SPAN_RE's own single-line content restriction.
|
|
17
|
-
// $sentence
|
|
18
|
-
//
|
|
19
|
-
// Sentence case doesn't need AP/Chicago's stopword lists, so it isn't
|
|
20
|
-
// implemented via title-case.ts's apTitleCase/chicagoTitleCase: only the
|
|
21
|
-
// FIRST word is capitalized, every other word is lowercased -- unless it's an
|
|
22
|
-
// exception (as-written) or already ALL-CAPS (left alone), the same carve-outs
|
|
23
|
-
// those two use.
|
|
24
|
-
//
|
|
25
|
-
// It does share title-case.ts's tokenization and exception handling, though:
|
|
26
|
-
// `buildExceptionPlan` is the SAME exception decision apTitleCase/
|
|
27
|
-
// chicagoTitleCase make (see its doc comment for why this must not be a second
|
|
28
|
-
// independent map -- a dotted/multi-word entry like 'Node.js' or 'VS Code'
|
|
29
|
-
// cannot survive per-word splitting under either style, so both must agree on
|
|
30
|
-
// treating it as a phrase), and `recaseWords` is the same tokenizer, which is
|
|
31
|
-
// what makes each phrase ONE token that counts toward word position. $sentence
|
|
32
|
-
// only supplies its own per-word casing rule below.
|
|
33
|
-
// Follows `startsSentence`, not `index === 0`: a heading can carry more than
|
|
34
|
-
// one sentence (`Step 1. Configure the project`). recaseWords decides where.
|
|
35
|
-
function sentenceCase(text, exceptions) {
|
|
36
|
-
const { wordMap, phrases } = buildExceptionPlan(exceptions);
|
|
37
|
-
return recaseWords(text, phrases, (word, _index, _total, startsSentence) => {
|
|
38
|
-
const exceptionHit = wordMap.get(word.toLowerCase());
|
|
39
|
-
if (exceptionHit !== undefined)
|
|
40
|
-
return exceptionHit;
|
|
41
|
-
if (keepsOwnCasing(word))
|
|
42
|
-
return word;
|
|
43
|
-
if (startsSentence)
|
|
44
|
-
return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();
|
|
45
|
-
return word.toLowerCase();
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
function applyDollarStyle(style, text, titleStyle, exceptions) {
|
|
49
|
-
switch (style) {
|
|
50
|
-
case '$title':
|
|
51
|
-
return titleStyle === 'chicago'
|
|
52
|
-
? chicagoTitleCase(text, exceptions)
|
|
53
|
-
: apTitleCase(text, exceptions);
|
|
54
|
-
case '$sentence':
|
|
55
|
-
return sentenceCase(text, exceptions);
|
|
56
|
-
case '$lower':
|
|
57
|
-
return text.toLowerCase();
|
|
58
|
-
case '$upper':
|
|
59
|
-
return text.toUpperCase();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
// Shared by execute() and fix() so problems and fixes can never disagree
|
|
63
|
-
// about which segments are flagged.
|
|
64
|
-
//
|
|
65
|
-
// Multi-line segments are skipped by BOTH for the `$`-styles, not just by
|
|
66
|
-
// fix(): a `Fix` can only rewrite one line, so a flagged multi-line segment
|
|
67
|
-
// would have no corresponding fix. Custom regex `match` mode never produces
|
|
68
|
-
// a fix regardless, so multi-line segments are still checked there.
|
|
69
|
-
function collectSites(rule, ctx) {
|
|
70
|
-
const options = (rule.assertions['capitalization'] ?? {});
|
|
71
|
-
const sites = [];
|
|
72
|
-
if (!DOLLAR_STYLES.has(options.match)) {
|
|
73
|
-
// Custom regex: the WHOLE segment text must satisfy it. Detection-only
|
|
74
|
-
// -- there's no transform to derive a fix from.
|
|
75
|
-
let regex;
|
|
76
|
-
try {
|
|
77
|
-
regex = new RegExp(options.match ?? '');
|
|
78
|
-
}
|
|
79
|
-
catch {
|
|
80
|
-
return []; // ignore invalid regex
|
|
81
|
-
}
|
|
82
|
-
for (const segment of ctx.segments) {
|
|
83
|
-
if (regex.test(segment.content))
|
|
84
|
-
continue;
|
|
85
|
-
sites.push({ segment, corrected: segment.content, fixable: false });
|
|
86
|
-
}
|
|
87
|
-
return sites;
|
|
88
|
-
}
|
|
89
|
-
const style = options.match;
|
|
90
|
-
const titleStyle = options.style ?? 'ap';
|
|
91
|
-
// Users should not re-author the industry's proper-noun list in every
|
|
92
|
-
// config; the built-ins are UNIONED with the rule's own `exceptions`
|
|
93
|
-
// (rather than the rule's list replacing them) so a preset-configured list
|
|
94
|
-
// and a user list compose, and a user override of `exceptions` can never
|
|
95
|
-
// accidentally drop the common vocabulary. `builtinVocabulary: false`
|
|
96
|
-
// opts back into the pre-built-in strict/closed behavior. See
|
|
97
|
-
// ../../data/proper-nouns.ts for the vocabulary and its inclusion bar.
|
|
98
|
-
const exceptions = options.builtinVocabulary === false
|
|
99
|
-
? (options.exceptions ?? [])
|
|
100
|
-
: [...TECHNICAL_PROPER_NOUNS, ...(options.exceptions ?? [])];
|
|
101
|
-
for (const segment of ctx.segments) {
|
|
102
|
-
// Multi-line: symmetric skip, see doc comment above.
|
|
103
|
-
if (segment.startLine !== segment.endLine)
|
|
104
|
-
continue;
|
|
105
|
-
const masked = maskInlineCode(segment.content);
|
|
106
|
-
const transformedMasked = applyDollarStyle(style, masked, titleStyle, exceptions);
|
|
107
|
-
// Non-length-preserving case mapping (e.g. 'ß'.toUpperCase() === 'SS'):
|
|
108
|
-
// restoreInlineCode's splice assumes casing-only changes, so shifted
|
|
109
|
-
// offsets would splice masked spans back at the wrong position. A length
|
|
110
|
-
// change still proves a violation, so report it -- detection-only, no fix.
|
|
111
|
-
if (transformedMasked.length !== masked.length) {
|
|
112
|
-
sites.push({ segment, corrected: segment.content, fixable: false });
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
const corrected = restoreInlineCode(segment.content, transformedMasked);
|
|
116
|
-
if (corrected === segment.content)
|
|
117
|
-
continue;
|
|
118
|
-
sites.push({ segment, corrected, fixable: true });
|
|
119
|
-
}
|
|
120
|
-
return sites;
|
|
121
|
-
}
|
|
122
|
-
const execute = async (rule, file, ctx) => {
|
|
123
|
-
const options = (rule.assertions['capitalization'] ?? {});
|
|
124
|
-
return collectSites(rule, ctx).map(({ segment, fixable }) => {
|
|
125
|
-
// Report the source, not the prose view: a segment whose markdoc tags were
|
|
126
|
-
// masked out carries a run of blanks where `{% partial /%}` sits in the
|
|
127
|
-
// file, and echoing that back in `match` or the message would show the user
|
|
128
|
-
// a hole in their own heading. `sourceText` is the verbatim slice and is the
|
|
129
|
-
// same length as `content`, so nothing else shifts. Detection still runs on
|
|
130
|
-
// `content`, so a tag influences the report but never the casing decision.
|
|
131
|
-
const sourceText = segment.sourceText ?? segment.content;
|
|
132
|
-
// newLineRe, not '\n': a bare split leaves a trailing '\r' on CRLF content.
|
|
133
|
-
const firstLine = sourceText.split(newLineRe)[0] ?? '';
|
|
134
|
-
return {
|
|
135
|
-
file,
|
|
136
|
-
line: segment.startLine,
|
|
137
|
-
column: segment.startColumn,
|
|
138
|
-
text: firstLine,
|
|
139
|
-
match: sourceText,
|
|
140
|
-
ruleName: rule.name,
|
|
141
|
-
severity: rule.severity,
|
|
142
|
-
message: formatTemplate(rule.message ?? FALLBACK_MESSAGE, firstLine, options.match),
|
|
143
|
-
fixable,
|
|
144
|
-
};
|
|
145
|
-
});
|
|
146
|
-
};
|
|
147
|
-
const fix = async (rule, file, ctx) => {
|
|
148
|
-
const fixes = [];
|
|
149
|
-
for (const site of collectSites(rule, ctx)) {
|
|
150
|
-
if (!site.fixable)
|
|
151
|
-
continue;
|
|
152
|
-
fixes.push({
|
|
153
|
-
file,
|
|
154
|
-
ruleName: rule.name,
|
|
155
|
-
lineNumber: site.segment.startLine,
|
|
156
|
-
editColumn: site.segment.startColumn,
|
|
157
|
-
deleteCount: site.segment.content.length,
|
|
158
|
-
insertText: site.corrected,
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
return fixes;
|
|
162
|
-
};
|
|
163
|
-
export const capitalization = { id: 'capitalization', fixable: true, execute, fix };
|
|
164
|
-
//# sourceMappingURL=capitalization.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capitalization.js","sourceRoot":"","sources":["../../../src/rules/scope/capitalization.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,WAAW,GACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,2EAA2E;AAC3E,6EAA6E;AAC7E,MAAM,gBAAgB,GAAG,oCAAoC,CAAC;AAE9D,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,E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,OAAO;YAAE,SAAS;QAC5B,KAAK,CAAC,IAAI,CAAC;YACT,IAAI;YACJ,QAAQ,EAAE,IAAI,CAAC,IAAI;YACnB,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;YAClC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW;YACpC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM;YACxC,UAAU,EAAE,IAAI,CAAC,SAAS;SAC3B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAc,EAAE,EAAE,EAAE,gBAAgB,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conditional.d.ts","sourceRoot":"","sources":["../../../src/rules/scope/conditional.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,aAAa,CAAC;AAkI/D,eAAO,MAAM,WAAW,EAAE,SAA0D,CAAC"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { formatTemplate } from '../token/messages.js';
|
|
2
|
-
import { newLineRe, offsetToLineColumn } from '../../core/line-endings.js';
|
|
3
|
-
// On the segment's first line, segment.content starts mid-source-line (e.g.
|
|
4
|
-
// a heading's content excludes the '## ' marker), so segment.startColumn
|
|
5
|
-
// must be added -- see pattern.ts's toSourceColumn.
|
|
6
|
-
function toSourceColumn(segment, localLine, localColumn) {
|
|
7
|
-
return localLine === 1 ? segment.startColumn + (localColumn - 1) : localColumn;
|
|
8
|
-
}
|
|
9
|
-
// Fallback when a programmatically-built rule has no `message` (validate()
|
|
10
|
-
// requires one). %s slots: the `first` match, then the missing `second` pattern.
|
|
11
|
-
const FALLBACK_MESSAGE = '"%s" appears but "%s" was never introduced.';
|
|
12
|
-
// `second` only counts as "present" via a real, non-empty match -- a bare
|
|
13
|
-
// `.test()`/`.exec()` truthiness check would also succeed on a zero-width
|
|
14
|
-
// match (e.g. a `second` pattern like 'x*', '.*', '\b'), which "matches"
|
|
15
|
-
// at every position even with no literal occurrence anywhere in the file,
|
|
16
|
-
// silently satisfying the rule. Mirrors the zero-width skip `first`'s own
|
|
17
|
-
// exec loop uses below: advance lastIndex past an empty match instead of
|
|
18
|
-
// treating it as a hit, or the loop would also hang.
|
|
19
|
-
function secondHasNonEmptyMatch(secondRe, content) {
|
|
20
|
-
secondRe.lastIndex = 0;
|
|
21
|
-
let match;
|
|
22
|
-
while ((match = secondRe.exec(content)) !== null) {
|
|
23
|
-
if (match[0].length === 0) {
|
|
24
|
-
secondRe.lastIndex++;
|
|
25
|
-
continue;
|
|
26
|
-
}
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
// Vale-parity `conditional` check (detection-only): if `first` matches
|
|
32
|
-
// anywhere within the rule's scoped segments, `second` must exist somewhere
|
|
33
|
-
// in the whole file -- tested against `ctx.content` (the full raw file),
|
|
34
|
-
// NOT `ctx.segments`, so a `second` match outside the rule's own scope
|
|
35
|
-
// (e.g. inside a code block) still satisfies it. When `second` is absent
|
|
36
|
-
// file-wide, every `first` match becomes a problem, deduped by absolute
|
|
37
|
-
// source position: overlapping scopes (e.g. `[paragraph, sentence]`) match
|
|
38
|
-
// the same source occurrence once per covering segment.
|
|
39
|
-
//
|
|
40
|
-
// Both `first` and `second` are raw user regex patterns (like `pattern`'s
|
|
41
|
-
// `tokens`, not escaped literals); an invalid regex in either one silently
|
|
42
|
-
// produces zero problems rather than crashing the run.
|
|
43
|
-
function collectMatches(rule, ctx) {
|
|
44
|
-
const options = (rule.assertions['conditional'] ?? {});
|
|
45
|
-
const flags = options.ignoreCase ? 'gi' : 'g';
|
|
46
|
-
let secondRe;
|
|
47
|
-
try {
|
|
48
|
-
secondRe = new RegExp(options.second ?? '', flags);
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
return [];
|
|
52
|
-
}
|
|
53
|
-
// Tested against the whole file, not ctx.segments -- see doc comment above.
|
|
54
|
-
if (secondHasNonEmptyMatch(secondRe, ctx.content))
|
|
55
|
-
return [];
|
|
56
|
-
let firstRe;
|
|
57
|
-
try {
|
|
58
|
-
firstRe = new RegExp(options.first ?? '', flags);
|
|
59
|
-
}
|
|
60
|
-
catch {
|
|
61
|
-
return [];
|
|
62
|
-
}
|
|
63
|
-
const seen = new Set();
|
|
64
|
-
const sites = [];
|
|
65
|
-
for (const segment of ctx.segments) {
|
|
66
|
-
// newLineRe, not '\n': a bare split leaves a trailing '\r' on CRLF content.
|
|
67
|
-
const contentLines = segment.content.split(newLineRe);
|
|
68
|
-
firstRe.lastIndex = 0;
|
|
69
|
-
let match;
|
|
70
|
-
while ((match = firstRe.exec(segment.content)) !== null) {
|
|
71
|
-
// Zero-width match (e.g. a `first` pattern like `x*`): advance
|
|
72
|
-
// lastIndex or the loop hangs, and skip recording it -- an empty-text
|
|
73
|
-
// match has no real `first` occurrence to report, and without this
|
|
74
|
-
// `continue` every position the pattern passed through became its own
|
|
75
|
-
// spammy problem.
|
|
76
|
-
if (match[0].length === 0) {
|
|
77
|
-
firstRe.lastIndex++;
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
const local = offsetToLineColumn(segment.content, match.index);
|
|
81
|
-
const line = segment.startLine + local.line - 1;
|
|
82
|
-
const column = toSourceColumn(segment, local.line, local.column);
|
|
83
|
-
const positionKey = `${line}:${column}`;
|
|
84
|
-
if (seen.has(positionKey))
|
|
85
|
-
continue; // overlapping segments, same source occurrence
|
|
86
|
-
seen.add(positionKey);
|
|
87
|
-
sites.push({
|
|
88
|
-
line,
|
|
89
|
-
column,
|
|
90
|
-
text: match[0],
|
|
91
|
-
lineText: contentLines[local.line - 1] ?? '',
|
|
92
|
-
second: options.second ?? '',
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
sites.sort((a, b) => a.line - b.line || a.column - b.column);
|
|
97
|
-
return sites;
|
|
98
|
-
}
|
|
99
|
-
const execute = async (rule, file, ctx) => {
|
|
100
|
-
return collectMatches(rule, ctx).map((site) => ({
|
|
101
|
-
file,
|
|
102
|
-
line: site.line,
|
|
103
|
-
column: site.column,
|
|
104
|
-
text: site.lineText,
|
|
105
|
-
match: site.text,
|
|
106
|
-
ruleName: rule.name,
|
|
107
|
-
severity: rule.severity,
|
|
108
|
-
message: formatTemplate(rule.message ?? FALLBACK_MESSAGE, site.text, site.second),
|
|
109
|
-
}));
|
|
110
|
-
};
|
|
111
|
-
export const conditional = { id: 'conditional', fixable: false, execute };
|
|
112
|
-
//# sourceMappingURL=conditional.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conditional.js","sourceRoot":"","sources":["../../../src/rules/scope/conditional.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAE3E,4EAA4E;AAC5E,yEAAyE;AACzE,oDAAoD;AACpD,SAAS,cAAc,CAAC,OAAgC,EAAE,SAAiB,EAAE,WAAmB;IAC9F,OAAO,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,GAAG,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;AACjF,CAAC;AAED,2EAA2E;AAC3E,iFAAiF;AACjF,MAAM,gBAAgB,GAAG,6CAA6C,CAAC;AAUvE,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,qDAAqD;AACrD,SAAS,sBAAsB,CAAC,QAAgB,EAAE,OAAe;IAC/D,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC;IACvB,IAAI,KAA6B,CAAC;IAClC,OAAO,CA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emplate } from '../token/messages.js';
|
|
2
|
-
import { newLineRe, offsetToLineColumn } from '../../core/line-endings.js';
|
|
3
|
-
import { applyMatchCase } from '../../core/case-preserve.js';
|
|
4
|
-
// Mechanical proxy for "is this pair a same-word normalization (safe to
|
|
5
|
-
// rewrite blindly) or a substitution that can expand ambiguously (not
|
|
6
|
-
// safe)?" -- same shape as applyMatchCase's multi-word guard in
|
|
7
|
-
// case-preserve.ts: a checkable structural property (word count) that
|
|
8
|
-
// correlates with the semantic hazard, rather than an attempt to
|
|
9
|
-
// understand the words themselves. `colour`/`color` is one word either
|
|
10
|
-
// way. `it's`/`it is` is one word vs. two -- and that word-count jump is
|
|
11
|
-
// exactly where the ambiguity lives: `it's` expands to EITHER "it is" OR
|
|
12
|
-
// "it has", so picking "it is" as the winner and rewriting every "it's" to
|
|
13
|
-
// it is flat wrong whenever the source meant "it has" (see this file's
|
|
14
|
-
// fix() doc comment and the bug this guard closes: "It is fine. ... it's
|
|
15
|
-
// been growing for hours." -> "it is been growing for hours."). Splitting
|
|
16
|
-
// on whitespace is deliberately simple -- like applyMatchCase's `/\s/`
|
|
17
|
-
// check, it does not try to be a linguistic word tokenizer, just a cheap,
|
|
18
|
-
// reliable signal for "the replacement isn't shaped like the match
|
|
19
|
-
// any more."
|
|
20
|
-
//
|
|
21
|
-
// KNOWN EDGE, not fixed here (false positive, accepted cost): this guard
|
|
22
|
-
// cannot distinguish "crosses a word boundary AND is ambiguous" (`it's` ->
|
|
23
|
-
// EITHER "it is" or "it has") from "crosses a word boundary but has only
|
|
24
|
-
// ONE possible expansion" (`don't` -> always "do not", never anything
|
|
25
|
-
// else). `microsoft/contraction-consistency` ships exactly this shape
|
|
26
|
-
// alongside `it's`/`it is`: `don't`/`do not`, `won't`/`will not`, and
|
|
27
|
-
// `isn't`/`is not` are each a single, unambiguous contraction/expansion
|
|
28
|
-
// pair (1 word vs. 2), and this guard blocks fixing all three, same as it
|
|
29
|
-
// blocks `it's`/`it is` -- even though, unlike `it's`, none of them has a
|
|
30
|
-
// second meaning a blind rewrite could pick wrong. `can't`/`cannot` is the
|
|
31
|
-
// one pair in that same rule the guard does NOT block, only because
|
|
32
|
-
// "cannot" happens to be written as one word rather than two ("can not"
|
|
33
|
-
// would trip the guard identically, despite being just as unambiguous as
|
|
34
|
-
// "do not"). Word count is a proxy for "may be ambiguous," not a test of
|
|
35
|
-
// ambiguity itself, so it necessarily also catches unambiguous pairs that
|
|
36
|
-
// merely happen to differ in word count -- the same shape as
|
|
37
|
-
// applyMatchCase's own accepted edge (a hyphen-only replacement counts as
|
|
38
|
-
// "one word" and still gets shouted). Narrowing further (e.g. a hand-listed
|
|
39
|
-
// exception for "known-unambiguous" contractions) would repeat the exact
|
|
40
|
-
// per-pair-criterion pattern this whole change retires elsewhere in this
|
|
41
|
-
// package -- so the false positive is accepted, not patched, and recorded
|
|
42
|
-
// here so it is a known trade-off rather than an undocumented side effect.
|
|
43
|
-
function wordCount(text) {
|
|
44
|
-
return text.trim().split(/\s+/).filter(Boolean).length;
|
|
45
|
-
}
|
|
46
|
-
// On the segment's first line, segment.content starts mid-source-line (e.g.
|
|
47
|
-
// a heading's content excludes the '## ' marker), so segment.startColumn
|
|
48
|
-
// must be added -- see pattern.ts's toSourceColumn.
|
|
49
|
-
function toSourceColumn(segment, localLine, localColumn) {
|
|
50
|
-
return localLine === 1 ? segment.startColumn + (localColumn - 1) : localColumn;
|
|
51
|
-
}
|
|
52
|
-
// Fallback when a programmatically-built rule has no `message` (validate()
|
|
53
|
-
// requires one). %s slots: matched text, then the first-seen winner.
|
|
54
|
-
const FALLBACK_MESSAGE = 'Inconsistent spelling: "%s" conflicts with first-seen "%s".';
|
|
55
|
-
// Shared by execute() and fix(). For each `either` pair, scans ALL segments
|
|
56
|
-
// for BOTH variants (regex-escaped literals with \b word boundaries, like
|
|
57
|
-
// `swap` keys), maps every match to its absolute source position, then:
|
|
58
|
-
//
|
|
59
|
-
// 1. Dedupes by `line:column:variant` BEFORE deciding the winner:
|
|
60
|
-
// overlapping scopes (e.g. `[paragraph, sentence]`) match the same
|
|
61
|
-
// source occurrence once per covering segment, double-counting it and
|
|
62
|
-
// scrambling which variant looks 'first'.
|
|
63
|
-
// 2. Sorts by (line, column): the winner is the first match in SOURCE
|
|
64
|
-
// ORDER, file-wide -- not collection order, which scans the pair's key
|
|
65
|
-
// before its value and would always crown the key.
|
|
66
|
-
//
|
|
67
|
-
// Every later match of the OTHER (losing) variant yields one site.
|
|
68
|
-
function collectMatches(rule, ctx) {
|
|
69
|
-
const options = (rule.assertions['consistency'] ?? {});
|
|
70
|
-
const flags = options.ignoreCase ? 'gi' : 'g';
|
|
71
|
-
const sites = [];
|
|
72
|
-
for (const [key, value] of Object.entries(options.either ?? {})) {
|
|
73
|
-
// Same-word-count guard, computed once per PAIR (not per occurrence):
|
|
74
|
-
// whichever variant wins first-seen, a fix is only offered when the key
|
|
75
|
-
// and value are the same number of words. See wordCount()'s doc comment
|
|
76
|
-
// above for why a word-count mismatch (e.g. `it's` vs. `it is`) is
|
|
77
|
-
// exactly where a contraction's ambiguous expansion lives.
|
|
78
|
-
const fixable = wordCount(key) === wordCount(String(value));
|
|
79
|
-
const seen = new Set();
|
|
80
|
-
const matches = [];
|
|
81
|
-
for (const variant of [key, String(value)]) {
|
|
82
|
-
// An empty variant (only reachable when a caller bypasses validate())
|
|
83
|
-
// would escape to the zero-width `\b\b`, matching nearly every
|
|
84
|
-
// position and spuriously winning as "first-seen". Skip it.
|
|
85
|
-
if (variant.length === 0)
|
|
86
|
-
continue;
|
|
87
|
-
// Same escaping as swap keys: variants are literals, so regex
|
|
88
|
-
// metacharacters (e.g. 'e.g.') must not act as syntax.
|
|
89
|
-
const escaped = variant.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
90
|
-
const regex = new RegExp(`\\b${escaped}\\b`, flags);
|
|
91
|
-
for (const segment of ctx.segments) {
|
|
92
|
-
// newLineRe, not '\n': a bare split leaves a trailing '\r' on CRLF content.
|
|
93
|
-
const contentLines = segment.content.split(newLineRe);
|
|
94
|
-
regex.lastIndex = 0;
|
|
95
|
-
let match;
|
|
96
|
-
while ((match = regex.exec(segment.content)) !== null) {
|
|
97
|
-
// No zero-width guard needed (unlike swap/conditional/repetition):
|
|
98
|
-
// the empty-variant skip above guarantees `escaped` is a non-empty
|
|
99
|
-
// literal, and \b...\b only adds zero-width assertions around it,
|
|
100
|
-
// so `match[0]` can never be empty here.
|
|
101
|
-
const local = offsetToLineColumn(segment.content, match.index);
|
|
102
|
-
const line = segment.startLine + local.line - 1;
|
|
103
|
-
const column = toSourceColumn(segment, local.line, local.column);
|
|
104
|
-
const positionKey = `${line}:${column}:${variant}`;
|
|
105
|
-
if (seen.has(positionKey))
|
|
106
|
-
continue; // overlapping segments, same source occurrence
|
|
107
|
-
seen.add(positionKey);
|
|
108
|
-
matches.push({
|
|
109
|
-
line,
|
|
110
|
-
column,
|
|
111
|
-
text: match[0],
|
|
112
|
-
lineText: contentLines[local.line - 1] ?? '',
|
|
113
|
-
variant,
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
if (matches.length === 0)
|
|
119
|
-
continue;
|
|
120
|
-
matches.sort((a, b) => a.line - b.line || a.column - b.column);
|
|
121
|
-
const winner = matches[0].variant;
|
|
122
|
-
for (const found of matches) {
|
|
123
|
-
if (found.variant !== winner) {
|
|
124
|
-
sites.push({
|
|
125
|
-
line: found.line,
|
|
126
|
-
column: found.column,
|
|
127
|
-
text: found.text,
|
|
128
|
-
lineText: found.lineText,
|
|
129
|
-
winner,
|
|
130
|
-
fixable,
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
// Pairs are processed one at a time, so multi-pair results arrive grouped
|
|
136
|
-
// by pair; re-sort so problems/fixes read in source order.
|
|
137
|
-
sites.sort((a, b) => a.line - b.line || a.column - b.column);
|
|
138
|
-
return sites;
|
|
139
|
-
}
|
|
140
|
-
const execute = async (rule, file, ctx) => {
|
|
141
|
-
return collectMatches(rule, ctx).map((site) => ({
|
|
142
|
-
file,
|
|
143
|
-
line: site.line,
|
|
144
|
-
column: site.column,
|
|
145
|
-
text: site.lineText,
|
|
146
|
-
match: site.text,
|
|
147
|
-
ruleName: rule.name,
|
|
148
|
-
severity: rule.severity,
|
|
149
|
-
message: formatTemplate(rule.message ?? FALLBACK_MESSAGE, site.text, site.winner),
|
|
150
|
-
fixable: site.fixable,
|
|
151
|
-
}));
|
|
152
|
-
};
|
|
153
|
-
const fix = async (rule, file, ctx) => {
|
|
154
|
-
// Same-word-count guard (see wordCount()'s doc comment above): a
|
|
155
|
-
// different-word-count pair (e.g. `it's`/`it is`) still gets REPORTED by
|
|
156
|
-
// execute() above -- collectMatches() doesn't distinguish the two
|
|
157
|
-
// functions -- but must never be auto-fixed, so it's filtered out here,
|
|
158
|
-
// after collection, rather than skipped during collection itself.
|
|
159
|
-
return collectMatches(rule, ctx)
|
|
160
|
-
.filter((site) => site.fixable)
|
|
161
|
-
.map((site) => ({
|
|
162
|
-
file,
|
|
163
|
-
ruleName: rule.name,
|
|
164
|
-
lineNumber: site.line,
|
|
165
|
-
editColumn: site.column,
|
|
166
|
-
deleteCount: site.text.length,
|
|
167
|
-
// Apply the MATCHED text's observed casing to the winner, not the
|
|
168
|
-
// winner as authored in config: with `ignoreCase: true`, a
|
|
169
|
-
// sentence-initial 'Behaviour' would otherwise be replaced by the
|
|
170
|
-
// literal (lowercase-first) authored winner 'behavior', silently
|
|
171
|
-
// lowercasing the start of the sentence -- the exact hazard
|
|
172
|
-
// applyMatchCase exists to prevent, and swap.ts:177 already guards
|
|
173
|
-
// against for the `swap` assertion. `consistency` shares the same
|
|
174
|
-
// ignoreCase/fix shape, so it needs the same guard.
|
|
175
|
-
insertText: applyMatchCase(site.text, site.winner),
|
|
176
|
-
}));
|
|
177
|
-
};
|
|
178
|
-
export const consistency = { id: 'consistency', fixable: true, execute, fix };
|
|
179
|
-
//# sourceMappingURL=consistency.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consistency.js","sourceRoot":"","sources":["../../../src/rules/scope/consistency.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAmB7D,wEAAwE;AACxE,sEAAsE;AACtE,gEAAgE;AAChE,sEAAsE;AACtE,iEAAiE;AACjE,uEAAuE;AACvE,yEAAyE;AACzE,yEAAyE;AACzE,2EAA2E;AAC3E,uEAAuE;AACvE,yEAAyE;AACzE,0EAA0E;AAC1E,uEAAuE;AACvE,0EAA0E;AAC1E,mEAAmE;AACnE,aAAa;AACb,EAAE;AACF,yEAAyE;AACzE,2EAA2E;AAC3E,yEAAyE;AACzE,sEAAsE;AACtE,sEAAsE;AACtE,sEAAsE;AACtE,wEAAwE;AACxE,0EAA0E;AAC1E,0EAA0E;AAC1E,2EAA2E;AAC3E,oEAAoE;AACpE,wEAAwE;AACxE,yEAAyE;AACzE,yEAAyE;AACzE,0EAA0E;AAC1E,6DAA6D;AAC7D,0EAA0E;AAC1E,4EAA4E;AAC5E,yEAAyE;AACzE,yEAAyE;AACzE,0EAA0E;AAC1E,2EAA2E;AAC3E,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;AACzD,CAAC;AAED,4EAA4E;AAC5E,yEAAyE;AACzE,oDAAoD;AACpD,SAAS,cAAc,CAAC,OAAgC,EAAE,SAAiB,EAAE,WAAmB;IAC9F,OAAO,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,GAAG,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC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