Update all rules to better handle wrongly-typed configuration parameters.

This commit is contained in:
David Anson 2020-01-25 18:40:39 -08:00
parent 26ad0550ec
commit 3238ed4249
25 changed files with 134 additions and 39 deletions

View file

@ -1589,12 +1589,14 @@ tape("validateConfigSchema", (test) => {
const jsonFileRe = /\.json$/i;
const resultsFileRe = /\.results\.json$/i;
const jsConfigFileRe = /^jsconfig\.json$/i;
const wrongTypesFileRe = /wrong-types-in-config-file.json$/i;
const testDirectory = __dirname;
const testFiles = fs.readdirSync(testDirectory);
testFiles.filter(function filterFile(file) {
return jsonFileRe.test(file) &&
!resultsFileRe.test(file) &&
!jsConfigFileRe.test(file);
!jsConfigFileRe.test(file) &&
!wrongTypesFileRe.test(file);
}).forEach(function forFile(file) {
const data = fs.readFileSync(
path.join(testDirectory, file),

View file

@ -0,0 +1,91 @@
{
"MD002": {
"level": "1"
},
"MD003": {
"style": 0
},
"MD004": {
"style": 0
},
"MD007": {
"indent": "2",
"start_indented": 0
},
"MD009": {
"br_spaces": "2",
"list_item_empty_lines": 0,
"strict": 0
},
"MD010": {
"code_blocks": 1
},
"MD012": {
"maximum": "1"
},
"MD013": {
"code_block_line_length": "80",
"code_blocks": 1,
"headers": 1,
"heading_line_length": "80",
"headings": 1,
"line_length": "80",
"strict": 0,
"tables": 1
},
"MD022": {
"lines_above": "1",
"lines_below": "1"
},
"MD024": {
"allow_different_nesting": 0,
"siblings_only": 0
},
"MD025": {
"front_matter_title": 0,
"level": "1"
},
"MD026": {
"punctuation": 0
},
"MD029": {
"style": 0
},
"MD030": {
"ol_multi": "1",
"ol_single": "1",
"ul_multi": "1",
"ul_single": "1"
},
"MD031": {
"list_items": 1
},
"MD033": {
"allowed_elements": 0
},
"MD035": {
"style": 0
},
"MD036": {
"punctuation": 0
},
"MD041": {
"front_matter_title": 0,
"level": "1"
},
"MD043": {
"headers": 0,
"headings": 0
},
"MD044": {
"code_blocks": 1,
"names": 0
},
"MD046": {
"style": 0
},
"MD048": {
"style": 0
},
"$schema": "../schema/markdownlint-config-schema.json"
}

View file

@ -0,0 +1,3 @@
# Wrong Types in Config File
Long line long line long line long line long line long line long line long line long line long line {MD013}