Update string format output by formatLintResults to match markdownlint-cli2 (and markdownlint-cli).
Some checks are pending
Checkers / linkcheck (push) Waiting to run
Checkers / spellcheck (push) Waiting to run
CI / build (20, macos-latest) (push) Waiting to run
CI / build (20, ubuntu-latest) (push) Waiting to run
CI / build (20, windows-latest) (push) Waiting to run
CI / build (22, macos-latest) (push) Waiting to run
CI / build (22, ubuntu-latest) (push) Waiting to run
CI / build (22, windows-latest) (push) Waiting to run
CI / build (24, macos-latest) (push) Waiting to run
CI / build (24, ubuntu-latest) (push) Waiting to run
CI / build (24, windows-latest) (push) Waiting to run
CI / pnpm (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
TestRepos / build (latest, ubuntu-latest) (push) Waiting to run
UpdateTestRepos / update (push) Waiting to run

This commit is contained in:
David Anson 2025-09-09 21:07:18 -07:00
parent fe0543f4b9
commit 480958352e
8 changed files with 886 additions and 887 deletions

View file

@ -533,13 +533,14 @@ test("hasOverlap", (t) => {
test("formatLintResults", async(t) => {
t.plan(2);
t.deepEqual(formatLintResults(undefined), []);
const lintResults = await lint({ "strings": { "content": "# Heading <br/>" } });
const lintResults = await lint({ "strings": { "content": "# Heading\n<br/>" } });
t.deepEqual(
formatLintResults(lintResults),
[
"content: 1: MD019/no-multiple-space-atx Multiple spaces after hash on atx style heading [Context: \"# Heading <br/>\"]",
"content: 1: MD033/no-inline-html Inline HTML [Element: br]",
"content: 1: MD047/single-trailing-newline Files should end with a single newline character"
"content:1:3 MD019/no-multiple-space-atx Multiple spaces after hash on atx style heading [Context: \"# Heading\"]",
"content:1 MD022/blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: \"# Heading\"]",
"content:2:1 MD033/no-inline-html Inline HTML [Element: br]",
"content:2:5 MD047/single-trailing-newline Files should end with a single newline character"
]
);
});