From 9c8e7156e1aba1b5c0a8e8c0677ea9e83e7c1158 Mon Sep 17 00:00:00 2001 From: David Anson Date: Tue, 27 Aug 2024 20:47:33 -0700 Subject: [PATCH] Create strict JSON Schema for configuration (standalone for ease of use) and corresponding strict TypeScript type (via extends for conciseness) (fixes #1248). --- demo/markdownlint-browser.js | 7 + example/typescript/type-check.ts | 17 + lib/configuration-strict.d.ts | 1185 +++++++++++ lib/configuration.d.ts | 1184 +---------- lib/markdownlint.d.ts | 7 +- lib/markdownlint.js | 7 + schema/ValidatingConfiguration.md | 14 +- schema/build-config-schema.js | 31 +- schema/markdownlint-config-schema-strict.json | 1819 +++++++++++++++++ test/markdownlint-test.js | 6 +- 10 files changed, 3070 insertions(+), 1207 deletions(-) create mode 100644 lib/configuration-strict.d.ts create mode 100644 schema/markdownlint-config-schema-strict.json diff --git a/demo/markdownlint-browser.js b/demo/markdownlint-browser.js index 8b65e3fa5..9acc99b82 100644 --- a/demo/markdownlint-browser.js +++ b/demo/markdownlint-browser.js @@ -3140,6 +3140,13 @@ module.exports = markdownlint; * @typedef {import("./configuration").Configuration} Configuration */ +/** + * Configuration object for linting rules strictly. For the JSON schema, see + * {@link ../schema/markdownlint-config-schema-strict.json}. + * + * @typedef {import("./configuration-strict").ConfigurationStrict} ConfigurationStrict + */ + /** * Rule configuration object. * diff --git a/example/typescript/type-check.ts b/example/typescript/type-check.ts index f9831298a..f99c7f7fc 100644 --- a/example/typescript/type-check.ts +++ b/example/typescript/type-check.ts @@ -164,3 +164,20 @@ markdownlint(options, assertLintResultsCallback); (async () => { assertLintResultsCallback(null, await markdownlint.promises.markdownlint(options)); })(); + +const configuration: markdownlint.Configuration = { + "custom-rule": true, + "no-hard-tabs": false, + "heading-style": { + "style": "consistent" + } +}; +assert(configuration); +const configurationStrict: markdownlint.ConfigurationStrict = { + // "custom-rule": true, + "no-hard-tabs": false, + "heading-style": { + "style": "consistent" + } +}; +assert(configurationStrict); diff --git a/lib/configuration-strict.d.ts b/lib/configuration-strict.d.ts new file mode 100644 index 000000000..1034d4694 --- /dev/null +++ b/lib/configuration-strict.d.ts @@ -0,0 +1,1185 @@ +/* eslint-disable */ +/** + * This file was automatically generated by json-schema-to-typescript. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run json-schema-to-typescript to regenerate this file. + */ + +export interface ConfigurationStrict { + /** + * JSON Schema URI (expected by some editors) + */ + $schema?: string; + /** + * Default state for all rules + */ + default?: boolean; + /** + * Path to configuration file to extend + */ + extends?: string | null; + /** + * MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md001.md + */ + MD001?: boolean; + /** + * MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md001.md + */ + "heading-increment"?: boolean; + /** + * MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md003.md + */ + MD003?: + | boolean + | { + /** + * Heading style + */ + style?: "consistent" | "atx" | "atx_closed" | "setext" | "setext_with_atx" | "setext_with_atx_closed"; + }; + /** + * MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md003.md + */ + "heading-style"?: + | boolean + | { + /** + * Heading style + */ + style?: "consistent" | "atx" | "atx_closed" | "setext" | "setext_with_atx" | "setext_with_atx_closed"; + }; + /** + * MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md004.md + */ + MD004?: + | boolean + | { + /** + * List style + */ + style?: "consistent" | "asterisk" | "plus" | "dash" | "sublist"; + }; + /** + * MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md004.md + */ + "ul-style"?: + | boolean + | { + /** + * List style + */ + style?: "consistent" | "asterisk" | "plus" | "dash" | "sublist"; + }; + /** + * MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md005.md + */ + MD005?: boolean; + /** + * MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md005.md + */ + "list-indent"?: boolean; + /** + * MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md007.md + */ + MD007?: + | boolean + | { + /** + * Spaces for indent + */ + indent?: number; + /** + * Whether to indent the first level of the list + */ + start_indented?: boolean; + /** + * Spaces for first level indent (when start_indented is set) + */ + start_indent?: number; + }; + /** + * MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md007.md + */ + "ul-indent"?: + | boolean + | { + /** + * Spaces for indent + */ + indent?: number; + /** + * Whether to indent the first level of the list + */ + start_indented?: boolean; + /** + * Spaces for first level indent (when start_indented is set) + */ + start_indent?: number; + }; + /** + * MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md009.md + */ + MD009?: + | boolean + | { + /** + * Spaces for line break + */ + br_spaces?: number; + /** + * Allow spaces for empty lines in list items + */ + list_item_empty_lines?: boolean; + /** + * Include unnecessary breaks + */ + strict?: boolean; + }; + /** + * MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md009.md + */ + "no-trailing-spaces"?: + | boolean + | { + /** + * Spaces for line break + */ + br_spaces?: number; + /** + * Allow spaces for empty lines in list items + */ + list_item_empty_lines?: boolean; + /** + * Include unnecessary breaks + */ + strict?: boolean; + }; + /** + * MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md + */ + MD010?: + | boolean + | { + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Fenced code languages to ignore + */ + ignore_code_languages?: string[]; + /** + * Number of spaces for each hard tab + */ + spaces_per_tab?: number; + }; + /** + * MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md + */ + "no-hard-tabs"?: + | boolean + | { + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Fenced code languages to ignore + */ + ignore_code_languages?: string[]; + /** + * Number of spaces for each hard tab + */ + spaces_per_tab?: number; + }; + /** + * MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md011.md + */ + MD011?: boolean; + /** + * MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md011.md + */ + "no-reversed-links"?: boolean; + /** + * MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md012.md + */ + MD012?: + | boolean + | { + /** + * Consecutive blank lines + */ + maximum?: number; + }; + /** + * MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md012.md + */ + "no-multiple-blanks"?: + | boolean + | { + /** + * Consecutive blank lines + */ + maximum?: number; + }; + /** + * MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md013.md + */ + MD013?: + | boolean + | { + /** + * Number of characters + */ + line_length?: number; + /** + * Number of characters for headings + */ + heading_line_length?: number; + /** + * Number of characters for code blocks + */ + code_block_line_length?: number; + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Include tables + */ + tables?: boolean; + /** + * Include headings + */ + headings?: boolean; + /** + * Strict length checking + */ + strict?: boolean; + /** + * Stern length checking + */ + stern?: boolean; + }; + /** + * MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md013.md + */ + "line-length"?: + | boolean + | { + /** + * Number of characters + */ + line_length?: number; + /** + * Number of characters for headings + */ + heading_line_length?: number; + /** + * Number of characters for code blocks + */ + code_block_line_length?: number; + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Include tables + */ + tables?: boolean; + /** + * Include headings + */ + headings?: boolean; + /** + * Strict length checking + */ + strict?: boolean; + /** + * Stern length checking + */ + stern?: boolean; + }; + /** + * MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md014.md + */ + MD014?: boolean; + /** + * MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md014.md + */ + "commands-show-output"?: boolean; + /** + * MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md018.md + */ + MD018?: boolean; + /** + * MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md018.md + */ + "no-missing-space-atx"?: boolean; + /** + * MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md019.md + */ + MD019?: boolean; + /** + * MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md019.md + */ + "no-multiple-space-atx"?: boolean; + /** + * MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md020.md + */ + MD020?: boolean; + /** + * MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md020.md + */ + "no-missing-space-closed-atx"?: boolean; + /** + * MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md021.md + */ + MD021?: boolean; + /** + * MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md021.md + */ + "no-multiple-space-closed-atx"?: boolean; + /** + * MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md022.md + */ + MD022?: + | boolean + | { + /** + * Blank lines above heading + */ + lines_above?: number | number[]; + /** + * Blank lines below heading + */ + lines_below?: number | number[]; + }; + /** + * MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md022.md + */ + "blanks-around-headings"?: + | boolean + | { + /** + * Blank lines above heading + */ + lines_above?: number | number[]; + /** + * Blank lines below heading + */ + lines_below?: number | number[]; + }; + /** + * MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md023.md + */ + MD023?: boolean; + /** + * MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md023.md + */ + "heading-start-left"?: boolean; + /** + * MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md024.md + */ + MD024?: + | boolean + | { + /** + * Only check sibling headings + */ + siblings_only?: boolean; + }; + /** + * MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md024.md + */ + "no-duplicate-heading"?: + | boolean + | { + /** + * Only check sibling headings + */ + siblings_only?: boolean; + }; + /** + * MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md025.md + */ + MD025?: + | boolean + | { + /** + * Heading level + */ + level?: number; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + }; + /** + * MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md025.md + */ + "single-title"?: + | boolean + | { + /** + * Heading level + */ + level?: number; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + }; + /** + * MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md025.md + */ + "single-h1"?: + | boolean + | { + /** + * Heading level + */ + level?: number; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + }; + /** + * MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md026.md + */ + MD026?: + | boolean + | { + /** + * Punctuation characters + */ + punctuation?: string; + }; + /** + * MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md026.md + */ + "no-trailing-punctuation"?: + | boolean + | { + /** + * Punctuation characters + */ + punctuation?: string; + }; + /** + * MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md027.md + */ + MD027?: boolean; + /** + * MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md027.md + */ + "no-multiple-space-blockquote"?: boolean; + /** + * MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md028.md + */ + MD028?: boolean; + /** + * MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md028.md + */ + "no-blanks-blockquote"?: boolean; + /** + * MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md029.md + */ + MD029?: + | boolean + | { + /** + * List style + */ + style?: "one" | "ordered" | "one_or_ordered" | "zero"; + }; + /** + * MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md029.md + */ + "ol-prefix"?: + | boolean + | { + /** + * List style + */ + style?: "one" | "ordered" | "one_or_ordered" | "zero"; + }; + /** + * MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md030.md + */ + MD030?: + | boolean + | { + /** + * Spaces for single-line unordered list items + */ + ul_single?: number; + /** + * Spaces for single-line ordered list items + */ + ol_single?: number; + /** + * Spaces for multi-line unordered list items + */ + ul_multi?: number; + /** + * Spaces for multi-line ordered list items + */ + ol_multi?: number; + }; + /** + * MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md030.md + */ + "list-marker-space"?: + | boolean + | { + /** + * Spaces for single-line unordered list items + */ + ul_single?: number; + /** + * Spaces for single-line ordered list items + */ + ol_single?: number; + /** + * Spaces for multi-line unordered list items + */ + ul_multi?: number; + /** + * Spaces for multi-line ordered list items + */ + ol_multi?: number; + }; + /** + * MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md031.md + */ + MD031?: + | boolean + | { + /** + * Include list items + */ + list_items?: boolean; + }; + /** + * MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md031.md + */ + "blanks-around-fences"?: + | boolean + | { + /** + * Include list items + */ + list_items?: boolean; + }; + /** + * MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md032.md + */ + MD032?: boolean; + /** + * MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md032.md + */ + "blanks-around-lists"?: boolean; + /** + * MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md033.md + */ + MD033?: + | boolean + | { + /** + * Allowed elements + */ + allowed_elements?: string[]; + }; + /** + * MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md033.md + */ + "no-inline-html"?: + | boolean + | { + /** + * Allowed elements + */ + allowed_elements?: string[]; + }; + /** + * MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md034.md + */ + MD034?: boolean; + /** + * MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md034.md + */ + "no-bare-urls"?: boolean; + /** + * MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md035.md + */ + MD035?: + | boolean + | { + /** + * Horizontal rule style + */ + style?: string; + }; + /** + * MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md035.md + */ + "hr-style"?: + | boolean + | { + /** + * Horizontal rule style + */ + style?: string; + }; + /** + * MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md036.md + */ + MD036?: + | boolean + | { + /** + * Punctuation characters + */ + punctuation?: string; + }; + /** + * MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md036.md + */ + "no-emphasis-as-heading"?: + | boolean + | { + /** + * Punctuation characters + */ + punctuation?: string; + }; + /** + * MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md037.md + */ + MD037?: boolean; + /** + * MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md037.md + */ + "no-space-in-emphasis"?: boolean; + /** + * MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md038.md + */ + MD038?: boolean; + /** + * MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md038.md + */ + "no-space-in-code"?: boolean; + /** + * MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md039.md + */ + MD039?: boolean; + /** + * MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md039.md + */ + "no-space-in-links"?: boolean; + /** + * MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md040.md + */ + MD040?: + | boolean + | { + /** + * List of languages + */ + allowed_languages?: string[]; + /** + * Require language only + */ + language_only?: boolean; + }; + /** + * MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md040.md + */ + "fenced-code-language"?: + | boolean + | { + /** + * List of languages + */ + allowed_languages?: string[]; + /** + * Require language only + */ + language_only?: boolean; + }; + /** + * MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md041.md + */ + MD041?: + | boolean + | { + /** + * Heading level + */ + level?: number; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + }; + /** + * MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md041.md + */ + "first-line-heading"?: + | boolean + | { + /** + * Heading level + */ + level?: number; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + }; + /** + * MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md041.md + */ + "first-line-h1"?: + | boolean + | { + /** + * Heading level + */ + level?: number; + /** + * RegExp for matching title in front matter + */ + front_matter_title?: string; + }; + /** + * MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md042.md + */ + MD042?: boolean; + /** + * MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md042.md + */ + "no-empty-links"?: boolean; + /** + * MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md043.md + */ + MD043?: + | boolean + | { + /** + * List of headings + */ + headings?: string[]; + /** + * Match case of headings + */ + match_case?: boolean; + }; + /** + * MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md043.md + */ + "required-headings"?: + | boolean + | { + /** + * List of headings + */ + headings?: string[]; + /** + * Match case of headings + */ + match_case?: boolean; + }; + /** + * MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md044.md + */ + MD044?: + | boolean + | { + /** + * List of proper names + */ + names?: string[]; + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Include HTML elements + */ + html_elements?: boolean; + }; + /** + * MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md044.md + */ + "proper-names"?: + | boolean + | { + /** + * List of proper names + */ + names?: string[]; + /** + * Include code blocks + */ + code_blocks?: boolean; + /** + * Include HTML elements + */ + html_elements?: boolean; + }; + /** + * MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md045.md + */ + MD045?: boolean; + /** + * MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md045.md + */ + "no-alt-text"?: boolean; + /** + * MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md046.md + */ + MD046?: + | boolean + | { + /** + * Block style + */ + style?: "consistent" | "fenced" | "indented"; + }; + /** + * MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md046.md + */ + "code-block-style"?: + | boolean + | { + /** + * Block style + */ + style?: "consistent" | "fenced" | "indented"; + }; + /** + * MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md047.md + */ + MD047?: boolean; + /** + * MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md047.md + */ + "single-trailing-newline"?: boolean; + /** + * MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md048.md + */ + MD048?: + | boolean + | { + /** + * Code fence style + */ + style?: "consistent" | "backtick" | "tilde"; + }; + /** + * MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md048.md + */ + "code-fence-style"?: + | boolean + | { + /** + * Code fence style + */ + style?: "consistent" | "backtick" | "tilde"; + }; + /** + * MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md049.md + */ + MD049?: + | boolean + | { + /** + * Emphasis style + */ + style?: "consistent" | "asterisk" | "underscore"; + }; + /** + * MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md049.md + */ + "emphasis-style"?: + | boolean + | { + /** + * Emphasis style + */ + style?: "consistent" | "asterisk" | "underscore"; + }; + /** + * MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md050.md + */ + MD050?: + | boolean + | { + /** + * Strong style + */ + style?: "consistent" | "asterisk" | "underscore"; + }; + /** + * MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md050.md + */ + "strong-style"?: + | boolean + | { + /** + * Strong style + */ + style?: "consistent" | "asterisk" | "underscore"; + }; + /** + * MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md051.md + */ + MD051?: boolean; + /** + * MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md051.md + */ + "link-fragments"?: boolean; + /** + * MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md052.md + */ + MD052?: + | boolean + | { + /** + * Include shortcut syntax + */ + shortcut_syntax?: boolean; + }; + /** + * MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md052.md + */ + "reference-links-images"?: + | boolean + | { + /** + * Include shortcut syntax + */ + shortcut_syntax?: boolean; + }; + /** + * MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md053.md + */ + MD053?: + | boolean + | { + /** + * Ignored definitions + */ + ignored_definitions?: string[]; + }; + /** + * MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md053.md + */ + "link-image-reference-definitions"?: + | boolean + | { + /** + * Ignored definitions + */ + ignored_definitions?: string[]; + }; + /** + * MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md054.md + */ + MD054?: + | boolean + | { + /** + * Allow autolinks + */ + autolink?: boolean; + /** + * Allow inline links and images + */ + inline?: boolean; + /** + * Allow full reference links and images + */ + full?: boolean; + /** + * Allow collapsed reference links and images + */ + collapsed?: boolean; + /** + * Allow shortcut reference links and images + */ + shortcut?: boolean; + /** + * Allow URLs as inline links + */ + url_inline?: boolean; + }; + /** + * MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md054.md + */ + "link-image-style"?: + | boolean + | { + /** + * Allow autolinks + */ + autolink?: boolean; + /** + * Allow inline links and images + */ + inline?: boolean; + /** + * Allow full reference links and images + */ + full?: boolean; + /** + * Allow collapsed reference links and images + */ + collapsed?: boolean; + /** + * Allow shortcut reference links and images + */ + shortcut?: boolean; + /** + * Allow URLs as inline links + */ + url_inline?: boolean; + }; + /** + * MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md055.md + */ + MD055?: + | boolean + | { + /** + * Table pipe style + */ + style?: "consistent" | "leading_only" | "trailing_only" | "leading_and_trailing" | "no_leading_or_trailing"; + }; + /** + * MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md055.md + */ + "table-pipe-style"?: + | boolean + | { + /** + * Table pipe style + */ + style?: "consistent" | "leading_only" | "trailing_only" | "leading_and_trailing" | "no_leading_or_trailing"; + }; + /** + * MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md056.md + */ + MD056?: boolean; + /** + * MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md056.md + */ + "table-column-count"?: boolean; + /** + * MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md058.md + */ + MD058?: boolean; + /** + * MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md058.md + */ + "blanks-around-tables"?: boolean; + /** + * headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043 + */ + headings?: boolean; + /** + * bullet : MD004, MD005, MD007, MD032 + */ + bullet?: boolean; + /** + * ul : MD004, MD005, MD007, MD030, MD032 + */ + ul?: boolean; + /** + * indentation : MD005, MD007, MD027 + */ + indentation?: boolean; + /** + * whitespace : MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039 + */ + whitespace?: boolean; + /** + * hard_tab : MD010 + */ + hard_tab?: boolean; + /** + * links : MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054 + */ + links?: boolean; + /** + * blank_lines : MD012, MD022, MD031, MD032, MD047 + */ + blank_lines?: boolean; + /** + * line_length : MD013 + */ + line_length?: boolean; + /** + * code : MD014, MD031, MD038, MD040, MD046, MD048 + */ + code?: boolean; + /** + * atx : MD018, MD019 + */ + atx?: boolean; + /** + * spaces : MD018, MD019, MD020, MD021, MD023 + */ + spaces?: boolean; + /** + * atx_closed : MD020, MD021 + */ + atx_closed?: boolean; + /** + * blockquote : MD027, MD028 + */ + blockquote?: boolean; + /** + * ol : MD029, MD030, MD032 + */ + ol?: boolean; + /** + * html : MD033 + */ + html?: boolean; + /** + * url : MD034 + */ + url?: boolean; + /** + * hr : MD035 + */ + hr?: boolean; + /** + * emphasis : MD036, MD037, MD049, MD050 + */ + emphasis?: boolean; + /** + * language : MD040 + */ + language?: boolean; + /** + * spelling : MD044 + */ + spelling?: boolean; + /** + * accessibility : MD045 + */ + accessibility?: boolean; + /** + * images : MD045, MD052, MD053, MD054 + */ + images?: boolean; + /** + * table : MD055, MD056, MD058 + */ + table?: boolean; +} diff --git a/lib/configuration.d.ts b/lib/configuration.d.ts index 4021b62a8..2406f8758 100644 --- a/lib/configuration.d.ts +++ b/lib/configuration.d.ts @@ -1,1186 +1,8 @@ -/* eslint-disable */ -/** - * This file was automatically generated by json-schema-to-typescript. - * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, - * and run json-schema-to-typescript to regenerate this file. - */ +import { ConfigurationStrict } from "./configuration-strict"; -export interface Configuration { +export interface Configuration extends ConfigurationStrict { /** - * JSON Schema URI (expected by some editors) + * Index signature for arbitrary custom rules. */ - $schema?: string; - /** - * Default state for all rules - */ - default?: boolean; - /** - * Path to configuration file to extend - */ - extends?: string | null; - /** - * MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md001.md - */ - MD001?: boolean; - /** - * MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md001.md - */ - "heading-increment"?: boolean; - /** - * MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md003.md - */ - MD003?: - | boolean - | { - /** - * Heading style - */ - style?: "consistent" | "atx" | "atx_closed" | "setext" | "setext_with_atx" | "setext_with_atx_closed"; - }; - /** - * MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md003.md - */ - "heading-style"?: - | boolean - | { - /** - * Heading style - */ - style?: "consistent" | "atx" | "atx_closed" | "setext" | "setext_with_atx" | "setext_with_atx_closed"; - }; - /** - * MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md004.md - */ - MD004?: - | boolean - | { - /** - * List style - */ - style?: "consistent" | "asterisk" | "plus" | "dash" | "sublist"; - }; - /** - * MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md004.md - */ - "ul-style"?: - | boolean - | { - /** - * List style - */ - style?: "consistent" | "asterisk" | "plus" | "dash" | "sublist"; - }; - /** - * MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md005.md - */ - MD005?: boolean; - /** - * MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md005.md - */ - "list-indent"?: boolean; - /** - * MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md007.md - */ - MD007?: - | boolean - | { - /** - * Spaces for indent - */ - indent?: number; - /** - * Whether to indent the first level of the list - */ - start_indented?: boolean; - /** - * Spaces for first level indent (when start_indented is set) - */ - start_indent?: number; - }; - /** - * MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md007.md - */ - "ul-indent"?: - | boolean - | { - /** - * Spaces for indent - */ - indent?: number; - /** - * Whether to indent the first level of the list - */ - start_indented?: boolean; - /** - * Spaces for first level indent (when start_indented is set) - */ - start_indent?: number; - }; - /** - * MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md009.md - */ - MD009?: - | boolean - | { - /** - * Spaces for line break - */ - br_spaces?: number; - /** - * Allow spaces for empty lines in list items - */ - list_item_empty_lines?: boolean; - /** - * Include unnecessary breaks - */ - strict?: boolean; - }; - /** - * MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md009.md - */ - "no-trailing-spaces"?: - | boolean - | { - /** - * Spaces for line break - */ - br_spaces?: number; - /** - * Allow spaces for empty lines in list items - */ - list_item_empty_lines?: boolean; - /** - * Include unnecessary breaks - */ - strict?: boolean; - }; - /** - * MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md - */ - MD010?: - | boolean - | { - /** - * Include code blocks - */ - code_blocks?: boolean; - /** - * Fenced code languages to ignore - */ - ignore_code_languages?: string[]; - /** - * Number of spaces for each hard tab - */ - spaces_per_tab?: number; - }; - /** - * MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md - */ - "no-hard-tabs"?: - | boolean - | { - /** - * Include code blocks - */ - code_blocks?: boolean; - /** - * Fenced code languages to ignore - */ - ignore_code_languages?: string[]; - /** - * Number of spaces for each hard tab - */ - spaces_per_tab?: number; - }; - /** - * MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md011.md - */ - MD011?: boolean; - /** - * MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md011.md - */ - "no-reversed-links"?: boolean; - /** - * MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md012.md - */ - MD012?: - | boolean - | { - /** - * Consecutive blank lines - */ - maximum?: number; - }; - /** - * MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md012.md - */ - "no-multiple-blanks"?: - | boolean - | { - /** - * Consecutive blank lines - */ - maximum?: number; - }; - /** - * MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md013.md - */ - MD013?: - | boolean - | { - /** - * Number of characters - */ - line_length?: number; - /** - * Number of characters for headings - */ - heading_line_length?: number; - /** - * Number of characters for code blocks - */ - code_block_line_length?: number; - /** - * Include code blocks - */ - code_blocks?: boolean; - /** - * Include tables - */ - tables?: boolean; - /** - * Include headings - */ - headings?: boolean; - /** - * Strict length checking - */ - strict?: boolean; - /** - * Stern length checking - */ - stern?: boolean; - }; - /** - * MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md013.md - */ - "line-length"?: - | boolean - | { - /** - * Number of characters - */ - line_length?: number; - /** - * Number of characters for headings - */ - heading_line_length?: number; - /** - * Number of characters for code blocks - */ - code_block_line_length?: number; - /** - * Include code blocks - */ - code_blocks?: boolean; - /** - * Include tables - */ - tables?: boolean; - /** - * Include headings - */ - headings?: boolean; - /** - * Strict length checking - */ - strict?: boolean; - /** - * Stern length checking - */ - stern?: boolean; - }; - /** - * MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md014.md - */ - MD014?: boolean; - /** - * MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md014.md - */ - "commands-show-output"?: boolean; - /** - * MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md018.md - */ - MD018?: boolean; - /** - * MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md018.md - */ - "no-missing-space-atx"?: boolean; - /** - * MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md019.md - */ - MD019?: boolean; - /** - * MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md019.md - */ - "no-multiple-space-atx"?: boolean; - /** - * MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md020.md - */ - MD020?: boolean; - /** - * MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md020.md - */ - "no-missing-space-closed-atx"?: boolean; - /** - * MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md021.md - */ - MD021?: boolean; - /** - * MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md021.md - */ - "no-multiple-space-closed-atx"?: boolean; - /** - * MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md022.md - */ - MD022?: - | boolean - | { - /** - * Blank lines above heading - */ - lines_above?: number | number[]; - /** - * Blank lines below heading - */ - lines_below?: number | number[]; - }; - /** - * MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md022.md - */ - "blanks-around-headings"?: - | boolean - | { - /** - * Blank lines above heading - */ - lines_above?: number | number[]; - /** - * Blank lines below heading - */ - lines_below?: number | number[]; - }; - /** - * MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md023.md - */ - MD023?: boolean; - /** - * MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md023.md - */ - "heading-start-left"?: boolean; - /** - * MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md024.md - */ - MD024?: - | boolean - | { - /** - * Only check sibling headings - */ - siblings_only?: boolean; - }; - /** - * MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md024.md - */ - "no-duplicate-heading"?: - | boolean - | { - /** - * Only check sibling headings - */ - siblings_only?: boolean; - }; - /** - * MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md025.md - */ - MD025?: - | boolean - | { - /** - * Heading level - */ - level?: number; - /** - * RegExp for matching title in front matter - */ - front_matter_title?: string; - }; - /** - * MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md025.md - */ - "single-title"?: - | boolean - | { - /** - * Heading level - */ - level?: number; - /** - * RegExp for matching title in front matter - */ - front_matter_title?: string; - }; - /** - * MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md025.md - */ - "single-h1"?: - | boolean - | { - /** - * Heading level - */ - level?: number; - /** - * RegExp for matching title in front matter - */ - front_matter_title?: string; - }; - /** - * MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md026.md - */ - MD026?: - | boolean - | { - /** - * Punctuation characters - */ - punctuation?: string; - }; - /** - * MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md026.md - */ - "no-trailing-punctuation"?: - | boolean - | { - /** - * Punctuation characters - */ - punctuation?: string; - }; - /** - * MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md027.md - */ - MD027?: boolean; - /** - * MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md027.md - */ - "no-multiple-space-blockquote"?: boolean; - /** - * MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md028.md - */ - MD028?: boolean; - /** - * MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md028.md - */ - "no-blanks-blockquote"?: boolean; - /** - * MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md029.md - */ - MD029?: - | boolean - | { - /** - * List style - */ - style?: "one" | "ordered" | "one_or_ordered" | "zero"; - }; - /** - * MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md029.md - */ - "ol-prefix"?: - | boolean - | { - /** - * List style - */ - style?: "one" | "ordered" | "one_or_ordered" | "zero"; - }; - /** - * MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md030.md - */ - MD030?: - | boolean - | { - /** - * Spaces for single-line unordered list items - */ - ul_single?: number; - /** - * Spaces for single-line ordered list items - */ - ol_single?: number; - /** - * Spaces for multi-line unordered list items - */ - ul_multi?: number; - /** - * Spaces for multi-line ordered list items - */ - ol_multi?: number; - }; - /** - * MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md030.md - */ - "list-marker-space"?: - | boolean - | { - /** - * Spaces for single-line unordered list items - */ - ul_single?: number; - /** - * Spaces for single-line ordered list items - */ - ol_single?: number; - /** - * Spaces for multi-line unordered list items - */ - ul_multi?: number; - /** - * Spaces for multi-line ordered list items - */ - ol_multi?: number; - }; - /** - * MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md031.md - */ - MD031?: - | boolean - | { - /** - * Include list items - */ - list_items?: boolean; - }; - /** - * MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md031.md - */ - "blanks-around-fences"?: - | boolean - | { - /** - * Include list items - */ - list_items?: boolean; - }; - /** - * MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md032.md - */ - MD032?: boolean; - /** - * MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md032.md - */ - "blanks-around-lists"?: boolean; - /** - * MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md033.md - */ - MD033?: - | boolean - | { - /** - * Allowed elements - */ - allowed_elements?: string[]; - }; - /** - * MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md033.md - */ - "no-inline-html"?: - | boolean - | { - /** - * Allowed elements - */ - allowed_elements?: string[]; - }; - /** - * MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md034.md - */ - MD034?: boolean; - /** - * MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md034.md - */ - "no-bare-urls"?: boolean; - /** - * MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md035.md - */ - MD035?: - | boolean - | { - /** - * Horizontal rule style - */ - style?: string; - }; - /** - * MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md035.md - */ - "hr-style"?: - | boolean - | { - /** - * Horizontal rule style - */ - style?: string; - }; - /** - * MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md036.md - */ - MD036?: - | boolean - | { - /** - * Punctuation characters - */ - punctuation?: string; - }; - /** - * MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md036.md - */ - "no-emphasis-as-heading"?: - | boolean - | { - /** - * Punctuation characters - */ - punctuation?: string; - }; - /** - * MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md037.md - */ - MD037?: boolean; - /** - * MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md037.md - */ - "no-space-in-emphasis"?: boolean; - /** - * MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md038.md - */ - MD038?: boolean; - /** - * MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md038.md - */ - "no-space-in-code"?: boolean; - /** - * MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md039.md - */ - MD039?: boolean; - /** - * MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md039.md - */ - "no-space-in-links"?: boolean; - /** - * MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md040.md - */ - MD040?: - | boolean - | { - /** - * List of languages - */ - allowed_languages?: string[]; - /** - * Require language only - */ - language_only?: boolean; - }; - /** - * MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md040.md - */ - "fenced-code-language"?: - | boolean - | { - /** - * List of languages - */ - allowed_languages?: string[]; - /** - * Require language only - */ - language_only?: boolean; - }; - /** - * MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md041.md - */ - MD041?: - | boolean - | { - /** - * Heading level - */ - level?: number; - /** - * RegExp for matching title in front matter - */ - front_matter_title?: string; - }; - /** - * MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md041.md - */ - "first-line-heading"?: - | boolean - | { - /** - * Heading level - */ - level?: number; - /** - * RegExp for matching title in front matter - */ - front_matter_title?: string; - }; - /** - * MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md041.md - */ - "first-line-h1"?: - | boolean - | { - /** - * Heading level - */ - level?: number; - /** - * RegExp for matching title in front matter - */ - front_matter_title?: string; - }; - /** - * MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md042.md - */ - MD042?: boolean; - /** - * MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md042.md - */ - "no-empty-links"?: boolean; - /** - * MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md043.md - */ - MD043?: - | boolean - | { - /** - * List of headings - */ - headings?: string[]; - /** - * Match case of headings - */ - match_case?: boolean; - }; - /** - * MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md043.md - */ - "required-headings"?: - | boolean - | { - /** - * List of headings - */ - headings?: string[]; - /** - * Match case of headings - */ - match_case?: boolean; - }; - /** - * MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md044.md - */ - MD044?: - | boolean - | { - /** - * List of proper names - */ - names?: string[]; - /** - * Include code blocks - */ - code_blocks?: boolean; - /** - * Include HTML elements - */ - html_elements?: boolean; - }; - /** - * MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md044.md - */ - "proper-names"?: - | boolean - | { - /** - * List of proper names - */ - names?: string[]; - /** - * Include code blocks - */ - code_blocks?: boolean; - /** - * Include HTML elements - */ - html_elements?: boolean; - }; - /** - * MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md045.md - */ - MD045?: boolean; - /** - * MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md045.md - */ - "no-alt-text"?: boolean; - /** - * MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md046.md - */ - MD046?: - | boolean - | { - /** - * Block style - */ - style?: "consistent" | "fenced" | "indented"; - }; - /** - * MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md046.md - */ - "code-block-style"?: - | boolean - | { - /** - * Block style - */ - style?: "consistent" | "fenced" | "indented"; - }; - /** - * MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md047.md - */ - MD047?: boolean; - /** - * MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md047.md - */ - "single-trailing-newline"?: boolean; - /** - * MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md048.md - */ - MD048?: - | boolean - | { - /** - * Code fence style - */ - style?: "consistent" | "backtick" | "tilde"; - }; - /** - * MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md048.md - */ - "code-fence-style"?: - | boolean - | { - /** - * Code fence style - */ - style?: "consistent" | "backtick" | "tilde"; - }; - /** - * MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md049.md - */ - MD049?: - | boolean - | { - /** - * Emphasis style - */ - style?: "consistent" | "asterisk" | "underscore"; - }; - /** - * MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md049.md - */ - "emphasis-style"?: - | boolean - | { - /** - * Emphasis style - */ - style?: "consistent" | "asterisk" | "underscore"; - }; - /** - * MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md050.md - */ - MD050?: - | boolean - | { - /** - * Strong style - */ - style?: "consistent" | "asterisk" | "underscore"; - }; - /** - * MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md050.md - */ - "strong-style"?: - | boolean - | { - /** - * Strong style - */ - style?: "consistent" | "asterisk" | "underscore"; - }; - /** - * MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md051.md - */ - MD051?: boolean; - /** - * MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md051.md - */ - "link-fragments"?: boolean; - /** - * MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md052.md - */ - MD052?: - | boolean - | { - /** - * Include shortcut syntax - */ - shortcut_syntax?: boolean; - }; - /** - * MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md052.md - */ - "reference-links-images"?: - | boolean - | { - /** - * Include shortcut syntax - */ - shortcut_syntax?: boolean; - }; - /** - * MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md053.md - */ - MD053?: - | boolean - | { - /** - * Ignored definitions - */ - ignored_definitions?: string[]; - }; - /** - * MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md053.md - */ - "link-image-reference-definitions"?: - | boolean - | { - /** - * Ignored definitions - */ - ignored_definitions?: string[]; - }; - /** - * MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md054.md - */ - MD054?: - | boolean - | { - /** - * Allow autolinks - */ - autolink?: boolean; - /** - * Allow inline links and images - */ - inline?: boolean; - /** - * Allow full reference links and images - */ - full?: boolean; - /** - * Allow collapsed reference links and images - */ - collapsed?: boolean; - /** - * Allow shortcut reference links and images - */ - shortcut?: boolean; - /** - * Allow URLs as inline links - */ - url_inline?: boolean; - }; - /** - * MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md054.md - */ - "link-image-style"?: - | boolean - | { - /** - * Allow autolinks - */ - autolink?: boolean; - /** - * Allow inline links and images - */ - inline?: boolean; - /** - * Allow full reference links and images - */ - full?: boolean; - /** - * Allow collapsed reference links and images - */ - collapsed?: boolean; - /** - * Allow shortcut reference links and images - */ - shortcut?: boolean; - /** - * Allow URLs as inline links - */ - url_inline?: boolean; - }; - /** - * MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md055.md - */ - MD055?: - | boolean - | { - /** - * Table pipe style - */ - style?: "consistent" | "leading_only" | "trailing_only" | "leading_and_trailing" | "no_leading_or_trailing"; - }; - /** - * MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md055.md - */ - "table-pipe-style"?: - | boolean - | { - /** - * Table pipe style - */ - style?: "consistent" | "leading_only" | "trailing_only" | "leading_and_trailing" | "no_leading_or_trailing"; - }; - /** - * MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md056.md - */ - MD056?: boolean; - /** - * MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md056.md - */ - "table-column-count"?: boolean; - /** - * MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md058.md - */ - MD058?: boolean; - /** - * MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md058.md - */ - "blanks-around-tables"?: boolean; - /** - * headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043 - */ - headings?: boolean; - /** - * bullet : MD004, MD005, MD007, MD032 - */ - bullet?: boolean; - /** - * ul : MD004, MD005, MD007, MD030, MD032 - */ - ul?: boolean; - /** - * indentation : MD005, MD007, MD027 - */ - indentation?: boolean; - /** - * whitespace : MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039 - */ - whitespace?: boolean; - /** - * hard_tab : MD010 - */ - hard_tab?: boolean; - /** - * links : MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054 - */ - links?: boolean; - /** - * blank_lines : MD012, MD022, MD031, MD032, MD047 - */ - blank_lines?: boolean; - /** - * line_length : MD013 - */ - line_length?: boolean; - /** - * code : MD014, MD031, MD038, MD040, MD046, MD048 - */ - code?: boolean; - /** - * atx : MD018, MD019 - */ - atx?: boolean; - /** - * spaces : MD018, MD019, MD020, MD021, MD023 - */ - spaces?: boolean; - /** - * atx_closed : MD020, MD021 - */ - atx_closed?: boolean; - /** - * blockquote : MD027, MD028 - */ - blockquote?: boolean; - /** - * ol : MD029, MD030, MD032 - */ - ol?: boolean; - /** - * html : MD033 - */ - html?: boolean; - /** - * url : MD034 - */ - url?: boolean; - /** - * hr : MD035 - */ - hr?: boolean; - /** - * emphasis : MD036, MD037, MD049, MD050 - */ - emphasis?: boolean; - /** - * language : MD040 - */ - language?: boolean; - /** - * spelling : MD044 - */ - spelling?: boolean; - /** - * accessibility : MD045 - */ - accessibility?: boolean; - /** - * images : MD045, MD052, MD053, MD054 - */ - images?: boolean; - /** - * table : MD055, MD056, MD058 - */ - table?: boolean; [k: string]: unknown; } diff --git a/lib/markdownlint.d.ts b/lib/markdownlint.d.ts index 7dec49753..6453ded4b 100644 --- a/lib/markdownlint.d.ts +++ b/lib/markdownlint.d.ts @@ -8,7 +8,7 @@ export = markdownlint; */ declare function markdownlint(options: Options | null, callback: LintCallback): void; declare namespace markdownlint { - export { markdownlintSync as sync, readConfig, readConfigSync, getVersion, promises, GetMarkdownIt, RuleFunction, RuleParams, MarkdownParsers, ParserMarkdownIt, ParserMicromark, MarkdownItToken, MicromarkTokenType, MicromarkToken, RuleOnError, RuleOnErrorInfo, RuleOnErrorFixInfo, Rule, Options, Plugin, ToStringCallback, LintResults, LintError, FixInfo, LintContentCallback, LintCallback, Configuration, RuleConfiguration, ConfigurationParser, ReadConfigCallback, ResolveConfigExtendsCallback }; + export { markdownlintSync as sync, readConfig, readConfigSync, getVersion, promises, GetMarkdownIt, RuleFunction, RuleParams, MarkdownParsers, ParserMarkdownIt, ParserMicromark, MarkdownItToken, MicromarkTokenType, MicromarkToken, RuleOnError, RuleOnErrorInfo, RuleOnErrorFixInfo, Rule, Options, Plugin, ToStringCallback, LintResults, LintError, FixInfo, LintContentCallback, LintCallback, Configuration, ConfigurationStrict, RuleConfiguration, ConfigurationParser, ReadConfigCallback, ResolveConfigExtendsCallback }; } /** * Lint specified Markdown files synchronously. @@ -439,6 +439,11 @@ type LintCallback = (error: Error | null, results?: LintResults) => void; * {@link ../schema/markdownlint-config-schema.json}. */ type Configuration = import("./configuration").Configuration; +/** + * Configuration object for linting rules strictly. For the JSON schema, see + * {@link ../schema/markdownlint-config-schema-strict.json}. + */ +type ConfigurationStrict = import("./configuration-strict").ConfigurationStrict; /** * Rule configuration. */ diff --git a/lib/markdownlint.js b/lib/markdownlint.js index dacc51a0d..d3678e6d1 100644 --- a/lib/markdownlint.js +++ b/lib/markdownlint.js @@ -1532,6 +1532,13 @@ module.exports = markdownlint; * @typedef {import("./configuration").Configuration} Configuration */ +/** + * Configuration object for linting rules strictly. For the JSON schema, see + * {@link ../schema/markdownlint-config-schema-strict.json}. + * + * @typedef {import("./configuration-strict").ConfigurationStrict} ConfigurationStrict + */ + /** * Rule configuration object. * diff --git a/schema/ValidatingConfiguration.md b/schema/ValidatingConfiguration.md index f6ae6a5b8..5d842c498 100644 --- a/schema/ValidatingConfiguration.md +++ b/schema/ValidatingConfiguration.md @@ -1,7 +1,7 @@ # Validating Configuration A [JSON Schema][json-schema] is provided to enable validating configuration -objects: [`markdownlint-config-schema.json`][markdownlint-config-schema] +objects: [`markdownlint-config-schema.json`][markdownlint-config-schema]. Some editors automatically use a JSON Schema with files that reference it. For example, a `.markdownlint.json` file with: @@ -16,13 +16,11 @@ A JSON Schema validator can be used to check configuration files like so: npx ajv-cli validate -s ./markdownlint/schema/markdownlint-config-schema.json -d "**/.markdownlint.{json,yaml}" --strict=false ``` -By default, any rule name is valid in order to allow for custom rules. To ensure -that only built-in rules are used, change the value of `#/additionalProperties` -(at the bottom of the schema file) to `false` before validating: - -```json -"additionalProperties": false -``` +By default, any rule name is valid because of custom rules. To allow only +built-in rules, use the +[`markdownlint-config-schema-strict.json`][markdownlint-config-schema-strict] +JSON Schema instead. [json-schema]: https://json-schema.org [markdownlint-config-schema]: markdownlint-config-schema.json +[markdownlint-config-schema-strict]: markdownlint-config-schema-strict.json diff --git a/schema/build-config-schema.js b/schema/build-config-schema.js index 11aa47fdf..63439ca49 100644 --- a/schema/build-config-schema.js +++ b/schema/build-config-schema.js @@ -9,7 +9,10 @@ const rules = require("../lib/rules"); const jsonSchemaToTypeScript = require("json-schema-to-typescript"); const { version } = require("../lib/constants"); -const schemaUri = `https://raw.githubusercontent.com/DavidAnson/markdownlint/v${version}/schema/markdownlint-config-schema.json`; +const schemaName = "markdownlint-config-schema.json"; +const schemaUri = `https://raw.githubusercontent.com/DavidAnson/markdownlint/v${version}/schema/${schemaName}`; +const schemaStrictName = "markdownlint-config-schema-strict.json"; +const schemaStrictUri = `https://raw.githubusercontent.com/DavidAnson/markdownlint/v${version}/schema/${schemaStrictName}`; // Schema scaffolding const schema = { @@ -574,20 +577,24 @@ for (const [ tag, tagTags ] of Object.entries(tags)) { } // Write schema -const schemaFile = path.join(__dirname, "markdownlint-config-schema.json"); +const schemaFile = path.join(__dirname, schemaName); fs.writeFileSync(schemaFile, JSON.stringify(schema, null, " ")); -// Write TypeScript declaration -// See https://github.com/bcherny/json-schema-to-typescript/issues/356 for why -// additionalProperties is deleted -const schemaDeclaration = - path.join(__dirname, "..", "lib", "configuration.d.ts"); -// @ts-ignore -delete schema.additionalProperties; -schema.title = "Configuration"; +// Create and write strict schema +const schemaStrict = { + ...schema, + "$id": schemaStrictUri, + "additionalProperties": false +}; +const schemaFileStrict = path.join(__dirname, schemaStrictName); +fs.writeFileSync(schemaFileStrict, JSON.stringify(schemaStrict, null, " ")); + +// Write TypeScript declaration file +const declarationStrictName = path.join(__dirname, "..", "lib", "configuration-strict.d.ts"); +schemaStrict.title = "ConfigurationStrict"; jsonSchemaToTypeScript.compile( // @ts-ignore - schema, + schemaStrict, "UNUSED" // eslint-disable-next-line unicorn/prefer-top-level-await -).then((declaration) => fs.writeFileSync(schemaDeclaration, declaration)); +).then((declaration) => fs.writeFileSync(declarationStrictName, declaration)); diff --git a/schema/markdownlint-config-schema-strict.json b/schema/markdownlint-config-schema-strict.json new file mode 100644 index 000000000..b51ce08e9 --- /dev/null +++ b/schema/markdownlint-config-schema-strict.json @@ -0,0 +1,1819 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.34.0/schema/markdownlint-config-schema-strict.json", + "title": "markdownlint configuration schema", + "type": "object", + "properties": { + "$schema": { + "description": "JSON Schema URI (expected by some editors)", + "type": "string", + "default": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.34.0/schema/markdownlint-config-schema.json" + }, + "default": { + "description": "Default state for all rules", + "type": "boolean", + "default": true + }, + "extends": { + "description": "Path to configuration file to extend", + "type": [ + "string", + "null" + ], + "default": null + }, + "MD001": { + "description": "MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md001.md", + "type": "boolean", + "default": true + }, + "heading-increment": { + "description": "MD001/heading-increment : Heading levels should only increment by one level at a time : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md001.md", + "type": "boolean", + "default": true + }, + "MD003": { + "description": "MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md003.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Heading style", + "type": "string", + "enum": [ + "consistent", + "atx", + "atx_closed", + "setext", + "setext_with_atx", + "setext_with_atx_closed" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "heading-style": { + "description": "MD003/heading-style : Heading style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md003.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Heading style", + "type": "string", + "enum": [ + "consistent", + "atx", + "atx_closed", + "setext", + "setext_with_atx", + "setext_with_atx_closed" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "MD004": { + "description": "MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md004.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "List style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "plus", + "dash", + "sublist" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "ul-style": { + "description": "MD004/ul-style : Unordered list style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md004.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "List style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "plus", + "dash", + "sublist" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "MD005": { + "description": "MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md005.md", + "type": "boolean", + "default": true + }, + "list-indent": { + "description": "MD005/list-indent : Inconsistent indentation for list items at the same level : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md005.md", + "type": "boolean", + "default": true + }, + "MD007": { + "description": "MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md007.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "indent": { + "description": "Spaces for indent", + "type": "integer", + "minimum": 1, + "default": 2 + }, + "start_indented": { + "description": "Whether to indent the first level of the list", + "type": "boolean", + "default": false + }, + "start_indent": { + "description": "Spaces for first level indent (when start_indented is set)", + "type": "integer", + "minimum": 1, + "default": 2 + } + }, + "additionalProperties": false + }, + "ul-indent": { + "description": "MD007/ul-indent : Unordered list indentation : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md007.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "indent": { + "description": "Spaces for indent", + "type": "integer", + "minimum": 1, + "default": 2 + }, + "start_indented": { + "description": "Whether to indent the first level of the list", + "type": "boolean", + "default": false + }, + "start_indent": { + "description": "Spaces for first level indent (when start_indented is set)", + "type": "integer", + "minimum": 1, + "default": 2 + } + }, + "additionalProperties": false + }, + "MD009": { + "description": "MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md009.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "br_spaces": { + "description": "Spaces for line break", + "type": "integer", + "minimum": 0, + "default": 2 + }, + "list_item_empty_lines": { + "description": "Allow spaces for empty lines in list items", + "type": "boolean", + "default": false + }, + "strict": { + "description": "Include unnecessary breaks", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "no-trailing-spaces": { + "description": "MD009/no-trailing-spaces : Trailing spaces : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md009.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "br_spaces": { + "description": "Spaces for line break", + "type": "integer", + "minimum": 0, + "default": 2 + }, + "list_item_empty_lines": { + "description": "Allow spaces for empty lines in list items", + "type": "boolean", + "default": false + }, + "strict": { + "description": "Include unnecessary breaks", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "MD010": { + "description": "MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "ignore_code_languages": { + "description": "Fenced code languages to ignore", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "spaces_per_tab": { + "description": "Number of spaces for each hard tab", + "type": "integer", + "minimum": 0, + "default": 1 + } + }, + "additionalProperties": false + }, + "no-hard-tabs": { + "description": "MD010/no-hard-tabs : Hard tabs : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md010.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "ignore_code_languages": { + "description": "Fenced code languages to ignore", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "spaces_per_tab": { + "description": "Number of spaces for each hard tab", + "type": "integer", + "minimum": 0, + "default": 1 + } + }, + "additionalProperties": false + }, + "MD011": { + "description": "MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md011.md", + "type": "boolean", + "default": true + }, + "no-reversed-links": { + "description": "MD011/no-reversed-links : Reversed link syntax : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md011.md", + "type": "boolean", + "default": true + }, + "MD012": { + "description": "MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md012.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "maximum": { + "description": "Consecutive blank lines", + "type": "integer", + "minimum": 1, + "default": 1 + } + }, + "additionalProperties": false + }, + "no-multiple-blanks": { + "description": "MD012/no-multiple-blanks : Multiple consecutive blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md012.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "maximum": { + "description": "Consecutive blank lines", + "type": "integer", + "minimum": 1, + "default": 1 + } + }, + "additionalProperties": false + }, + "MD013": { + "description": "MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md013.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "line_length": { + "description": "Number of characters", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "heading_line_length": { + "description": "Number of characters for headings", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "code_block_line_length": { + "description": "Number of characters for code blocks", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "tables": { + "description": "Include tables", + "type": "boolean", + "default": true + }, + "headings": { + "description": "Include headings", + "type": "boolean", + "default": true + }, + "strict": { + "description": "Strict length checking", + "type": "boolean", + "default": false + }, + "stern": { + "description": "Stern length checking", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "line-length": { + "description": "MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md013.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "line_length": { + "description": "Number of characters", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "heading_line_length": { + "description": "Number of characters for headings", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "code_block_line_length": { + "description": "Number of characters for code blocks", + "type": "integer", + "minimum": 1, + "default": 80 + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "tables": { + "description": "Include tables", + "type": "boolean", + "default": true + }, + "headings": { + "description": "Include headings", + "type": "boolean", + "default": true + }, + "strict": { + "description": "Strict length checking", + "type": "boolean", + "default": false + }, + "stern": { + "description": "Stern length checking", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "MD014": { + "description": "MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md014.md", + "type": "boolean", + "default": true + }, + "commands-show-output": { + "description": "MD014/commands-show-output : Dollar signs used before commands without showing output : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md014.md", + "type": "boolean", + "default": true + }, + "MD018": { + "description": "MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md018.md", + "type": "boolean", + "default": true + }, + "no-missing-space-atx": { + "description": "MD018/no-missing-space-atx : No space after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md018.md", + "type": "boolean", + "default": true + }, + "MD019": { + "description": "MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md019.md", + "type": "boolean", + "default": true + }, + "no-multiple-space-atx": { + "description": "MD019/no-multiple-space-atx : Multiple spaces after hash on atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md019.md", + "type": "boolean", + "default": true + }, + "MD020": { + "description": "MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md020.md", + "type": "boolean", + "default": true + }, + "no-missing-space-closed-atx": { + "description": "MD020/no-missing-space-closed-atx : No space inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md020.md", + "type": "boolean", + "default": true + }, + "MD021": { + "description": "MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md021.md", + "type": "boolean", + "default": true + }, + "no-multiple-space-closed-atx": { + "description": "MD021/no-multiple-space-closed-atx : Multiple spaces inside hashes on closed atx style heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md021.md", + "type": "boolean", + "default": true + }, + "MD022": { + "description": "MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md022.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "lines_above": { + "description": "Blank lines above heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + }, + "lines_below": { + "description": "Blank lines below heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + } + }, + "additionalProperties": false + }, + "blanks-around-headings": { + "description": "MD022/blanks-around-headings : Headings should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md022.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "lines_above": { + "description": "Blank lines above heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + }, + "lines_below": { + "description": "Blank lines below heading", + "type": [ + "integer", + "array" + ], + "items": { + "type": "integer" + }, + "minimum": -1, + "default": 1 + } + }, + "additionalProperties": false + }, + "MD023": { + "description": "MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md023.md", + "type": "boolean", + "default": true + }, + "heading-start-left": { + "description": "MD023/heading-start-left : Headings must start at the beginning of the line : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md023.md", + "type": "boolean", + "default": true + }, + "MD024": { + "description": "MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md024.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "siblings_only": { + "description": "Only check sibling headings", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "no-duplicate-heading": { + "description": "MD024/no-duplicate-heading : Multiple headings with the same content : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md024.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "siblings_only": { + "description": "Only check sibling headings", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "MD025": { + "description": "MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md025.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + } + }, + "additionalProperties": false + }, + "single-title": { + "description": "MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md025.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + } + }, + "additionalProperties": false + }, + "single-h1": { + "description": "MD025/single-title/single-h1 : Multiple top-level headings in the same document : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md025.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + } + }, + "additionalProperties": false + }, + "MD026": { + "description": "MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md026.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "punctuation": { + "description": "Punctuation characters", + "type": "string", + "default": ".,;:!。,;:!" + } + }, + "additionalProperties": false + }, + "no-trailing-punctuation": { + "description": "MD026/no-trailing-punctuation : Trailing punctuation in heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md026.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "punctuation": { + "description": "Punctuation characters", + "type": "string", + "default": ".,;:!。,;:!" + } + }, + "additionalProperties": false + }, + "MD027": { + "description": "MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md027.md", + "type": "boolean", + "default": true + }, + "no-multiple-space-blockquote": { + "description": "MD027/no-multiple-space-blockquote : Multiple spaces after blockquote symbol : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md027.md", + "type": "boolean", + "default": true + }, + "MD028": { + "description": "MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md028.md", + "type": "boolean", + "default": true + }, + "no-blanks-blockquote": { + "description": "MD028/no-blanks-blockquote : Blank line inside blockquote : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md028.md", + "type": "boolean", + "default": true + }, + "MD029": { + "description": "MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md029.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "List style", + "type": "string", + "enum": [ + "one", + "ordered", + "one_or_ordered", + "zero" + ], + "default": "one_or_ordered" + } + }, + "additionalProperties": false + }, + "ol-prefix": { + "description": "MD029/ol-prefix : Ordered list item prefix : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md029.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "List style", + "type": "string", + "enum": [ + "one", + "ordered", + "one_or_ordered", + "zero" + ], + "default": "one_or_ordered" + } + }, + "additionalProperties": false + }, + "MD030": { + "description": "MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md030.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "ul_single": { + "description": "Spaces for single-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ol_single": { + "description": "Spaces for single-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ul_multi": { + "description": "Spaces for multi-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ol_multi": { + "description": "Spaces for multi-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + } + }, + "additionalProperties": false + }, + "list-marker-space": { + "description": "MD030/list-marker-space : Spaces after list markers : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md030.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "ul_single": { + "description": "Spaces for single-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ol_single": { + "description": "Spaces for single-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ul_multi": { + "description": "Spaces for multi-line unordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "ol_multi": { + "description": "Spaces for multi-line ordered list items", + "type": "integer", + "minimum": 1, + "default": 1 + } + }, + "additionalProperties": false + }, + "MD031": { + "description": "MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md031.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "list_items": { + "description": "Include list items", + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, + "blanks-around-fences": { + "description": "MD031/blanks-around-fences : Fenced code blocks should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md031.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "list_items": { + "description": "Include list items", + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, + "MD032": { + "description": "MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md032.md", + "type": "boolean", + "default": true + }, + "blanks-around-lists": { + "description": "MD032/blanks-around-lists : Lists should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md032.md", + "type": "boolean", + "default": true + }, + "MD033": { + "description": "MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md033.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "allowed_elements": { + "description": "Allowed elements", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": false + }, + "no-inline-html": { + "description": "MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md033.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "allowed_elements": { + "description": "Allowed elements", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + } + }, + "additionalProperties": false + }, + "MD034": { + "description": "MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md034.md", + "type": "boolean", + "default": true + }, + "no-bare-urls": { + "description": "MD034/no-bare-urls : Bare URL used : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md034.md", + "type": "boolean", + "default": true + }, + "MD035": { + "description": "MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md035.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Horizontal rule style", + "type": "string", + "default": "consistent" + } + }, + "additionalProperties": false + }, + "hr-style": { + "description": "MD035/hr-style : Horizontal rule style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md035.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Horizontal rule style", + "type": "string", + "default": "consistent" + } + }, + "additionalProperties": false + }, + "MD036": { + "description": "MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md036.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "punctuation": { + "description": "Punctuation characters", + "type": "string", + "default": ".,;:!?。,;:!?" + } + }, + "additionalProperties": false + }, + "no-emphasis-as-heading": { + "description": "MD036/no-emphasis-as-heading : Emphasis used instead of a heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md036.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "punctuation": { + "description": "Punctuation characters", + "type": "string", + "default": ".,;:!?。,;:!?" + } + }, + "additionalProperties": false + }, + "MD037": { + "description": "MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md037.md", + "type": "boolean", + "default": true + }, + "no-space-in-emphasis": { + "description": "MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md037.md", + "type": "boolean", + "default": true + }, + "MD038": { + "description": "MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md038.md", + "type": "boolean", + "default": true + }, + "no-space-in-code": { + "description": "MD038/no-space-in-code : Spaces inside code span elements : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md038.md", + "type": "boolean", + "default": true + }, + "MD039": { + "description": "MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md039.md", + "type": "boolean", + "default": true + }, + "no-space-in-links": { + "description": "MD039/no-space-in-links : Spaces inside link text : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md039.md", + "type": "boolean", + "default": true + }, + "MD040": { + "description": "MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md040.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "allowed_languages": { + "description": "List of languages", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "language_only": { + "description": "Require language only", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "fenced-code-language": { + "description": "MD040/fenced-code-language : Fenced code blocks should have a language specified : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md040.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "allowed_languages": { + "description": "List of languages", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "language_only": { + "description": "Require language only", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "MD041": { + "description": "MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md041.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + } + }, + "additionalProperties": false + }, + "first-line-heading": { + "description": "MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md041.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + } + }, + "additionalProperties": false + }, + "first-line-h1": { + "description": "MD041/first-line-heading/first-line-h1 : First line in a file should be a top-level heading : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md041.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "level": { + "description": "Heading level", + "type": "integer", + "minimum": 1, + "maximum": 6, + "default": 1 + }, + "front_matter_title": { + "description": "RegExp for matching title in front matter", + "type": "string", + "default": "^\\s*title\\s*[:=]" + } + }, + "additionalProperties": false + }, + "MD042": { + "description": "MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md042.md", + "type": "boolean", + "default": true + }, + "no-empty-links": { + "description": "MD042/no-empty-links : No empty links : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md042.md", + "type": "boolean", + "default": true + }, + "MD043": { + "description": "MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md043.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "headings": { + "description": "List of headings", + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\*|\\+|#{1,6} .*)$" + }, + "default": [] + }, + "match_case": { + "description": "Match case of headings", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "required-headings": { + "description": "MD043/required-headings : Required heading structure : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md043.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "headings": { + "description": "List of headings", + "type": "array", + "items": { + "type": "string", + "pattern": "^(\\*|\\+|#{1,6} .*)$" + }, + "default": [] + }, + "match_case": { + "description": "Match case of headings", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "MD044": { + "description": "MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md044.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "names": { + "description": "List of proper names", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "html_elements": { + "description": "Include HTML elements", + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, + "proper-names": { + "description": "MD044/proper-names : Proper names should have the correct capitalization : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md044.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "names": { + "description": "List of proper names", + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "code_blocks": { + "description": "Include code blocks", + "type": "boolean", + "default": true + }, + "html_elements": { + "description": "Include HTML elements", + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, + "MD045": { + "description": "MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md045.md", + "type": "boolean", + "default": true + }, + "no-alt-text": { + "description": "MD045/no-alt-text : Images should have alternate text (alt text) : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md045.md", + "type": "boolean", + "default": true + }, + "MD046": { + "description": "MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md046.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Block style", + "type": "string", + "enum": [ + "consistent", + "fenced", + "indented" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "code-block-style": { + "description": "MD046/code-block-style : Code block style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md046.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Block style", + "type": "string", + "enum": [ + "consistent", + "fenced", + "indented" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "MD047": { + "description": "MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md047.md", + "type": "boolean", + "default": true + }, + "single-trailing-newline": { + "description": "MD047/single-trailing-newline : Files should end with a single newline character : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md047.md", + "type": "boolean", + "default": true + }, + "MD048": { + "description": "MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md048.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Code fence style", + "type": "string", + "enum": [ + "consistent", + "backtick", + "tilde" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "code-fence-style": { + "description": "MD048/code-fence-style : Code fence style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md048.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Code fence style", + "type": "string", + "enum": [ + "consistent", + "backtick", + "tilde" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "MD049": { + "description": "MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md049.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Emphasis style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "underscore" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "emphasis-style": { + "description": "MD049/emphasis-style : Emphasis style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md049.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Emphasis style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "underscore" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "MD050": { + "description": "MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md050.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Strong style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "underscore" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "strong-style": { + "description": "MD050/strong-style : Strong style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md050.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Strong style", + "type": "string", + "enum": [ + "consistent", + "asterisk", + "underscore" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "MD051": { + "description": "MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md051.md", + "type": "boolean", + "default": true + }, + "link-fragments": { + "description": "MD051/link-fragments : Link fragments should be valid : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md051.md", + "type": "boolean", + "default": true + }, + "MD052": { + "description": "MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md052.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "shortcut_syntax": { + "description": "Include shortcut syntax", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "reference-links-images": { + "description": "MD052/reference-links-images : Reference links and images should use a label that is defined : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md052.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "shortcut_syntax": { + "description": "Include shortcut syntax", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + }, + "MD053": { + "description": "MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md053.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "ignored_definitions": { + "description": "Ignored definitions", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "//" + ] + } + }, + "additionalProperties": false + }, + "link-image-reference-definitions": { + "description": "MD053/link-image-reference-definitions : Link and image reference definitions should be needed : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md053.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "ignored_definitions": { + "description": "Ignored definitions", + "type": "array", + "items": { + "type": "string" + }, + "default": [ + "//" + ] + } + }, + "additionalProperties": false + }, + "MD054": { + "description": "MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md054.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "autolink": { + "description": "Allow autolinks", + "type": "boolean", + "default": true + }, + "inline": { + "description": "Allow inline links and images", + "type": "boolean", + "default": true + }, + "full": { + "description": "Allow full reference links and images", + "type": "boolean", + "default": true + }, + "collapsed": { + "description": "Allow collapsed reference links and images", + "type": "boolean", + "default": true + }, + "shortcut": { + "description": "Allow shortcut reference links and images", + "type": "boolean", + "default": true + }, + "url_inline": { + "description": "Allow URLs as inline links", + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, + "link-image-style": { + "description": "MD054/link-image-style : Link and image style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md054.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "autolink": { + "description": "Allow autolinks", + "type": "boolean", + "default": true + }, + "inline": { + "description": "Allow inline links and images", + "type": "boolean", + "default": true + }, + "full": { + "description": "Allow full reference links and images", + "type": "boolean", + "default": true + }, + "collapsed": { + "description": "Allow collapsed reference links and images", + "type": "boolean", + "default": true + }, + "shortcut": { + "description": "Allow shortcut reference links and images", + "type": "boolean", + "default": true + }, + "url_inline": { + "description": "Allow URLs as inline links", + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + }, + "MD055": { + "description": "MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md055.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Table pipe style", + "type": "string", + "enum": [ + "consistent", + "leading_only", + "trailing_only", + "leading_and_trailing", + "no_leading_or_trailing" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "table-pipe-style": { + "description": "MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md055.md", + "type": [ + "boolean", + "object" + ], + "default": true, + "properties": { + "style": { + "description": "Table pipe style", + "type": "string", + "enum": [ + "consistent", + "leading_only", + "trailing_only", + "leading_and_trailing", + "no_leading_or_trailing" + ], + "default": "consistent" + } + }, + "additionalProperties": false + }, + "MD056": { + "description": "MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md056.md", + "type": "boolean", + "default": true + }, + "table-column-count": { + "description": "MD056/table-column-count : Table column count : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md056.md", + "type": "boolean", + "default": true + }, + "MD058": { + "description": "MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md058.md", + "type": "boolean", + "default": true + }, + "blanks-around-tables": { + "description": "MD058/blanks-around-tables : Tables should be surrounded by blank lines : https://github.com/DavidAnson/markdownlint/blob/v0.34.0/doc/md058.md", + "type": "boolean", + "default": true + }, + "headings": { + "description": "headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043", + "type": "boolean", + "default": true + }, + "bullet": { + "description": "bullet : MD004, MD005, MD007, MD032", + "type": "boolean", + "default": true + }, + "ul": { + "description": "ul : MD004, MD005, MD007, MD030, MD032", + "type": "boolean", + "default": true + }, + "indentation": { + "description": "indentation : MD005, MD007, MD027", + "type": "boolean", + "default": true + }, + "whitespace": { + "description": "whitespace : MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039", + "type": "boolean", + "default": true + }, + "hard_tab": { + "description": "hard_tab : MD010", + "type": "boolean", + "default": true + }, + "links": { + "description": "links : MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054", + "type": "boolean", + "default": true + }, + "blank_lines": { + "description": "blank_lines : MD012, MD022, MD031, MD032, MD047", + "type": "boolean", + "default": true + }, + "line_length": { + "description": "line_length : MD013", + "type": "boolean", + "default": true + }, + "code": { + "description": "code : MD014, MD031, MD038, MD040, MD046, MD048", + "type": "boolean", + "default": true + }, + "atx": { + "description": "atx : MD018, MD019", + "type": "boolean", + "default": true + }, + "spaces": { + "description": "spaces : MD018, MD019, MD020, MD021, MD023", + "type": "boolean", + "default": true + }, + "atx_closed": { + "description": "atx_closed : MD020, MD021", + "type": "boolean", + "default": true + }, + "blockquote": { + "description": "blockquote : MD027, MD028", + "type": "boolean", + "default": true + }, + "ol": { + "description": "ol : MD029, MD030, MD032", + "type": "boolean", + "default": true + }, + "html": { + "description": "html : MD033", + "type": "boolean", + "default": true + }, + "url": { + "description": "url : MD034", + "type": "boolean", + "default": true + }, + "hr": { + "description": "hr : MD035", + "type": "boolean", + "default": true + }, + "emphasis": { + "description": "emphasis : MD036, MD037, MD049, MD050", + "type": "boolean", + "default": true + }, + "language": { + "description": "language : MD040", + "type": "boolean", + "default": true + }, + "spelling": { + "description": "spelling : MD044", + "type": "boolean", + "default": true + }, + "accessibility": { + "description": "accessibility : MD045", + "type": "boolean", + "default": true + }, + "images": { + "description": "images : MD045, MD052, MD053, MD054", + "type": "boolean", + "default": true + }, + "table": { + "description": "table : MD055, MD056, MD058", + "type": "boolean", + "default": true + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/test/markdownlint-test.js b/test/markdownlint-test.js index 234b09ec4..de658f41a 100644 --- a/test/markdownlint-test.js +++ b/test/markdownlint-test.js @@ -18,13 +18,9 @@ const constants = require("../lib/constants"); const rules = require("../lib/rules"); const customRules = require("./rules/rules.js"); const configSchema = require("../schema/markdownlint-config-schema.json"); +const configSchemaStrict = require("../schema/markdownlint-config-schema-strict.json"); const deprecatedRuleNames = new Set(constants.deprecatedRuleNames); -const configSchemaStrict = { - ...configSchema, - "$id": `${configSchema.$id}-strict`, - "additionalProperties": false -}; const ajvOptions = { "allowUnionTypes": true };