mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-18 15:00:13 +01:00
Improve JSON schema (fixes #493).
This commit is contained in:
parent
3a62220e87
commit
245791f79f
2 changed files with 108 additions and 741 deletions
|
|
@ -59,6 +59,8 @@ rules.forEach(function forRule(rule) {
|
||||||
"level": {
|
"level": {
|
||||||
"description": "Heading level",
|
"description": "Heading level",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 1,
|
||||||
|
"maximum": 6,
|
||||||
"default": 1
|
"default": 1
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -101,6 +103,7 @@ rules.forEach(function forRule(rule) {
|
||||||
"indent": {
|
"indent": {
|
||||||
"description": "Spaces for indent",
|
"description": "Spaces for indent",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 1,
|
||||||
"default": 2
|
"default": 2
|
||||||
},
|
},
|
||||||
"start_indented": {
|
"start_indented": {
|
||||||
|
|
@ -112,6 +115,7 @@ rules.forEach(function forRule(rule) {
|
||||||
"description":
|
"description":
|
||||||
"Spaces for first level indent (when start_indented is set)",
|
"Spaces for first level indent (when start_indented is set)",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 1,
|
||||||
"default": 2
|
"default": 2
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -121,6 +125,7 @@ rules.forEach(function forRule(rule) {
|
||||||
"br_spaces": {
|
"br_spaces": {
|
||||||
"description": "Spaces for line break",
|
"description": "Spaces for line break",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 0,
|
||||||
"default": 2
|
"default": 2
|
||||||
},
|
},
|
||||||
"list_item_empty_lines": {
|
"list_item_empty_lines": {
|
||||||
|
|
@ -144,7 +149,8 @@ rules.forEach(function forRule(rule) {
|
||||||
},
|
},
|
||||||
"spaces_per_tab": {
|
"spaces_per_tab": {
|
||||||
"description": "Number of spaces for each hard tab",
|
"description": "Number of spaces for each hard tab",
|
||||||
"type": "number",
|
"type": "integer",
|
||||||
|
"minimum": 0,
|
||||||
"default": 1
|
"default": 1
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -154,6 +160,7 @@ rules.forEach(function forRule(rule) {
|
||||||
"maximum": {
|
"maximum": {
|
||||||
"description": "Consecutive blank lines",
|
"description": "Consecutive blank lines",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 1,
|
||||||
"default": 1
|
"default": 1
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -163,16 +170,19 @@ rules.forEach(function forRule(rule) {
|
||||||
"line_length": {
|
"line_length": {
|
||||||
"description": "Number of characters",
|
"description": "Number of characters",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 1,
|
||||||
"default": 80
|
"default": 80
|
||||||
},
|
},
|
||||||
"heading_line_length": {
|
"heading_line_length": {
|
||||||
"description": "Number of characters for headings",
|
"description": "Number of characters for headings",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 1,
|
||||||
"default": 80
|
"default": 80
|
||||||
},
|
},
|
||||||
"code_block_line_length": {
|
"code_block_line_length": {
|
||||||
"description": "Number of characters for code blocks",
|
"description": "Number of characters for code blocks",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 1,
|
||||||
"default": 80
|
"default": 80
|
||||||
},
|
},
|
||||||
"code_blocks": {
|
"code_blocks": {
|
||||||
|
|
@ -212,11 +222,13 @@ rules.forEach(function forRule(rule) {
|
||||||
"lines_above": {
|
"lines_above": {
|
||||||
"description": "Blank lines above heading",
|
"description": "Blank lines above heading",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 0,
|
||||||
"default": 1
|
"default": 1
|
||||||
},
|
},
|
||||||
"lines_below": {
|
"lines_below": {
|
||||||
"description": "Blank lines below heading",
|
"description": "Blank lines below heading",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 0,
|
||||||
"default": 1
|
"default": 1
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -273,21 +285,25 @@ rules.forEach(function forRule(rule) {
|
||||||
"ul_single": {
|
"ul_single": {
|
||||||
"description": "Spaces for single-line unordered list items",
|
"description": "Spaces for single-line unordered list items",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 1,
|
||||||
"default": 1
|
"default": 1
|
||||||
},
|
},
|
||||||
"ol_single": {
|
"ol_single": {
|
||||||
"description": "Spaces for single-line ordered list items",
|
"description": "Spaces for single-line ordered list items",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 1,
|
||||||
"default": 1
|
"default": 1
|
||||||
},
|
},
|
||||||
"ul_multi": {
|
"ul_multi": {
|
||||||
"description": "Spaces for multi-line unordered list items",
|
"description": "Spaces for multi-line unordered list items",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 1,
|
||||||
"default": 1
|
"default": 1
|
||||||
},
|
},
|
||||||
"ol_multi": {
|
"ol_multi": {
|
||||||
"description": "Spaces for multi-line ordered list items",
|
"description": "Spaces for multi-line ordered list items",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 1,
|
||||||
"default": 1
|
"default": 1
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -328,6 +344,8 @@ rules.forEach(function forRule(rule) {
|
||||||
"level": {
|
"level": {
|
||||||
"description": "Heading level",
|
"description": "Heading level",
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
"minimum": 1,
|
||||||
|
"maximum": 6,
|
||||||
"default": 1
|
"default": 1
|
||||||
},
|
},
|
||||||
"front_matter_title": {
|
"front_matter_title": {
|
||||||
|
|
@ -343,7 +361,8 @@ rules.forEach(function forRule(rule) {
|
||||||
"description": "List of headings",
|
"description": "List of headings",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"pattern": "^(\\*|\\+|#{1,6} .*)$"
|
||||||
},
|
},
|
||||||
"default": []
|
"default": []
|
||||||
},
|
},
|
||||||
|
|
@ -351,7 +370,8 @@ rules.forEach(function forRule(rule) {
|
||||||
"description": "List of headings",
|
"description": "List of headings",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"pattern": "^(\\*|\\+|#{1,6} .*)$"
|
||||||
},
|
},
|
||||||
"default": []
|
"default": []
|
||||||
}
|
}
|
||||||
|
|
@ -439,8 +459,10 @@ rules.forEach(function forRule(rule) {
|
||||||
scheme.type = [ "boolean", "object" ];
|
scheme.type = [ "boolean", "object" ];
|
||||||
scheme.additionalProperties = false;
|
scheme.additionalProperties = false;
|
||||||
}
|
}
|
||||||
rule.names.forEach(function forName(name) {
|
rule.names.forEach(function forName(name, index) {
|
||||||
schema.properties[name] = scheme;
|
schema.properties[name] = (index === 0) ? scheme : {
|
||||||
|
"$ref": `#/properties/${rule.names[0]}`
|
||||||
|
};
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue