@redocly/recheck 0.1.0 → 0.2.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 +1006 -56
- package/dist/cli.js +27 -7
- package/dist/cli.js.map +1 -1
- package/dist/commands/markdoc-schema.d.ts +17 -0
- package/dist/commands/markdoc-schema.d.ts.map +1 -0
- package/dist/commands/markdoc-schema.js +127 -0
- package/dist/commands/markdoc-schema.js.map +1 -0
- package/dist/commands/run.d.ts +0 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +68 -5
- package/dist/commands/run.js.map +1 -1
- package/dist/config/load.d.ts +11 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +12 -2
- package/dist/config/load.js.map +1 -1
- package/dist/config/presets/google.d.ts +3 -0
- package/dist/config/presets/google.d.ts.map +1 -0
- package/dist/config/presets/google.js +1671 -0
- package/dist/config/presets/google.js.map +1 -0
- package/dist/config/presets/inclusive-language.d.ts +3 -0
- package/dist/config/presets/inclusive-language.d.ts.map +1 -0
- package/dist/config/presets/inclusive-language.js +321 -0
- package/dist/config/presets/inclusive-language.js.map +1 -0
- package/dist/config/presets/index.d.ts +67 -0
- package/dist/config/presets/index.d.ts.map +1 -0
- package/dist/config/presets/index.js +137 -0
- package/dist/config/presets/index.js.map +1 -0
- package/dist/config/presets/markdoc.d.ts +21 -0
- package/dist/config/presets/markdoc.d.ts.map +1 -0
- package/dist/config/presets/markdoc.js +101 -0
- package/dist/config/presets/markdoc.js.map +1 -0
- package/dist/config/presets/markdown-relaxed.d.ts +3 -0
- package/dist/config/presets/markdown-relaxed.d.ts.map +1 -0
- package/dist/config/presets/markdown-relaxed.js +98 -0
- package/dist/config/presets/markdown-relaxed.js.map +1 -0
- package/dist/config/presets/markdown.d.ts +43 -0
- package/dist/config/presets/markdown.d.ts.map +1 -0
- package/dist/config/presets/markdown.js +132 -0
- package/dist/config/presets/markdown.js.map +1 -0
- package/dist/config/presets/microsoft.d.ts +3 -0
- package/dist/config/presets/microsoft.d.ts.map +1 -0
- package/dist/config/presets/microsoft.js +2268 -0
- package/dist/config/presets/microsoft.js.map +1 -0
- package/dist/config/presets/minimal.d.ts +3 -0
- package/dist/config/presets/minimal.d.ts.map +1 -0
- package/dist/config/presets/minimal.js +21 -0
- package/dist/config/presets/minimal.js.map +1 -0
- package/dist/config/presets/plain-language.d.ts +3 -0
- package/dist/config/presets/plain-language.d.ts.map +1 -0
- package/dist/config/presets/plain-language.js +351 -0
- package/dist/config/presets/plain-language.js.map +1 -0
- package/dist/config/presets/prose.d.ts +52 -0
- package/dist/config/presets/prose.d.ts.map +1 -0
- package/dist/config/presets/prose.js +138 -0
- package/dist/config/presets/prose.js.map +1 -0
- package/dist/config/schema.d.ts +128 -22
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +105 -21
- package/dist/config/schema.js.map +1 -1
- package/dist/config/validate.d.ts +12 -2
- package/dist/config/validate.d.ts.map +1 -1
- package/dist/config/validate.js +1200 -44
- package/dist/config/validate.js.map +1 -1
- package/dist/core/auto-fix.d.ts +8 -13
- package/dist/core/auto-fix.d.ts.map +1 -1
- package/dist/core/auto-fix.js +94 -75
- package/dist/core/auto-fix.js.map +1 -1
- package/dist/core/case-preserve.d.ts +46 -0
- package/dist/core/case-preserve.d.ts.map +1 -0
- package/dist/core/case-preserve.js +57 -0
- package/dist/core/case-preserve.js.map +1 -0
- package/dist/core/directives.d.ts +9 -0
- package/dist/core/directives.d.ts.map +1 -0
- package/dist/core/directives.js +73 -0
- package/dist/core/directives.js.map +1 -0
- package/dist/core/files.d.ts +63 -0
- package/dist/core/files.d.ts.map +1 -1
- package/dist/core/files.js +185 -0
- package/dist/core/files.js.map +1 -1
- package/dist/core/inline-code.d.ts +87 -0
- package/dist/core/inline-code.d.ts.map +1 -0
- package/dist/core/inline-code.js +104 -0
- package/dist/core/inline-code.js.map +1 -0
- package/dist/core/line-endings.d.ts +32 -0
- package/dist/core/line-endings.d.ts.map +1 -0
- package/dist/core/line-endings.js +65 -0
- package/dist/core/line-endings.js.map +1 -0
- package/dist/core/markdoc-tags.d.ts +79 -0
- package/dist/core/markdoc-tags.d.ts.map +1 -0
- package/dist/core/markdoc-tags.js +131 -0
- package/dist/core/markdoc-tags.js.map +1 -0
- package/dist/core/runner.d.ts +92 -3
- package/dist/core/runner.d.ts.map +1 -1
- package/dist/core/runner.js +348 -110
- package/dist/core/runner.js.map +1 -1
- package/dist/core/timing.d.ts.map +1 -1
- package/dist/data/markdoc-realm-schema.d.ts +3 -0
- package/dist/data/markdoc-realm-schema.d.ts.map +1 -0
- package/dist/data/markdoc-realm-schema.js +760 -0
- package/dist/data/markdoc-realm-schema.js.map +1 -0
- package/dist/data/proper-nouns.d.ts +2 -0
- package/dist/data/proper-nouns.d.ts.map +1 -0
- package/dist/data/proper-nouns.js +208 -0
- package/dist/data/proper-nouns.js.map +1 -0
- package/dist/index.d.ts +90 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +152 -0
- package/dist/index.js.map +1 -0
- package/dist/metrics/formulas.d.ts +17 -0
- package/dist/metrics/formulas.d.ts.map +1 -0
- package/dist/metrics/formulas.js +70 -0
- package/dist/metrics/formulas.js.map +1 -0
- package/dist/metrics/index.d.ts +5 -0
- package/dist/metrics/index.d.ts.map +1 -0
- package/dist/metrics/index.js +3 -0
- package/dist/metrics/index.js.map +1 -0
- package/dist/metrics/statistics.d.ts +27 -0
- package/dist/metrics/statistics.d.ts.map +1 -0
- package/dist/metrics/statistics.js +56 -0
- package/dist/metrics/statistics.js.map +1 -0
- package/dist/parser/index.d.ts +18 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +168 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/markdoc/extract-statics.d.ts +45 -0
- package/dist/parser/markdoc/extract-statics.d.ts.map +1 -0
- package/dist/parser/markdoc/extract-statics.js +139 -0
- package/dist/parser/markdoc/extract-statics.js.map +1 -0
- package/dist/parser/markdoc/pairing.d.ts +63 -0
- package/dist/parser/markdoc/pairing.d.ts.map +1 -0
- package/dist/parser/markdoc/pairing.js +94 -0
- package/dist/parser/markdoc/pairing.js.map +1 -0
- package/dist/parser/markdoc/schema.d.ts +85 -0
- package/dist/parser/markdoc/schema.d.ts.map +1 -0
- package/dist/parser/markdoc/schema.js +86 -0
- package/dist/parser/markdoc/schema.js.map +1 -0
- package/dist/parser/markdoc/span.d.ts +64 -0
- package/dist/parser/markdoc/span.d.ts.map +1 -0
- package/dist/parser/markdoc/span.js +729 -0
- package/dist/parser/markdoc/span.js.map +1 -0
- package/dist/parser/markdoc/structure.d.ts +28 -0
- package/dist/parser/markdoc/structure.d.ts.map +1 -0
- package/dist/parser/markdoc/structure.js +153 -0
- package/dist/parser/markdoc/structure.js.map +1 -0
- package/dist/parser/markdoc/syntax.d.ts +44 -0
- package/dist/parser/markdoc/syntax.d.ts.map +1 -0
- package/dist/parser/markdoc/syntax.js +317 -0
- package/dist/parser/markdoc/syntax.js.map +1 -0
- package/dist/parser/types.d.ts +18 -0
- package/dist/parser/types.d.ts.map +1 -0
- package/dist/parser/types.js.map +1 -0
- package/dist/reporter/fixes.d.ts.map +1 -1
- package/dist/reporter/fixes.js +22 -1
- package/dist/reporter/fixes.js.map +1 -1
- package/dist/reporter/statistics.d.ts +1 -8
- package/dist/reporter/statistics.d.ts.map +1 -1
- package/dist/reporter/statistics.js.map +1 -1
- package/dist/rules/registry.d.ts +15 -0
- package/dist/rules/registry.d.ts.map +1 -0
- package/dist/rules/registry.js +81 -0
- package/dist/rules/registry.js.map +1 -0
- package/dist/rules/scope/capitalization.d.ts +3 -0
- package/dist/rules/scope/capitalization.d.ts.map +1 -0
- package/dist/rules/scope/capitalization.js +161 -0
- package/dist/rules/scope/capitalization.js.map +1 -0
- package/dist/rules/scope/conditional.d.ts +3 -0
- package/dist/rules/scope/conditional.d.ts.map +1 -0
- package/dist/rules/scope/conditional.js +112 -0
- package/dist/rules/scope/conditional.js.map +1 -0
- package/dist/rules/scope/consistency.d.ts +3 -0
- package/dist/rules/scope/consistency.d.ts.map +1 -0
- package/dist/rules/scope/consistency.js +178 -0
- package/dist/rules/scope/consistency.js.map +1 -0
- package/dist/rules/scope/length.d.ts +3 -0
- package/dist/rules/scope/length.d.ts.map +1 -0
- package/dist/rules/scope/length.js +69 -0
- package/dist/rules/scope/length.js.map +1 -0
- package/dist/rules/scope/max-image-size.d.ts +3 -0
- package/dist/rules/scope/max-image-size.d.ts.map +1 -0
- package/dist/rules/scope/max-image-size.js +65 -0
- package/dist/rules/scope/max-image-size.js.map +1 -0
- package/dist/rules/scope/metric.d.ts +17 -0
- package/dist/rules/scope/metric.d.ts.map +1 -0
- package/dist/rules/scope/metric.js +216 -0
- package/dist/rules/scope/metric.js.map +1 -0
- package/dist/rules/scope/occurrence.d.ts +3 -0
- package/dist/rules/scope/occurrence.d.ts.map +1 -0
- package/dist/rules/scope/occurrence.js +48 -0
- package/dist/rules/scope/occurrence.js.map +1 -0
- package/dist/rules/scope/pattern.d.ts +3 -0
- package/dist/rules/scope/pattern.d.ts.map +1 -0
- package/dist/rules/scope/pattern.js +75 -0
- package/dist/rules/scope/pattern.js.map +1 -0
- package/dist/rules/scope/repetition.d.ts +3 -0
- package/dist/rules/scope/repetition.d.ts.map +1 -0
- package/dist/rules/scope/repetition.js +139 -0
- package/dist/rules/scope/repetition.js.map +1 -0
- package/dist/rules/scope/semantic-line-breaks.d.ts +3 -0
- package/dist/rules/scope/semantic-line-breaks.d.ts.map +1 -0
- package/dist/rules/scope/semantic-line-breaks.js +213 -0
- package/dist/rules/scope/semantic-line-breaks.js.map +1 -0
- package/dist/rules/scope/spelling.d.ts +27 -0
- package/dist/rules/scope/spelling.d.ts.map +1 -0
- package/dist/rules/scope/spelling.js +227 -0
- package/dist/rules/scope/spelling.js.map +1 -0
- package/dist/rules/scope/swap.d.ts +3 -0
- package/dist/rules/scope/swap.d.ts.map +1 -0
- package/dist/rules/scope/swap.js +149 -0
- package/dist/rules/scope/swap.js.map +1 -0
- package/dist/rules/scope/title-case.d.ts +42 -0
- package/dist/rules/scope/title-case.d.ts.map +1 -0
- package/dist/rules/scope/title-case.js +264 -0
- package/dist/rules/scope/title-case.js.map +1 -0
- package/dist/rules/token/blanks-around-fences.d.ts +3 -0
- package/dist/rules/token/blanks-around-fences.d.ts.map +1 -0
- package/dist/rules/token/blanks-around-fences.js +44 -0
- package/dist/rules/token/blanks-around-fences.js.map +1 -0
- package/dist/rules/token/blanks-around-headings.d.ts +3 -0
- package/dist/rules/token/blanks-around-headings.d.ts.map +1 -0
- package/dist/rules/token/blanks-around-headings.js +108 -0
- package/dist/rules/token/blanks-around-headings.js.map +1 -0
- package/dist/rules/token/blanks-around-lists.d.ts +3 -0
- package/dist/rules/token/blanks-around-lists.d.ts.map +1 -0
- package/dist/rules/token/blanks-around-lists.js +56 -0
- package/dist/rules/token/blanks-around-lists.js.map +1 -0
- package/dist/rules/token/blanks-around-tables.d.ts +3 -0
- package/dist/rules/token/blanks-around-tables.d.ts.map +1 -0
- package/dist/rules/token/blanks-around-tables.js +42 -0
- package/dist/rules/token/blanks-around-tables.js.map +1 -0
- package/dist/rules/token/code-block-style.d.ts +3 -0
- package/dist/rules/token/code-block-style.d.ts.map +1 -0
- package/dist/rules/token/code-block-style.js +30 -0
- package/dist/rules/token/code-block-style.js.map +1 -0
- package/dist/rules/token/code-fence-style.d.ts +3 -0
- package/dist/rules/token/code-fence-style.d.ts.map +1 -0
- package/dist/rules/token/code-fence-style.js +35 -0
- package/dist/rules/token/code-fence-style.js.map +1 -0
- package/dist/rules/token/commands-show-output.d.ts +3 -0
- package/dist/rules/token/commands-show-output.d.ts.map +1 -0
- package/dist/rules/token/commands-show-output.js +38 -0
- package/dist/rules/token/commands-show-output.js.map +1 -0
- package/dist/rules/token/descriptive-link-text.d.ts +3 -0
- package/dist/rules/token/descriptive-link-text.d.ts.map +1 -0
- package/dist/rules/token/descriptive-link-text.js +53 -0
- package/dist/rules/token/descriptive-link-text.js.map +1 -0
- package/dist/rules/token/emphasis-style.d.ts +3 -0
- package/dist/rules/token/emphasis-style.d.ts.map +1 -0
- package/dist/rules/token/emphasis-style.js +51 -0
- package/dist/rules/token/emphasis-style.js.map +1 -0
- package/dist/rules/token/fenced-code-language.d.ts +3 -0
- package/dist/rules/token/fenced-code-language.d.ts.map +1 -0
- package/dist/rules/token/fenced-code-language.js +35 -0
- package/dist/rules/token/fenced-code-language.js.map +1 -0
- package/dist/rules/token/first-line-h1.d.ts +3 -0
- package/dist/rules/token/first-line-h1.d.ts.map +1 -0
- package/dist/rules/token/first-line-h1.js +107 -0
- package/dist/rules/token/first-line-h1.js.map +1 -0
- package/dist/rules/token/heading-increment.d.ts +3 -0
- package/dist/rules/token/heading-increment.d.ts.map +1 -0
- package/dist/rules/token/heading-increment.js +27 -0
- package/dist/rules/token/heading-increment.js.map +1 -0
- package/dist/rules/token/heading-start-left.d.ts +3 -0
- package/dist/rules/token/heading-start-left.d.ts.map +1 -0
- package/dist/rules/token/heading-start-left.js +31 -0
- package/dist/rules/token/heading-start-left.js.map +1 -0
- package/dist/rules/token/heading-style.d.ts +3 -0
- package/dist/rules/token/heading-style.d.ts.map +1 -0
- package/dist/rules/token/heading-style.js +41 -0
- package/dist/rules/token/heading-style.js.map +1 -0
- package/dist/rules/token/helpers.d.ts +313 -0
- package/dist/rules/token/helpers.d.ts.map +1 -0
- package/dist/rules/token/helpers.js +746 -0
- package/dist/rules/token/helpers.js.map +1 -0
- package/dist/rules/token/hr-style.d.ts +3 -0
- package/dist/rules/token/hr-style.d.ts.map +1 -0
- package/dist/rules/token/hr-style.js +28 -0
- package/dist/rules/token/hr-style.js.map +1 -0
- package/dist/rules/token/index.d.ts +75 -0
- package/dist/rules/token/index.d.ts.map +1 -0
- package/dist/rules/token/index.js +226 -0
- package/dist/rules/token/index.js.map +1 -0
- package/dist/rules/token/line-length.d.ts +3 -0
- package/dist/rules/token/line-length.d.ts.map +1 -0
- package/dist/rules/token/line-length.js +120 -0
- package/dist/rules/token/line-length.js.map +1 -0
- package/dist/rules/token/link-fragments.d.ts +3 -0
- package/dist/rules/token/link-fragments.d.ts.map +1 -0
- package/dist/rules/token/link-fragments.js +145 -0
- package/dist/rules/token/link-fragments.js.map +1 -0
- package/dist/rules/token/link-image-reference-definitions.d.ts +3 -0
- package/dist/rules/token/link-image-reference-definitions.d.ts.map +1 -0
- package/dist/rules/token/link-image-reference-definitions.js +50 -0
- package/dist/rules/token/link-image-reference-definitions.js.map +1 -0
- package/dist/rules/token/link-image-style.d.ts +3 -0
- package/dist/rules/token/link-image-style.d.ts.map +1 -0
- package/dist/rules/token/link-image-style.js +131 -0
- package/dist/rules/token/link-image-style.js.map +1 -0
- package/dist/rules/token/list-indent.d.ts +3 -0
- package/dist/rules/token/list-indent.d.ts.map +1 -0
- package/dist/rules/token/list-indent.js +60 -0
- package/dist/rules/token/list-indent.js.map +1 -0
- package/dist/rules/token/list-length.d.ts +3 -0
- package/dist/rules/token/list-length.d.ts.map +1 -0
- package/dist/rules/token/list-length.js +55 -0
- package/dist/rules/token/list-length.js.map +1 -0
- package/dist/rules/token/list-marker-space.d.ts +3 -0
- package/dist/rules/token/list-marker-space.d.ts.map +1 -0
- package/dist/rules/token/list-marker-space.js +52 -0
- package/dist/rules/token/list-marker-space.js.map +1 -0
- package/dist/rules/token/markdoc-attributes.d.ts +3 -0
- package/dist/rules/token/markdoc-attributes.d.ts.map +1 -0
- package/dist/rules/token/markdoc-attributes.js +269 -0
- package/dist/rules/token/markdoc-attributes.js.map +1 -0
- package/dist/rules/token/markdoc-pairing.d.ts +3 -0
- package/dist/rules/token/markdoc-pairing.d.ts.map +1 -0
- package/dist/rules/token/markdoc-pairing.js +73 -0
- package/dist/rules/token/markdoc-pairing.js.map +1 -0
- package/dist/rules/token/markdoc-syntax.d.ts +3 -0
- package/dist/rules/token/markdoc-syntax.d.ts.map +1 -0
- package/dist/rules/token/markdoc-syntax.js +119 -0
- package/dist/rules/token/markdoc-syntax.js.map +1 -0
- package/dist/rules/token/markdoc-unknown-tag.d.ts +3 -0
- package/dist/rules/token/markdoc-unknown-tag.d.ts.map +1 -0
- package/dist/rules/token/markdoc-unknown-tag.js +64 -0
- package/dist/rules/token/markdoc-unknown-tag.js.map +1 -0
- package/dist/rules/token/messages.d.ts +4 -0
- package/dist/rules/token/messages.d.ts.map +1 -0
- package/dist/rules/token/messages.js +20 -0
- package/dist/rules/token/messages.js.map +1 -0
- package/dist/rules/token/no-alt-text.d.ts +3 -0
- package/dist/rules/token/no-alt-text.d.ts.map +1 -0
- package/dist/rules/token/no-alt-text.js +47 -0
- package/dist/rules/token/no-alt-text.js.map +1 -0
- package/dist/rules/token/no-bare-urls.d.ts +3 -0
- package/dist/rules/token/no-bare-urls.d.ts.map +1 -0
- package/dist/rules/token/no-bare-urls.js +88 -0
- package/dist/rules/token/no-bare-urls.js.map +1 -0
- package/dist/rules/token/no-blanks-blockquote.d.ts +3 -0
- package/dist/rules/token/no-blanks-blockquote.d.ts.map +1 -0
- package/dist/rules/token/no-blanks-blockquote.js +39 -0
- package/dist/rules/token/no-blanks-blockquote.js.map +1 -0
- package/dist/rules/token/no-duplicate-heading.d.ts +3 -0
- package/dist/rules/token/no-duplicate-heading.d.ts.map +1 -0
- package/dist/rules/token/no-duplicate-heading.js +101 -0
- package/dist/rules/token/no-duplicate-heading.js.map +1 -0
- package/dist/rules/token/no-duplicate-link-destinations.d.ts +3 -0
- package/dist/rules/token/no-duplicate-link-destinations.d.ts.map +1 -0
- package/dist/rules/token/no-duplicate-link-destinations.js +65 -0
- package/dist/rules/token/no-duplicate-link-destinations.js.map +1 -0
- package/dist/rules/token/no-emphasis-as-heading.d.ts +3 -0
- package/dist/rules/token/no-emphasis-as-heading.d.ts.map +1 -0
- package/dist/rules/token/no-emphasis-as-heading.js +44 -0
- package/dist/rules/token/no-emphasis-as-heading.js.map +1 -0
- package/dist/rules/token/no-empty-headings.d.ts +3 -0
- package/dist/rules/token/no-empty-headings.d.ts.map +1 -0
- package/dist/rules/token/no-empty-headings.js +28 -0
- package/dist/rules/token/no-empty-headings.js.map +1 -0
- package/dist/rules/token/no-empty-links.d.ts +3 -0
- package/dist/rules/token/no-empty-links.d.ts.map +1 -0
- package/dist/rules/token/no-empty-links.js +67 -0
- package/dist/rules/token/no-empty-links.js.map +1 -0
- package/dist/rules/token/no-hard-tabs.d.ts +3 -0
- package/dist/rules/token/no-hard-tabs.d.ts.map +1 -0
- package/dist/rules/token/no-hard-tabs.js +76 -0
- package/dist/rules/token/no-hard-tabs.js.map +1 -0
- package/dist/rules/token/no-inline-html.d.ts +3 -0
- package/dist/rules/token/no-inline-html.d.ts.map +1 -0
- package/dist/rules/token/no-inline-html.js +45 -0
- package/dist/rules/token/no-inline-html.js.map +1 -0
- package/dist/rules/token/no-missing-space-atx.d.ts +3 -0
- package/dist/rules/token/no-missing-space-atx.d.ts.map +1 -0
- package/dist/rules/token/no-missing-space-atx.js +36 -0
- package/dist/rules/token/no-missing-space-atx.js.map +1 -0
- package/dist/rules/token/no-missing-space-closed-atx.d.ts +3 -0
- package/dist/rules/token/no-missing-space-closed-atx.d.ts.map +1 -0
- package/dist/rules/token/no-missing-space-closed-atx.js +45 -0
- package/dist/rules/token/no-missing-space-closed-atx.js.map +1 -0
- package/dist/rules/token/no-multiple-blanks.d.ts +3 -0
- package/dist/rules/token/no-multiple-blanks.d.ts.map +1 -0
- package/dist/rules/token/no-multiple-blanks.js +35 -0
- package/dist/rules/token/no-multiple-blanks.js.map +1 -0
- package/dist/rules/token/no-multiple-space-atx.d.ts +13 -0
- package/dist/rules/token/no-multiple-space-atx.d.ts.map +1 -0
- package/dist/rules/token/no-multiple-space-atx.js +50 -0
- package/dist/rules/token/no-multiple-space-atx.js.map +1 -0
- package/dist/rules/token/no-multiple-space-blockquote.d.ts +3 -0
- package/dist/rules/token/no-multiple-space-blockquote.d.ts.map +1 -0
- package/dist/rules/token/no-multiple-space-blockquote.js +43 -0
- package/dist/rules/token/no-multiple-space-blockquote.js.map +1 -0
- package/dist/rules/token/no-multiple-space-closed-atx.d.ts +3 -0
- package/dist/rules/token/no-multiple-space-closed-atx.d.ts.map +1 -0
- package/dist/rules/token/no-multiple-space-closed-atx.js +19 -0
- package/dist/rules/token/no-multiple-space-closed-atx.js.map +1 -0
- package/dist/rules/token/no-reversed-links.d.ts +3 -0
- package/dist/rules/token/no-reversed-links.d.ts.map +1 -0
- package/dist/rules/token/no-reversed-links.js +52 -0
- package/dist/rules/token/no-reversed-links.js.map +1 -0
- package/dist/rules/token/no-space-in-code.d.ts +3 -0
- package/dist/rules/token/no-space-in-code.d.ts.map +1 -0
- package/dist/rules/token/no-space-in-code.js +75 -0
- package/dist/rules/token/no-space-in-code.js.map +1 -0
- package/dist/rules/token/no-space-in-emphasis.d.ts +3 -0
- package/dist/rules/token/no-space-in-emphasis.d.ts.map +1 -0
- package/dist/rules/token/no-space-in-emphasis.js +79 -0
- package/dist/rules/token/no-space-in-emphasis.js.map +1 -0
- package/dist/rules/token/no-space-in-links.d.ts +3 -0
- package/dist/rules/token/no-space-in-links.d.ts.map +1 -0
- package/dist/rules/token/no-space-in-links.js +48 -0
- package/dist/rules/token/no-space-in-links.js.map +1 -0
- package/dist/rules/token/no-trailing-punctuation.d.ts +3 -0
- package/dist/rules/token/no-trailing-punctuation.d.ts.map +1 -0
- package/dist/rules/token/no-trailing-punctuation.js +38 -0
- package/dist/rules/token/no-trailing-punctuation.js.map +1 -0
- package/dist/rules/token/no-trailing-spaces.d.ts +3 -0
- package/dist/rules/token/no-trailing-spaces.d.ts.map +1 -0
- package/dist/rules/token/no-trailing-spaces.js +89 -0
- package/dist/rules/token/no-trailing-spaces.js.map +1 -0
- package/dist/rules/token/ol-prefix.d.ts +3 -0
- package/dist/rules/token/ol-prefix.d.ts.map +1 -0
- package/dist/rules/token/ol-prefix.js +70 -0
- package/dist/rules/token/ol-prefix.js.map +1 -0
- package/dist/rules/token/proper-names.d.ts +3 -0
- package/dist/rules/token/proper-names.d.ts.map +1 -0
- package/dist/rules/token/proper-names.js +93 -0
- package/dist/rules/token/proper-names.js.map +1 -0
- package/dist/rules/token/reference-links-images.d.ts +3 -0
- package/dist/rules/token/reference-links-images.d.ts.map +1 -0
- package/dist/rules/token/reference-links-images.js +36 -0
- package/dist/rules/token/reference-links-images.js.map +1 -0
- package/dist/rules/token/required-headings.d.ts +3 -0
- package/dist/rules/token/required-headings.d.ts.map +1 -0
- package/dist/rules/token/required-headings.js +83 -0
- package/dist/rules/token/required-headings.js.map +1 -0
- package/dist/rules/token/single-h1.d.ts +3 -0
- package/dist/rules/token/single-h1.d.ts.map +1 -0
- package/dist/rules/token/single-h1.js +56 -0
- package/dist/rules/token/single-h1.js.map +1 -0
- package/dist/rules/token/single-trailing-newline.d.ts +3 -0
- package/dist/rules/token/single-trailing-newline.d.ts.map +1 -0
- package/dist/rules/token/single-trailing-newline.js +25 -0
- package/dist/rules/token/single-trailing-newline.js.map +1 -0
- package/dist/rules/token/strong-style.d.ts +3 -0
- package/dist/rules/token/strong-style.d.ts.map +1 -0
- package/dist/rules/token/strong-style.js +51 -0
- package/dist/rules/token/strong-style.js.map +1 -0
- package/dist/rules/token/table-column-count.d.ts +3 -0
- package/dist/rules/token/table-column-count.d.ts.map +1 -0
- package/dist/rules/token/table-column-count.js +44 -0
- package/dist/rules/token/table-column-count.js.map +1 -0
- package/dist/rules/token/table-column-style.d.ts +3 -0
- package/dist/rules/token/table-column-style.d.ts.map +1 -0
- package/dist/rules/token/table-column-style.js +179 -0
- package/dist/rules/token/table-column-style.js.map +1 -0
- package/dist/rules/token/table-pipe-style.d.ts +3 -0
- package/dist/rules/token/table-pipe-style.d.ts.map +1 -0
- package/dist/rules/token/table-pipe-style.js +54 -0
- package/dist/rules/token/table-pipe-style.js.map +1 -0
- package/dist/rules/token/ul-indent.d.ts +3 -0
- package/dist/rules/token/ul-indent.d.ts.map +1 -0
- package/dist/rules/token/ul-indent.js +72 -0
- package/dist/rules/token/ul-indent.js.map +1 -0
- package/dist/rules/token/ul-style.d.ts +3 -0
- package/dist/rules/token/ul-style.d.ts.map +1 -0
- package/dist/rules/token/ul-style.js +80 -0
- package/dist/rules/token/ul-style.js.map +1 -0
- package/dist/rules/types.d.ts +81 -0
- package/dist/rules/types.d.ts.map +1 -0
- package/dist/rules/types.js +2 -0
- package/dist/rules/types.js.map +1 -0
- package/dist/rules/utils.d.ts +29 -0
- package/dist/rules/utils.d.ts.map +1 -0
- package/dist/{assertions → rules}/utils.js +27 -0
- package/dist/rules/utils.js.map +1 -0
- package/dist/scopes/extractor.d.ts +7 -0
- package/dist/scopes/extractor.d.ts.map +1 -0
- package/dist/scopes/extractor.js +475 -0
- package/dist/scopes/extractor.js.map +1 -0
- package/dist/scopes/selector.d.ts +51 -0
- package/dist/scopes/selector.d.ts.map +1 -0
- package/dist/scopes/selector.js +121 -0
- package/dist/scopes/selector.js.map +1 -0
- package/dist/scopes/sentences.d.ts +7 -0
- package/dist/scopes/sentences.d.ts.map +1 -0
- package/dist/scopes/sentences.js +115 -0
- package/dist/scopes/sentences.js.map +1 -0
- package/dist/scopes/types.d.ts +44 -0
- package/dist/scopes/types.d.ts.map +1 -0
- package/dist/scopes/types.js +2 -0
- package/dist/scopes/types.js.map +1 -0
- package/dist/scopes/vocabulary.d.ts +16 -0
- package/dist/scopes/vocabulary.d.ts.map +1 -0
- package/dist/scopes/vocabulary.js +70 -0
- package/dist/scopes/vocabulary.js.map +1 -0
- package/dist/types/assertions.d.ts +95 -32
- package/dist/types/assertions.d.ts.map +1 -1
- package/dist/types/problems.d.ts +4 -5
- package/dist/types/problems.d.ts.map +1 -1
- package/dist/types/rules.d.ts +4 -6
- package/dist/types/rules.d.ts.map +1 -1
- package/examples/appendices/google.appendix.yaml +91 -0
- package/examples/appendices/inclusive-language.appendix.yaml +61 -0
- package/examples/appendices/microsoft.appendix.yaml +99 -0
- package/examples/appendices/plain-language.appendix.yaml +88 -0
- package/examples/google.yaml +1525 -0
- package/examples/inclusive-language.yaml +304 -0
- package/examples/microsoft.yaml +1542 -0
- package/examples/plain-language.yaml +325 -0
- package/package.json +49 -16
- package/presets/google/PROVENANCE.md +1022 -0
- package/presets/google/sources.json +192 -0
- package/presets/inclusive-language/PROVENANCE.md +174 -0
- package/presets/inclusive-language/sources.json +107 -0
- package/presets/microsoft/PROVENANCE.md +1555 -0
- package/presets/microsoft/sources.json +494 -0
- package/presets/plain-language/PROVENANCE.md +364 -0
- package/presets/plain-language/sources.json +108 -0
- package/dist/assertions/bullet-style.d.ts +0 -3
- package/dist/assertions/bullet-style.d.ts.map +0 -1
- package/dist/assertions/bullet-style.js +0 -60
- package/dist/assertions/bullet-style.js.map +0 -1
- package/dist/assertions/index.d.ts +0 -21
- package/dist/assertions/index.d.ts.map +0 -1
- package/dist/assertions/index.js +0 -30
- package/dist/assertions/index.js.map +0 -1
- package/dist/assertions/max-image-size.d.ts +0 -3
- package/dist/assertions/max-image-size.d.ts.map +0 -1
- package/dist/assertions/max-image-size.js +0 -73
- package/dist/assertions/max-image-size.js.map +0 -1
- package/dist/assertions/max-line-length.d.ts +0 -3
- package/dist/assertions/max-line-length.d.ts.map +0 -1
- package/dist/assertions/max-line-length.js +0 -68
- package/dist/assertions/max-line-length.js.map +0 -1
- package/dist/assertions/no-broken-fragment-links.d.ts +0 -3
- package/dist/assertions/no-broken-fragment-links.d.ts.map +0 -1
- package/dist/assertions/no-broken-fragment-links.js +0 -79
- package/dist/assertions/no-broken-fragment-links.js.map +0 -1
- package/dist/assertions/no-duplicate-headings.d.ts +0 -3
- package/dist/assertions/no-duplicate-headings.d.ts.map +0 -1
- package/dist/assertions/no-duplicate-headings.js +0 -66
- package/dist/assertions/no-duplicate-headings.js.map +0 -1
- package/dist/assertions/no-hard-tabs.d.ts +0 -3
- package/dist/assertions/no-hard-tabs.d.ts.map +0 -1
- package/dist/assertions/no-hard-tabs.js +0 -63
- package/dist/assertions/no-hard-tabs.js.map +0 -1
- package/dist/assertions/no-trailing-spaces.d.ts +0 -3
- package/dist/assertions/no-trailing-spaces.d.ts.map +0 -1
- package/dist/assertions/no-trailing-spaces.js +0 -72
- package/dist/assertions/no-trailing-spaces.js.map +0 -1
- package/dist/assertions/pattern.d.ts +0 -3
- package/dist/assertions/pattern.d.ts.map +0 -1
- package/dist/assertions/pattern.js +0 -39
- package/dist/assertions/pattern.js.map +0 -1
- package/dist/assertions/semantic-line-breaks.d.ts +0 -3
- package/dist/assertions/semantic-line-breaks.d.ts.map +0 -1
- package/dist/assertions/semantic-line-breaks.js +0 -152
- package/dist/assertions/semantic-line-breaks.js.map +0 -1
- package/dist/assertions/swap.d.ts +0 -3
- package/dist/assertions/swap.d.ts.map +0 -1
- package/dist/assertions/swap.js +0 -39
- package/dist/assertions/swap.js.map +0 -1
- package/dist/assertions/utils.d.ts +0 -8
- package/dist/assertions/utils.d.ts.map +0 -1
- package/dist/assertions/utils.js.map +0 -1
- package/dist/core/scope-parser.d.ts +0 -26
- package/dist/core/scope-parser.d.ts.map +0 -1
- package/dist/core/scope-parser.js +0 -110
- package/dist/core/scope-parser.js.map +0 -1
- package/dist/files.d.ts +0 -2
- package/dist/files.d.ts.map +0 -1
- package/dist/files.js +0 -39
- package/dist/files.js.map +0 -1
- package/dist/load-config.d.ts +0 -25
- package/dist/load-config.d.ts.map +0 -1
- package/dist/load-config.js +0 -104
- package/dist/load-config.js.map +0 -1
- package/dist/load.d.ts +0 -25
- package/dist/load.d.ts.map +0 -1
- package/dist/load.js +0 -112
- package/dist/load.js.map +0 -1
- package/dist/scope.d.ts +0 -26
- package/dist/scope.d.ts.map +0 -1
- package/dist/scope.js +0 -110
- package/dist/scope.js.map +0 -1
- package/dist/types.d.ts +0 -109
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/validate.d.ts +0 -31
- package/dist/validate.d.ts.map +0 -1
- package/dist/validate.js +0 -154
- package/dist/validate.js.map +0 -1
- /package/dist/{types.js → parser/types.js} +0 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { filterByTypes } from '../parser/index.js';
|
|
2
|
+
import { newLineRe } from './line-endings.js';
|
|
3
|
+
/**
|
|
4
|
+
* The character `scopes/extractor.ts` blanks a markdoc tag's span with when
|
|
5
|
+
* building prose content. A SPACE, deliberately, and not
|
|
6
|
+
* `core/inline-code.ts`'s `\0` sentinel:
|
|
7
|
+
*
|
|
8
|
+
* - Recheck's prose model must read a tag's span as a GAP, and the word
|
|
9
|
+
* tokenizers, `String.prototype.trim`, and the sentence splitter all agree on
|
|
10
|
+
* whitespace, so a space makes every one of them treat the tag as absent.
|
|
11
|
+
* - A user-supplied regex must NOT read it as a gap, and no sentinel can give
|
|
12
|
+
* that: `\0` stops `\s+` from crossing a tag, but a negated class (`[^,]+`)
|
|
13
|
+
* walks straight through it either way. Regex rules therefore have to reject
|
|
14
|
+
* a match by RANGE, after the fact, against the unmodified text — see
|
|
15
|
+
* `ScopedSegment.maskedRanges` and `nonProseRanges` in `rules/utils.ts`.
|
|
16
|
+
*/
|
|
17
|
+
export const MARKDOC_TAG_MASK_CHAR = ' ';
|
|
18
|
+
/**
|
|
19
|
+
* Every markdoc tag's source span in `content`, split per line (see
|
|
20
|
+
* `MarkdocTagSpan`). Empty for a flag-off parse, since no `markdocTag` tokens
|
|
21
|
+
* exist in the tree at all, so `--fix` behaves byte-identically.
|
|
22
|
+
*
|
|
23
|
+
* Uses `filterByTypes` rather than a raw `tree.flat.filter` so htmlFlow-reparsed
|
|
24
|
+
* tokens are excluded on the same terms as for every other consumer: they
|
|
25
|
+
* duplicate positions already covered by their `htmlFlow` parent, and treating a
|
|
26
|
+
* duplicate as a protected span would block fixes on a line with no real tag.
|
|
27
|
+
*/
|
|
28
|
+
export function markdocTagSpans(tree, content) {
|
|
29
|
+
const tags = filterByTypes(tree, ['markdocTag']);
|
|
30
|
+
if (tags.length === 0)
|
|
31
|
+
return [];
|
|
32
|
+
const sourceLines = content.split(newLineRe);
|
|
33
|
+
const spans = [];
|
|
34
|
+
for (const tag of tags) {
|
|
35
|
+
for (let line = tag.startLine; line <= tag.endLine; line++) {
|
|
36
|
+
const sourceLine = sourceLines[line - 1] ?? '';
|
|
37
|
+
const startColumn = line === tag.startLine ? tag.startColumn : 1;
|
|
38
|
+
const endColumn = line === tag.endLine ? tag.endColumn : sourceLine.length + 1;
|
|
39
|
+
if (endColumn <= startColumn)
|
|
40
|
+
continue;
|
|
41
|
+
spans.push({
|
|
42
|
+
line,
|
|
43
|
+
startColumn,
|
|
44
|
+
endColumn,
|
|
45
|
+
text: sourceLine.slice(startColumn - 1, endColumn - 1),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return spans;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The choke point that keeps `--fix` from rewriting a markdoc tag's bytes.
|
|
53
|
+
*
|
|
54
|
+
* Prose scope content is masked (see `MARKDOC_TAG_MASK_CHAR`), which breaks the
|
|
55
|
+
* precondition every whole-span rewriter relied on: `ScopedSegment.content` used
|
|
56
|
+
* to be a verbatim source slice, so a rule replacing its whole span writes the
|
|
57
|
+
* mask back over the real source and DELETES the tag. Rather than teach each such
|
|
58
|
+
* rule to splice its own tags back, every fix from every rule passes through here
|
|
59
|
+
* once, on its way to `applyFixesToContent`:
|
|
60
|
+
*
|
|
61
|
+
* - No tag on the fix's line, or no overlap with one: passes through untouched.
|
|
62
|
+
* This is the only path a flag-off run can take, so flag-off byte-identity is
|
|
63
|
+
* structural, not a special case.
|
|
64
|
+
* - Overlap where the fix replaces its span with the SAME number of characters:
|
|
65
|
+
* each overlapped tag's original bytes are spliced back at their own offsets.
|
|
66
|
+
* Length preservation is what makes those offsets meaningful, and it is the
|
|
67
|
+
* same contract `restoreInlineCode` (core/inline-code.ts) already relies on.
|
|
68
|
+
* - Anything else — a length-changing replacement, a fix that cuts a tag in half,
|
|
69
|
+
* a whole-line rewrite (`deleteCount: -1`) on a line with a tag — is DROPPED
|
|
70
|
+
* and reported as skipped, since there is no position to splice into without
|
|
71
|
+
* inventing one.
|
|
72
|
+
*
|
|
73
|
+
* A fix that turns out to change nothing once its tags are restored is dropped
|
|
74
|
+
* too: it only matched mask characters, and letting it through would report a
|
|
75
|
+
* byte-identical file as fixed and make `runRulesUntilStable` re-propose it on
|
|
76
|
+
* every pass.
|
|
77
|
+
*/
|
|
78
|
+
export function protectMarkdocTags(fixes, spans, content) {
|
|
79
|
+
if (spans.length === 0 || fixes.length === 0)
|
|
80
|
+
return { fixes, dropped: [] };
|
|
81
|
+
const byLine = new Map();
|
|
82
|
+
for (const span of spans) {
|
|
83
|
+
const existing = byLine.get(span.line);
|
|
84
|
+
if (existing)
|
|
85
|
+
existing.push(span);
|
|
86
|
+
else
|
|
87
|
+
byLine.set(span.line, [span]);
|
|
88
|
+
}
|
|
89
|
+
const sourceLines = content.split(newLineRe);
|
|
90
|
+
const safe = [];
|
|
91
|
+
const dropped = [];
|
|
92
|
+
for (const fix of fixes) {
|
|
93
|
+
const lineSpans = byLine.get(fix.lineNumber);
|
|
94
|
+
if (lineSpans === undefined) {
|
|
95
|
+
safe.push(fix);
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const deleteCount = fix.deleteCount ?? 0;
|
|
99
|
+
if (deleteCount === -1) {
|
|
100
|
+
dropped.push(fix);
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
const editColumn = fix.editColumn ?? 1;
|
|
104
|
+
const editEnd = editColumn + deleteCount;
|
|
105
|
+
const overlapped = lineSpans.filter((span) => editColumn < span.endColumn && span.startColumn < editEnd);
|
|
106
|
+
if (overlapped.length === 0) {
|
|
107
|
+
safe.push(fix);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
const insertText = fix.insertText ?? '';
|
|
111
|
+
const splittable = insertText.length === deleteCount &&
|
|
112
|
+
overlapped.every((span) => span.startColumn >= editColumn && span.endColumn <= editEnd);
|
|
113
|
+
if (!splittable) {
|
|
114
|
+
dropped.push(fix);
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
let restored = insertText;
|
|
118
|
+
for (const span of overlapped) {
|
|
119
|
+
const at = span.startColumn - editColumn;
|
|
120
|
+
restored = restored.slice(0, at) + span.text + restored.slice(at + span.text.length);
|
|
121
|
+
}
|
|
122
|
+
const replaced = (sourceLines[fix.lineNumber - 1] ?? '').slice(editColumn - 1, editEnd - 1);
|
|
123
|
+
if (restored === replaced) {
|
|
124
|
+
dropped.push(fix);
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
safe.push({ ...fix, insertText: restored });
|
|
128
|
+
}
|
|
129
|
+
return { fixes: safe, dropped };
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=markdoc-tags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdoc-tags.js","sourceRoot":"","sources":["../../src/core/markdoc-tags.ts"],"names":[],"mappings":"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"}
|
package/dist/core/runner.d.ts
CHANGED
|
@@ -1,4 +1,93 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
1
|
+
import type { NormalizedRule, Problem } from '../types/index.js';
|
|
2
|
+
import type { Fix } from '../types/index.js';
|
|
3
|
+
import type { ScopeRuleContext } from '../rules/types.js';
|
|
4
|
+
import { type MarkdocSchema } from '../parser/markdoc/schema.js';
|
|
5
|
+
export interface RunnerOptions {
|
|
6
|
+
fix?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Cap on the total problems a run may collect, enforced BETWEEN files:
|
|
9
|
+
* once a file's lint pushes the total to (or past) the cap, that file's
|
|
10
|
+
* overflow is truncated and NO further file is linted at all — so a
|
|
11
|
+
* pathological input set can't ballon memory past cap + one file's worth
|
|
12
|
+
* of problems. Runs that hit the cap report `truncated: true` on their
|
|
13
|
+
* RunResult. Omit for unbounded collection (the default).
|
|
14
|
+
*/
|
|
15
|
+
maxProblems?: number;
|
|
16
|
+
/**
|
|
17
|
+
* FULL set of configured rule names, used only to decide which inline
|
|
18
|
+
* directive names get an "unknown rule" warning (see core/directives.ts).
|
|
19
|
+
* Callers filter `severity: off` rules out of `rules` before runRules, so
|
|
20
|
+
* without this a directive suppressing an off-rule — a deliberate no-op,
|
|
21
|
+
* not a typo — would warn as unknown. Defaults to the names of `rules`
|
|
22
|
+
* (correct for callers that never pre-filter).
|
|
23
|
+
*/
|
|
24
|
+
knownRuleNames?: Set<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Opt-in Markdoc tokenization, passed through to every `parseMarkdown` call
|
|
27
|
+
* this run makes. Defaults to disabled, matching `parseMarkdown`'s own
|
|
28
|
+
* default, which leaves the parse byte-identical.
|
|
29
|
+
*/
|
|
30
|
+
markdoc?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The resolved schema used to derive `ctx.markdoc.pairing`'s self-closing
|
|
33
|
+
* set; only meaningful alongside `markdoc: true`. `null` or omitted means no
|
|
34
|
+
* schema: parsing and pairing still run, every rule reading
|
|
35
|
+
* `ctx.markdoc.schema` sees `null`, and no tag name counts as self-closing,
|
|
36
|
+
* so an unclosed one lands in `pairing.unclosed` rather than
|
|
37
|
+
* `voidMissingSlash`.
|
|
38
|
+
*/
|
|
39
|
+
markdocSchema?: MarkdocSchema | null;
|
|
40
|
+
}
|
|
41
|
+
export interface FileInput {
|
|
42
|
+
path: string;
|
|
43
|
+
content: string;
|
|
44
|
+
metadata?: ScopeRuleContext['fileMetadata'];
|
|
45
|
+
}
|
|
46
|
+
export interface RunResult {
|
|
47
|
+
problems: Problem[];
|
|
48
|
+
fixedFiles: Map<string, string>;
|
|
49
|
+
/**
|
|
50
|
+
* Flat list of the fixes that GENUINELY landed in `fixedFiles`, for
|
|
51
|
+
* reporting. Proposed fixes dropped by the applier's overlap resolution
|
|
52
|
+
* are NOT here — they're in `skippedFixes` (see applyFixesToContent's
|
|
53
|
+
* applied/skipped classification).
|
|
54
|
+
*/
|
|
55
|
+
fixes: Fix[];
|
|
56
|
+
/**
|
|
57
|
+
* Proposed fixes that could not be applied (overlapping edits,
|
|
58
|
+
* out-of-range lines). For runRulesUntilStable this holds only the fixes
|
|
59
|
+
* still pending after the final pass — a fix skipped in one pass but
|
|
60
|
+
* re-proposed and applied in a later pass is (correctly) reported in
|
|
61
|
+
* `fixes` instead.
|
|
62
|
+
*/
|
|
63
|
+
skippedFixes: Fix[];
|
|
64
|
+
/**
|
|
65
|
+
* True when `RunnerOptions.maxProblems` cut the run short: problems were
|
|
66
|
+
* dropped past the cap and/or later files were never linted. Always false
|
|
67
|
+
* for uncapped runs, and for capped runs whose problem count never
|
|
68
|
+
* exceeded the cap with files left over.
|
|
69
|
+
*/
|
|
70
|
+
truncated: boolean;
|
|
71
|
+
}
|
|
72
|
+
export declare function runRules(files: FileInput[], rules: NormalizedRule[], options?: RunnerOptions): Promise<RunResult>;
|
|
73
|
+
/**
|
|
74
|
+
* Runs rules with fix:true repeatedly (lint → apply fixes → re-lint the
|
|
75
|
+
* fixed content) until a pass produces zero fixes, capped at
|
|
76
|
+
* MAX_FIX_PASSES. runRules() itself is single-pass by design (library
|
|
77
|
+
* callers that need convergence should loop, as this helper does). This is
|
|
78
|
+
* what public API's lintFiles() and the CLI's run
|
|
79
|
+
* command use so a single --fix invocation fully converges instead of
|
|
80
|
+
* requiring the user to re-run --fix multiple times.
|
|
81
|
+
*
|
|
82
|
+
* The returned `problems` are from the FIRST pass (matching prior
|
|
83
|
+
* single-pass behavior: --fix reports the issues it found/fixed, not the
|
|
84
|
+
* post-fix state) while `fixedFiles` reflects the final, fully-converged
|
|
85
|
+
* content. `fixes` is the flat list of every fix genuinely applied across
|
|
86
|
+
* all passes; `skippedFixes` holds only the fixes still pending after the
|
|
87
|
+
* final pass. A fix skipped mid-run (overlap) is normally re-proposed
|
|
88
|
+
* against the fixed content and applied by a later pass — it then counts
|
|
89
|
+
* in `fixes`, not `skippedFixes` — so a non-empty `skippedFixes` here
|
|
90
|
+
* means the run hit MAX_FIX_PASSES with conflicting edits unresolved.
|
|
91
|
+
*/
|
|
92
|
+
export declare function runRulesUntilStable(files: FileInput[], rules: NormalizedRule[], options?: Omit<RunnerOptions, 'fix'>): Promise<RunResult>;
|
|
4
93
|
//# sourceMappingURL=runner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/core/runner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/core/runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,KAAK,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAc5E,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEtF,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC;;;;;OAKG;IACH,KAAK,EAAE,GAAG,EAAE,CAAC;IACb;;;;;;OAMG;IACH,YAAY,EAAE,GAAG,EAAE,CAAC;IACpB;;;;;OAKG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AA0ED,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,SAAS,EAAE,EAClB,KAAK,EAAE,cAAc,EAAE,EACvB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,SAAS,CAAC,CAqPpB;AAOD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,SAAS,EAAE,EAClB,KAAK,EAAE,cAAc,EAAE,EACvB,OAAO,GAAE,IAAI,CAAC,aAAa,EAAE,KAAK,CAAM,GACvC,OAAO,CAAC,SAAS,CAAC,CAuCpB"}
|