Reimplement MD014/commands-show-output using micromark tokens.

This commit is contained in:
David Anson 2024-06-22 15:12:37 -07:00
parent ec957029a5
commit 347302169c
6 changed files with 132 additions and 80 deletions

View file

@ -74,3 +74,7 @@ All commands with no output:
$ mkdir test {MD014}
$ cd test {MD014}
$ ls test {MD014}
Space-prefixed command with no output:
$ ls example {MD014}

View file

@ -40,4 +40,8 @@ text
$ npm install --save multimatch {MD014}
```
text
Space-prefixed command with no output:
```sh
$ ls example {MD014}
```

View file

@ -10083,6 +10083,25 @@ Generated by [AVA](https://avajs.dev).
'commands-show-output',
],
},
{
errorContext: ' $ ls example {MD014}',
errorDetail: null,
errorRange: [
6,
2,
],
fixInfo: {
deleteCount: 2,
editColumn: 6,
},
lineNumber: 80,
ruleDescription: 'Dollar signs used before commands without showing output',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md',
ruleNames: [
'MD014',
'commands-show-output',
],
},
{
errorContext: null,
errorDetail: 'Expected: indented; Actual: fenced',
@ -10173,6 +10192,10 @@ Generated by [AVA](https://avajs.dev).
mkdir test {MD014}␊
cd test {MD014}␊
ls test {MD014}␊
Space-prefixed command with no output:␊
ls example {MD014}␊
`,
}
@ -10344,6 +10367,25 @@ Generated by [AVA](https://avajs.dev).
'commands-show-output',
],
},
{
errorContext: ' $ ls example {MD014}',
errorDetail: null,
errorRange: [
2,
2,
],
fixInfo: {
deleteCount: 2,
editColumn: 2,
},
lineNumber: 46,
ruleDescription: 'Dollar signs used before commands without showing output',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md014.md',
ruleNames: [
'MD014',
'commands-show-output',
],
},
],
fixed: `# Code Block Dollar Fence␊
@ -10387,7 +10429,11 @@ Generated by [AVA](https://avajs.dev).
npm install --save multimatch {MD014}␊
\`\`\`␊
text␊
Space-prefixed command with no output:␊
\`\`\`sh␊
ls example {MD014}␊
\`\`\`␊
`,
}