Update MD055/table-pipe-style to support "consistent" and other styles, use micromark positioning, report ranges, add more tests.

This commit is contained in:
David Anson 2023-12-30 18:15:38 -08:00
parent a563c082a5
commit 7d2248d211
28 changed files with 4413 additions and 185 deletions

View file

@ -291,5 +291,11 @@
"shortcut": true,
// Allow URLs as inline links
"url_inline": true
},
// MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md055.md
"MD055": {
// Table pipe style
"style": "consistent"
}
}

View file

@ -262,3 +262,8 @@ MD054:
shortcut: true
# Allow URLs as inline links
url_inline: true
# MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md055.md
MD055:
# Table pipe style
style: "consistent"

View file

@ -529,6 +529,22 @@ for (const rule of rules) {
},
};
break;
case "MD055":
scheme.properties = {
"style": {
"description": "Table pipe style",
"type": "string",
"enum": [
"consistent",
"leading_only",
"trailing_only",
"leading_and_trailing",
"no_leading_or_trailing"
],
"default": "consistent"
}
};
break;
default:
custom = false;
break;

View file

@ -1628,6 +1628,52 @@
},
"additionalProperties": false
},
"MD055": {
"description": "MD055/table-pipe-style : Table pipe style : https://github.com/DavidAnson/markdownlint/blob/v0.32.1/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.32.1/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
},
"headings": {
"description": "headings : MD001, MD003, MD018, MD019, MD020, MD021, MD022, MD023, MD024, MD025, MD026, MD036, MD041, MD043",
"type": "boolean",
@ -1742,6 +1788,11 @@
"description": "images : MD045, MD052, MD053, MD054",
"type": "boolean",
"default": true
},
"table": {
"description": "table : MD055",
"type": "boolean",
"default": true
}
},
"additionalProperties": {