Reimplement MD019/no-multiple-space-atx using micromark tokens.

This commit is contained in:
David Anson 2024-06-11 21:37:09 -07:00
parent 3003d244f9
commit 4ff3a27fa2
6 changed files with 174 additions and 89 deletions

View file

@ -186,7 +186,7 @@ test("resultFormattingV1", (t) => new Promise((resolve) => {
"ruleInformation": `${homepage}/blob/v${version}/doc/md019.md`,
"errorDetail": null,
"errorContext": "## Heading 2 {MD019}",
"errorRange": [ 1, 5 ] },
"errorRange": [ 4, 1 ] },
{ "lineNumber": 5,
"ruleName": "MD019",
"ruleAlias": "no-multiple-space-atx",
@ -194,7 +194,7 @@ test("resultFormattingV1", (t) => new Promise((resolve) => {
"ruleInformation": `${homepage}/blob/v${version}/doc/md019.md`,
"errorDetail": null,
"errorContext": "## Heading 3 {MD019}",
"errorRange": [ 1, 6 ] },
"errorRange": [ 4, 2 ] },
{ "lineNumber": 1,
"ruleName": "MD041",
"ruleAlias": "first-line-heading",
@ -287,14 +287,14 @@ test("resultFormattingV2", (t) => new Promise((resolve) => {
"ruleInformation": `${homepage}/blob/v${version}/doc/md019.md`,
"errorDetail": null,
"errorContext": "## Heading 2 {MD019}",
"errorRange": [ 1, 5 ] },
"errorRange": [ 4, 1 ] },
{ "lineNumber": 5,
"ruleNames": [ "MD019", "no-multiple-space-atx" ],
"ruleDescription": "Multiple spaces after hash on atx style heading",
"ruleInformation": `${homepage}/blob/v${version}/doc/md019.md`,
"errorDetail": null,
"errorContext": "## Heading 3 {MD019}",
"errorRange": [ 1, 6 ] },
"errorRange": [ 4, 2 ] },
{ "lineNumber": 1,
"ruleNames": [ "MD041", "first-line-heading", "first-line-h1" ],
"ruleDescription": "First line in a file should be a top-level heading",