mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 14:00:13 +01:00
Add "enabled" and "severity"/"warning" to rule in Configuration object, add corresponding documentation and tests, update demo web app (fixes #254)”.
This commit is contained in:
parent
c6f248321e
commit
607be34b5d
20 changed files with 3792 additions and 867 deletions
|
|
@ -16,7 +16,7 @@ for (const rule in configSchema.properties) {
|
|||
const subproperties = Object.fromEntries(
|
||||
Object.entries(
|
||||
properties.oneOf?.at(-1).properties || []
|
||||
).filter(([ key ]) => key !== "severity")
|
||||
).filter(([ key ]) => ((key !== "enabled") && (key !== "severity")))
|
||||
);
|
||||
if (Object.keys(subproperties).length > 0) {
|
||||
/** @type {Object<string, any>} */
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ const schema = {
|
|||
"description": "Default state for all rules",
|
||||
"oneOf": [
|
||||
{ "type": "boolean" },
|
||||
{ "enum": [ "error" ] }
|
||||
{ "enum": [ "error", "warning" ] }
|
||||
],
|
||||
"default": true
|
||||
},
|
||||
|
|
@ -66,7 +66,7 @@ for (const rule of rules) {
|
|||
`${rule.names.join("/")} : ${rule.description} : ${rule.information}`,
|
||||
"oneOf": [
|
||||
{ "type": "boolean" },
|
||||
{ "enum": [ "error" ] }
|
||||
{ "enum": [ "error", "warning" ] }
|
||||
],
|
||||
"default": true
|
||||
};
|
||||
|
|
@ -74,12 +74,15 @@ for (const rule of rules) {
|
|||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"description": "Whether to enable the rule",
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"severity": {
|
||||
"description": "Rule severity",
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"error"
|
||||
],
|
||||
"enum": [ "error", "warning" ],
|
||||
"default": "error"
|
||||
}
|
||||
}
|
||||
|
|
@ -656,7 +659,7 @@ for (const [ tag, tagTags ] of Object.entries(tags)) {
|
|||
"description": `${tag} : ${tagTags.join(", ")}`,
|
||||
"oneOf": [
|
||||
{ "type": "boolean" },
|
||||
{ "enum": [ "error" ] }
|
||||
{ "enum": [ "error", "warning" ] }
|
||||
],
|
||||
"default": true
|
||||
};
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue