mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Compare commits
2 commits
e857672728
...
17002d3983
Author | SHA1 | Date | |
---|---|---|---|
![]() |
17002d3983 | ||
![]() |
56cde85f72 |
5 changed files with 710 additions and 282 deletions
48
lib/configuration-strict.d.ts
vendored
48
lib/configuration-strict.d.ts
vendored
|
@ -1281,97 +1281,97 @@ export interface ConfigurationStrict {
|
||||||
/**
|
/**
|
||||||
* headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043
|
* headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043
|
||||||
*/
|
*/
|
||||||
headings?: boolean;
|
headings?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* bullet : MD004, MD005, MD007, MD032
|
* bullet : MD004, MD005, MD007, MD032
|
||||||
*/
|
*/
|
||||||
bullet?: boolean;
|
bullet?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* ul : MD004, MD005, MD007, MD030, MD032
|
* ul : MD004, MD005, MD007, MD030, MD032
|
||||||
*/
|
*/
|
||||||
ul?: boolean;
|
ul?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* indentation : MD005, MD007, MD027
|
* indentation : MD005, MD007, MD027
|
||||||
*/
|
*/
|
||||||
indentation?: boolean;
|
indentation?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* whitespace : MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039
|
* whitespace : MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039
|
||||||
*/
|
*/
|
||||||
whitespace?: boolean;
|
whitespace?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* hard_tab : MD010
|
* hard_tab : MD010
|
||||||
*/
|
*/
|
||||||
hard_tab?: boolean;
|
hard_tab?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* links : MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054, MD059
|
* links : MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054, MD059
|
||||||
*/
|
*/
|
||||||
links?: boolean;
|
links?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* blank_lines : MD012, MD022, MD031, MD032, MD047
|
* blank_lines : MD012, MD022, MD031, MD032, MD047
|
||||||
*/
|
*/
|
||||||
blank_lines?: boolean;
|
blank_lines?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* line_length : MD013
|
* line_length : MD013
|
||||||
*/
|
*/
|
||||||
line_length?: boolean;
|
line_length?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* code : MD014, MD031, MD038, MD040, MD046, MD048
|
* code : MD014, MD031, MD038, MD040, MD046, MD048
|
||||||
*/
|
*/
|
||||||
code?: boolean;
|
code?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* atx : MD018, MD019
|
* atx : MD018, MD019
|
||||||
*/
|
*/
|
||||||
atx?: boolean;
|
atx?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* spaces : MD018, MD019, MD020, MD021, MD023
|
* spaces : MD018, MD019, MD020, MD021, MD023
|
||||||
*/
|
*/
|
||||||
spaces?: boolean;
|
spaces?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* atx_closed : MD020, MD021
|
* atx_closed : MD020, MD021
|
||||||
*/
|
*/
|
||||||
atx_closed?: boolean;
|
atx_closed?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* blockquote : MD027, MD028
|
* blockquote : MD027, MD028
|
||||||
*/
|
*/
|
||||||
blockquote?: boolean;
|
blockquote?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* ol : MD029, MD030, MD032
|
* ol : MD029, MD030, MD032
|
||||||
*/
|
*/
|
||||||
ol?: boolean;
|
ol?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* html : MD033
|
* html : MD033
|
||||||
*/
|
*/
|
||||||
html?: boolean;
|
html?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* url : MD034
|
* url : MD034
|
||||||
*/
|
*/
|
||||||
url?: boolean;
|
url?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* hr : MD035
|
* hr : MD035
|
||||||
*/
|
*/
|
||||||
hr?: boolean;
|
hr?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* emphasis : MD036, MD037, MD049, MD050
|
* emphasis : MD036, MD037, MD049, MD050
|
||||||
*/
|
*/
|
||||||
emphasis?: boolean;
|
emphasis?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* language : MD040
|
* language : MD040
|
||||||
*/
|
*/
|
||||||
language?: boolean;
|
language?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* spelling : MD044
|
* spelling : MD044
|
||||||
*/
|
*/
|
||||||
spelling?: boolean;
|
spelling?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* accessibility : MD045, MD059
|
* accessibility : MD045, MD059
|
||||||
*/
|
*/
|
||||||
accessibility?: boolean;
|
accessibility?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* images : MD045, MD052, MD053, MD054
|
* images : MD045, MD052, MD053, MD054
|
||||||
*/
|
*/
|
||||||
images?: boolean;
|
images?: boolean | "error";
|
||||||
/**
|
/**
|
||||||
* table : MD055, MD056, MD058, MD060
|
* table : MD055, MD056, MD058, MD060
|
||||||
*/
|
*/
|
||||||
table?: boolean;
|
table?: boolean | "error";
|
||||||
}
|
}
|
||||||
|
|
|
@ -652,7 +652,10 @@ for (const rule of rules) {
|
||||||
for (const [ tag, tagTags ] of Object.entries(tags)) {
|
for (const [ tag, tagTags ] of Object.entries(tags)) {
|
||||||
const scheme = {
|
const scheme = {
|
||||||
"description": `${tag} : ${tagTags.join(", ")}`,
|
"description": `${tag} : ${tagTags.join(", ")}`,
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{ "type": "boolean" },
|
||||||
|
{ "enum": [ "error" ] }
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
};
|
};
|
||||||
schema.properties[tag] = scheme;
|
schema.properties[tag] = scheme;
|
||||||
|
|
|
@ -2896,122 +2896,338 @@
|
||||||
},
|
},
|
||||||
"headings": {
|
"headings": {
|
||||||
"description": "headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
|
"description": "headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"bullet": {
|
"bullet": {
|
||||||
"description": "bullet : MD004, MD005, MD007, MD032",
|
"description": "bullet : MD004, MD005, MD007, MD032",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"ul": {
|
"ul": {
|
||||||
"description": "ul : MD004, MD005, MD007, MD030, MD032",
|
"description": "ul : MD004, MD005, MD007, MD030, MD032",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"indentation": {
|
"indentation": {
|
||||||
"description": "indentation : MD005, MD007, MD027",
|
"description": "indentation : MD005, MD007, MD027",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"whitespace": {
|
"whitespace": {
|
||||||
"description": "whitespace : MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039",
|
"description": "whitespace : MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"hard_tab": {
|
"hard_tab": {
|
||||||
"description": "hard_tab : MD010",
|
"description": "hard_tab : MD010",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"links": {
|
"links": {
|
||||||
"description": "links : MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054, MD059",
|
"description": "links : MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054, MD059",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"blank_lines": {
|
"blank_lines": {
|
||||||
"description": "blank_lines : MD012, MD022, MD031, MD032, MD047",
|
"description": "blank_lines : MD012, MD022, MD031, MD032, MD047",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"line_length": {
|
"line_length": {
|
||||||
"description": "line_length : MD013",
|
"description": "line_length : MD013",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"code": {
|
"code": {
|
||||||
"description": "code : MD014, MD031, MD038, MD040, MD046, MD048",
|
"description": "code : MD014, MD031, MD038, MD040, MD046, MD048",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"atx": {
|
"atx": {
|
||||||
"description": "atx : MD018, MD019",
|
"description": "atx : MD018, MD019",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"spaces": {
|
"spaces": {
|
||||||
"description": "spaces : MD018, MD019, MD020, MD021, MD023",
|
"description": "spaces : MD018, MD019, MD020, MD021, MD023",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"atx_closed": {
|
"atx_closed": {
|
||||||
"description": "atx_closed : MD020, MD021",
|
"description": "atx_closed : MD020, MD021",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"blockquote": {
|
"blockquote": {
|
||||||
"description": "blockquote : MD027, MD028",
|
"description": "blockquote : MD027, MD028",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"ol": {
|
"ol": {
|
||||||
"description": "ol : MD029, MD030, MD032",
|
"description": "ol : MD029, MD030, MD032",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"html": {
|
"html": {
|
||||||
"description": "html : MD033",
|
"description": "html : MD033",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"description": "url : MD034",
|
"description": "url : MD034",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"hr": {
|
"hr": {
|
||||||
"description": "hr : MD035",
|
"description": "hr : MD035",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"emphasis": {
|
"emphasis": {
|
||||||
"description": "emphasis : MD036, MD037, MD049, MD050",
|
"description": "emphasis : MD036, MD037, MD049, MD050",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"language": {
|
"language": {
|
||||||
"description": "language : MD040",
|
"description": "language : MD040",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"spelling": {
|
"spelling": {
|
||||||
"description": "spelling : MD044",
|
"description": "spelling : MD044",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"accessibility": {
|
"accessibility": {
|
||||||
"description": "accessibility : MD045, MD059",
|
"description": "accessibility : MD045, MD059",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"images": {
|
"images": {
|
||||||
"description": "images : MD045, MD052, MD053, MD054",
|
"description": "images : MD045, MD052, MD053, MD054",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"table": {
|
"table": {
|
||||||
"description": "table : MD055, MD056, MD058, MD060",
|
"description": "table : MD055, MD056, MD058, MD060",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -2896,122 +2896,338 @@
|
||||||
},
|
},
|
||||||
"headings": {
|
"headings": {
|
||||||
"description": "headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
|
"description": "headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"bullet": {
|
"bullet": {
|
||||||
"description": "bullet : MD004, MD005, MD007, MD032",
|
"description": "bullet : MD004, MD005, MD007, MD032",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"ul": {
|
"ul": {
|
||||||
"description": "ul : MD004, MD005, MD007, MD030, MD032",
|
"description": "ul : MD004, MD005, MD007, MD030, MD032",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"indentation": {
|
"indentation": {
|
||||||
"description": "indentation : MD005, MD007, MD027",
|
"description": "indentation : MD005, MD007, MD027",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"whitespace": {
|
"whitespace": {
|
||||||
"description": "whitespace : MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039",
|
"description": "whitespace : MD009, MD010, MD012, MD027, MD028, MD030, MD037, MD038, MD039",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"hard_tab": {
|
"hard_tab": {
|
||||||
"description": "hard_tab : MD010",
|
"description": "hard_tab : MD010",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"links": {
|
"links": {
|
||||||
"description": "links : MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054, MD059",
|
"description": "links : MD011, MD034, MD039, MD042, MD051, MD052, MD053, MD054, MD059",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"blank_lines": {
|
"blank_lines": {
|
||||||
"description": "blank_lines : MD012, MD022, MD031, MD032, MD047",
|
"description": "blank_lines : MD012, MD022, MD031, MD032, MD047",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"line_length": {
|
"line_length": {
|
||||||
"description": "line_length : MD013",
|
"description": "line_length : MD013",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"code": {
|
"code": {
|
||||||
"description": "code : MD014, MD031, MD038, MD040, MD046, MD048",
|
"description": "code : MD014, MD031, MD038, MD040, MD046, MD048",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"atx": {
|
"atx": {
|
||||||
"description": "atx : MD018, MD019",
|
"description": "atx : MD018, MD019",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"spaces": {
|
"spaces": {
|
||||||
"description": "spaces : MD018, MD019, MD020, MD021, MD023",
|
"description": "spaces : MD018, MD019, MD020, MD021, MD023",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"atx_closed": {
|
"atx_closed": {
|
||||||
"description": "atx_closed : MD020, MD021",
|
"description": "atx_closed : MD020, MD021",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"blockquote": {
|
"blockquote": {
|
||||||
"description": "blockquote : MD027, MD028",
|
"description": "blockquote : MD027, MD028",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"ol": {
|
"ol": {
|
||||||
"description": "ol : MD029, MD030, MD032",
|
"description": "ol : MD029, MD030, MD032",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"html": {
|
"html": {
|
||||||
"description": "html : MD033",
|
"description": "html : MD033",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"url": {
|
"url": {
|
||||||
"description": "url : MD034",
|
"description": "url : MD034",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"hr": {
|
"hr": {
|
||||||
"description": "hr : MD035",
|
"description": "hr : MD035",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"emphasis": {
|
"emphasis": {
|
||||||
"description": "emphasis : MD036, MD037, MD049, MD050",
|
"description": "emphasis : MD036, MD037, MD049, MD050",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"language": {
|
"language": {
|
||||||
"description": "language : MD040",
|
"description": "language : MD040",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"spelling": {
|
"spelling": {
|
||||||
"description": "spelling : MD044",
|
"description": "spelling : MD044",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"accessibility": {
|
"accessibility": {
|
||||||
"description": "accessibility : MD045, MD059",
|
"description": "accessibility : MD045, MD059",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"images": {
|
"images": {
|
||||||
"description": "images : MD045, MD052, MD053, MD054",
|
"description": "images : MD045, MD052, MD053, MD054",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"table": {
|
"table": {
|
||||||
"description": "table : MD055, MD056, MD058, MD060",
|
"description": "table : MD055, MD056, MD058, MD060",
|
||||||
"type": "boolean",
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"enum": [
|
||||||
|
"error"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"default": true
|
"default": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -159,7 +159,7 @@ function normalizeLintResults(results) {
|
||||||
Object.entries(results).map(
|
Object.entries(results).map(
|
||||||
([ source, errors ]) => [
|
([ source, errors ]) => [
|
||||||
source, errors.map(
|
source, errors.map(
|
||||||
({ lineNumber, ruleNames }) => `${ruleNames[0]} ${lineNumber}`
|
({ lineNumber, ruleNames, severity }) => `${ruleNames[0]} ${lineNumber} ${severity}`
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
@ -167,257 +167,250 @@ function normalizeLintResults(results) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a Configuration default value test implementation.
|
* Gets a Configuration value test implementation.
|
||||||
*
|
*
|
||||||
* @param {(config: Configuration) => void} setDefault Sets the value of the Configuration default value.
|
* @param {Configuration} config Configuration object.
|
||||||
* @param {NormalizedLintResults} expected Expected result.
|
* @param {NormalizedLintResults} expected Expected result.
|
||||||
* @returns {ImplementationFn} Test implementation.
|
* @returns {ImplementationFn} Test implementation.
|
||||||
*/
|
*/
|
||||||
function getConfigDefaultTestImplementation(setDefault, expected) {
|
function getConfigTestImplementation(config, expected) {
|
||||||
return async(t) => {
|
return async(t) => {
|
||||||
t.plan(1);
|
t.plan(1);
|
||||||
const options = {
|
const options = {
|
||||||
|
config,
|
||||||
"files": [
|
"files": [
|
||||||
"./test/atx_heading_spacing.md",
|
"./test/atx_heading_spacing.md",
|
||||||
"./test/first_heading_bad_atx.md"
|
"./test/first_heading_bad_atx.md"
|
||||||
],
|
],
|
||||||
"config": {},
|
|
||||||
"noInlineConfig": true
|
"noInlineConfig": true
|
||||||
};
|
};
|
||||||
setDefault(options.config);
|
|
||||||
const actual = await lintPromise(options);
|
const actual = await lintPromise(options);
|
||||||
t.deepEqual(normalizeLintResults(actual), expected);
|
t.deepEqual(normalizeLintResults(actual), expected);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const configDefaultTestExpectedEnabled = {
|
const configTestExpected = {
|
||||||
"./test/atx_heading_spacing.md": [
|
|
||||||
"MD018 1",
|
|
||||||
"MD019 3",
|
|
||||||
"MD019 5",
|
|
||||||
"MD041 1"
|
|
||||||
],
|
|
||||||
"./test/first_heading_bad_atx.md": [
|
|
||||||
"MD041 1"
|
|
||||||
]
|
|
||||||
};
|
|
||||||
|
|
||||||
const configDefaultTestExpectedDisabled = {
|
|
||||||
"./test/atx_heading_spacing.md": [],
|
"./test/atx_heading_spacing.md": [],
|
||||||
"./test/first_heading_bad_atx.md": []
|
"./test/first_heading_bad_atx.md": []
|
||||||
};
|
};
|
||||||
|
const configTestExpected1 = {
|
||||||
test("defaultTrue", getConfigDefaultTestImplementation(
|
"./test/atx_heading_spacing.md": [
|
||||||
(config) => (config.default = true),
|
"MD018 1 error"
|
||||||
configDefaultTestExpectedEnabled
|
|
||||||
));
|
|
||||||
|
|
||||||
test("defaultFalse", getConfigDefaultTestImplementation(
|
|
||||||
(config) => (config.default = false),
|
|
||||||
configDefaultTestExpectedDisabled
|
|
||||||
));
|
|
||||||
|
|
||||||
test("defaultError", getConfigDefaultTestImplementation(
|
|
||||||
(config) => (config.default = "error"),
|
|
||||||
configDefaultTestExpectedEnabled
|
|
||||||
));
|
|
||||||
|
|
||||||
test("defaultWarning", getConfigDefaultTestImplementation(
|
|
||||||
// @ts-ignore
|
|
||||||
(config) => (config.default = "warning"),
|
|
||||||
configDefaultTestExpectedEnabled
|
|
||||||
));
|
|
||||||
|
|
||||||
test("defaultOff", getConfigDefaultTestImplementation(
|
|
||||||
// @ts-ignore
|
|
||||||
(config) => (config.default = "off"),
|
|
||||||
configDefaultTestExpectedEnabled
|
|
||||||
));
|
|
||||||
|
|
||||||
test("defaultUnset", getConfigDefaultTestImplementation(
|
|
||||||
() => {},
|
|
||||||
configDefaultTestExpectedEnabled
|
|
||||||
));
|
|
||||||
|
|
||||||
test("disableRules", (t) => new Promise((resolve) => {
|
|
||||||
t.plan(2);
|
|
||||||
const options = {
|
|
||||||
"files": [
|
|
||||||
"./test/atx_heading_spacing.md",
|
|
||||||
"./test/no_first_line_heading.md"
|
|
||||||
],
|
],
|
||||||
"config": {
|
"./test/first_heading_bad_atx.md": []
|
||||||
|
};
|
||||||
|
const configTestExpected11 = {
|
||||||
|
"./test/atx_heading_spacing.md": [
|
||||||
|
"MD041 1 error"
|
||||||
|
],
|
||||||
|
"./test/first_heading_bad_atx.md": [
|
||||||
|
"MD041 1 error"
|
||||||
|
]
|
||||||
|
};
|
||||||
|
const configTestExpected135 = {
|
||||||
|
"./test/atx_heading_spacing.md": [
|
||||||
|
"MD018 1 error",
|
||||||
|
"MD019 3 error",
|
||||||
|
"MD019 5 error"
|
||||||
|
],
|
||||||
|
"./test/first_heading_bad_atx.md": []
|
||||||
|
};
|
||||||
|
const configTestExpected3511 = {
|
||||||
|
"./test/atx_heading_spacing.md": [
|
||||||
|
"MD019 3 error",
|
||||||
|
"MD019 5 error",
|
||||||
|
"MD041 1 error"
|
||||||
|
],
|
||||||
|
"./test/first_heading_bad_atx.md": [
|
||||||
|
"MD041 1 error"
|
||||||
|
]
|
||||||
|
};
|
||||||
|
const configTestExpected13511 = {
|
||||||
|
"./test/atx_heading_spacing.md": [
|
||||||
|
"MD018 1 error",
|
||||||
|
"MD019 3 error",
|
||||||
|
"MD019 5 error",
|
||||||
|
"MD041 1 error"
|
||||||
|
],
|
||||||
|
"./test/first_heading_bad_atx.md": [
|
||||||
|
"MD041 1 error"
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
test("defaultUnset", getConfigTestImplementation(
|
||||||
|
{},
|
||||||
|
configTestExpected13511
|
||||||
|
));
|
||||||
|
|
||||||
|
test("defaultTrue", getConfigTestImplementation(
|
||||||
|
{ "default": true },
|
||||||
|
configTestExpected13511
|
||||||
|
));
|
||||||
|
|
||||||
|
test("defaultFalse", getConfigTestImplementation(
|
||||||
|
{ "default": false },
|
||||||
|
configTestExpected
|
||||||
|
));
|
||||||
|
|
||||||
|
test("defaultTruthy", getConfigTestImplementation(
|
||||||
|
// @ts-ignore
|
||||||
|
{ "default": 1 },
|
||||||
|
configTestExpected13511
|
||||||
|
));
|
||||||
|
|
||||||
|
test("defaultFalsy", getConfigTestImplementation(
|
||||||
|
// @ts-ignore
|
||||||
|
{ "default": 0 },
|
||||||
|
configTestExpected
|
||||||
|
));
|
||||||
|
|
||||||
|
test("defaultError", getConfigTestImplementation(
|
||||||
|
{ "default": "error" },
|
||||||
|
configTestExpected13511
|
||||||
|
));
|
||||||
|
|
||||||
|
test("defaultWarning", getConfigTestImplementation(
|
||||||
|
// @ts-ignore
|
||||||
|
{ "default": "warning" },
|
||||||
|
configTestExpected13511
|
||||||
|
));
|
||||||
|
|
||||||
|
test("defaultOff", getConfigTestImplementation(
|
||||||
|
// @ts-ignore
|
||||||
|
{ "default": "off" },
|
||||||
|
configTestExpected13511
|
||||||
|
));
|
||||||
|
|
||||||
|
test("disableRules", getConfigTestImplementation(
|
||||||
|
{
|
||||||
"default": true,
|
"default": true,
|
||||||
"MD019": false,
|
"MD019": false,
|
||||||
"first-line-h1": false
|
"first-line-h1": false,
|
||||||
|
"extra": false
|
||||||
},
|
},
|
||||||
"resultVersion": 0
|
configTestExpected1
|
||||||
};
|
));
|
||||||
lintAsync(options, function callback(err, actualResult) {
|
|
||||||
t.falsy(err);
|
|
||||||
const expectedResult = {
|
|
||||||
"./test/atx_heading_spacing.md": {
|
|
||||||
"MD018": [ 1 ]
|
|
||||||
},
|
|
||||||
"./test/no_first_line_heading.md": {}
|
|
||||||
};
|
|
||||||
// @ts-ignore
|
|
||||||
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}));
|
|
||||||
|
|
||||||
test("enableRules", (t) => new Promise((resolve) => {
|
test("disableRulesFalsy", getConfigTestImplementation(
|
||||||
t.plan(2);
|
{
|
||||||
const options = {
|
"default": true,
|
||||||
"files": [
|
// @ts-ignore
|
||||||
"./test/atx_heading_spacing.md",
|
"MD019": 0,
|
||||||
"./test/first_heading_bad_atx.md"
|
// @ts-ignore
|
||||||
],
|
"first-line-h1": 0,
|
||||||
"config": {
|
"extra": 0
|
||||||
|
},
|
||||||
|
configTestExpected1
|
||||||
|
));
|
||||||
|
|
||||||
|
test("enableRules", getConfigTestImplementation(
|
||||||
|
{
|
||||||
"MD041": true,
|
"MD041": true,
|
||||||
"default": false,
|
"default": false,
|
||||||
"no-multiple-space-atx": true
|
"no-multiple-space-atx": true,
|
||||||
|
"extra": true
|
||||||
},
|
},
|
||||||
"noInlineConfig": true,
|
configTestExpected3511
|
||||||
"resultVersion": 0
|
));
|
||||||
};
|
|
||||||
lintAsync(options, function callback(err, actualResult) {
|
|
||||||
t.falsy(err);
|
|
||||||
const expectedResult = {
|
|
||||||
"./test/atx_heading_spacing.md": {
|
|
||||||
"MD019": [ 3, 5 ],
|
|
||||||
"MD041": [ 1 ]
|
|
||||||
},
|
|
||||||
"./test/first_heading_bad_atx.md": {
|
|
||||||
"MD041": [ 1 ]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// @ts-ignore
|
|
||||||
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}));
|
|
||||||
|
|
||||||
test("enableRulesMixedCase", (t) => new Promise((resolve) => {
|
test("enableRulesMixedCase", getConfigTestImplementation(
|
||||||
t.plan(2);
|
{
|
||||||
const options = {
|
|
||||||
"files": [
|
|
||||||
"./test/atx_heading_spacing.md",
|
|
||||||
"./test/first_heading_bad_atx.md"
|
|
||||||
],
|
|
||||||
"config": {
|
|
||||||
"Md041": true,
|
"Md041": true,
|
||||||
"DeFaUlT": false,
|
"DeFaUlT": false,
|
||||||
"nO-mUlTiPlE-sPaCe-AtX": true
|
"nO-mUlTiPlE-sPaCe-AtX": true,
|
||||||
|
"ExTrA": true
|
||||||
},
|
},
|
||||||
"noInlineConfig": true,
|
configTestExpected3511
|
||||||
"resultVersion": 0
|
));
|
||||||
};
|
|
||||||
lintAsync(options, function callback(err, actualResult) {
|
|
||||||
t.falsy(err);
|
|
||||||
const expectedResult = {
|
|
||||||
"./test/atx_heading_spacing.md": {
|
|
||||||
"MD019": [ 3, 5 ],
|
|
||||||
"MD041": [ 1 ]
|
|
||||||
},
|
|
||||||
"./test/first_heading_bad_atx.md": {
|
|
||||||
"MD041": [ 1 ]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// @ts-ignore
|
|
||||||
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}));
|
|
||||||
|
|
||||||
test("disableTag", (t) => new Promise((resolve) => {
|
test("enableRulesTruthy", getConfigTestImplementation(
|
||||||
t.plan(2);
|
{
|
||||||
const options = {
|
// @ts-ignore
|
||||||
"files": [
|
"MD041": 1,
|
||||||
"./test/atx_heading_spacing.md",
|
"default": false,
|
||||||
"./test/first_heading_bad_atx.md"
|
// @ts-ignore
|
||||||
],
|
"no-multiple-space-atx": 1,
|
||||||
"config": {
|
"extra": 1
|
||||||
|
},
|
||||||
|
configTestExpected3511
|
||||||
|
));
|
||||||
|
|
||||||
|
test("enableRulesString", getConfigTestImplementation(
|
||||||
|
{
|
||||||
|
"MD041": "error",
|
||||||
|
"default": false,
|
||||||
|
"no-multiple-space-atx": "error",
|
||||||
|
"extra": "error"
|
||||||
|
},
|
||||||
|
configTestExpected3511
|
||||||
|
));
|
||||||
|
|
||||||
|
test("enableRulesEmptyObject", getConfigTestImplementation(
|
||||||
|
{
|
||||||
|
"MD041": {},
|
||||||
|
"default": false,
|
||||||
|
// @ts-ignore
|
||||||
|
"no-multiple-space-atx": {},
|
||||||
|
"extra": {}
|
||||||
|
},
|
||||||
|
configTestExpected3511
|
||||||
|
));
|
||||||
|
|
||||||
|
test("disableTag", getConfigTestImplementation(
|
||||||
|
{
|
||||||
"default": true,
|
"default": true,
|
||||||
"spaces": false
|
"spaces": false,
|
||||||
|
"extra": false
|
||||||
},
|
},
|
||||||
"noInlineConfig": true,
|
configTestExpected11
|
||||||
"resultVersion": 0
|
));
|
||||||
};
|
|
||||||
lintAsync(options, function callback(err, actualResult) {
|
|
||||||
t.falsy(err);
|
|
||||||
const expectedResult = {
|
|
||||||
"./test/atx_heading_spacing.md": {
|
|
||||||
"MD041": [ 1 ]
|
|
||||||
},
|
|
||||||
"./test/first_heading_bad_atx.md": {
|
|
||||||
"MD041": [ 1 ]
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// @ts-ignore
|
|
||||||
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}));
|
|
||||||
|
|
||||||
test("enableTag", (t) => new Promise((resolve) => {
|
test("disableTagFalsy", getConfigTestImplementation(
|
||||||
t.plan(2);
|
{
|
||||||
const options = {
|
"default": true,
|
||||||
"files": [
|
// @ts-ignore
|
||||||
"./test/atx_heading_spacing.md",
|
"spaces": 0,
|
||||||
"./test/first_heading_bad_atx.md"
|
"extra": 0
|
||||||
],
|
},
|
||||||
"config": {
|
configTestExpected11
|
||||||
|
));
|
||||||
|
|
||||||
|
test("enableTag", getConfigTestImplementation(
|
||||||
|
{
|
||||||
"default": false,
|
"default": false,
|
||||||
"spaces": true,
|
"spaces": true,
|
||||||
"notatag": true
|
"extra": true
|
||||||
},
|
},
|
||||||
"resultVersion": 0
|
configTestExpected135
|
||||||
};
|
));
|
||||||
lintAsync(options, function callback(err, actualResult) {
|
|
||||||
t.falsy(err);
|
|
||||||
const expectedResult = {
|
|
||||||
"./test/atx_heading_spacing.md": {
|
|
||||||
"MD018": [ 1 ],
|
|
||||||
"MD019": [ 3, 5 ]
|
|
||||||
},
|
|
||||||
"./test/first_heading_bad_atx.md": {}
|
|
||||||
};
|
|
||||||
// @ts-ignore
|
|
||||||
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
|
||||||
resolve();
|
|
||||||
});
|
|
||||||
}));
|
|
||||||
|
|
||||||
test("enableTagMixedCase", (t) => new Promise((resolve) => {
|
test("enableTagMixedCase", getConfigTestImplementation(
|
||||||
t.plan(2);
|
{
|
||||||
const options = {
|
|
||||||
"files": [
|
|
||||||
"./test/atx_heading_spacing.md",
|
|
||||||
"./test/first_heading_bad_atx.md"
|
|
||||||
],
|
|
||||||
"config": {
|
|
||||||
"DeFaUlT": false,
|
"DeFaUlT": false,
|
||||||
"SpAcEs": true,
|
"SpAcEs": true,
|
||||||
"NoTaTaG": true
|
"ExTrA": true
|
||||||
},
|
},
|
||||||
"resultVersion": 0
|
configTestExpected135
|
||||||
};
|
));
|
||||||
lintAsync(options, function callback(err, actualResult) {
|
|
||||||
t.falsy(err);
|
test("enableTagTruthy", getConfigTestImplementation(
|
||||||
const expectedResult = {
|
{
|
||||||
"./test/atx_heading_spacing.md": {
|
"default": false,
|
||||||
"MD018": [ 1 ],
|
|
||||||
"MD019": [ 3, 5 ]
|
|
||||||
},
|
|
||||||
"./test/first_heading_bad_atx.md": {}
|
|
||||||
};
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
t.deepEqual(actualResult, expectedResult, "Undetected issues.");
|
"spaces": 1,
|
||||||
resolve();
|
"extra": 1
|
||||||
});
|
},
|
||||||
}));
|
configTestExpected135
|
||||||
|
));
|
||||||
|
|
||||||
|
test("enableTagString", getConfigTestImplementation(
|
||||||
|
{
|
||||||
|
"default": false,
|
||||||
|
"spaces": "error",
|
||||||
|
"extra": "error"
|
||||||
|
},
|
||||||
|
configTestExpected135
|
||||||
|
));
|
||||||
|
|
||||||
test("styleFiles", async(t) => {
|
test("styleFiles", async(t) => {
|
||||||
t.plan(8);
|
t.plan(8);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue