Update MD034/no-bare-urls to handle more scenarios, simplify slightly, replace blanket MD034 suppression for https://github.com/mdn/content with specific (valid) issues (refs #607).

This commit is contained in:
David Anson 2022-12-15 14:27:07 -08:00
parent 2e2937081e
commit d352d4ece1
6 changed files with 103 additions and 18 deletions

View file

@ -147,7 +147,11 @@ test("https://github.com/mdn/content", (t) => {
const rootDir = "./test-repos/mdn-content";
const globPatterns = [ join(rootDir, "**/*.md") ];
const configPath = join(rootDir, ".markdownlint-cli2.jsonc");
const ignoreRes = [ /^[^:]+: \d+: MD034\/.*$\r?\n?/gm ];
const ignoreRes = [
/test-repos\/mdn-content\/files\/en-us\/mdn\/community\/pull_requests\/index.md: \d+: MD034\/.*$\r?\n?/gm,
/test-repos\/mdn-content\/files\/en-us\/web\/api\/customelementregistry\/whendefined\/index.md: \d+: MD034\/.*$\r?\n?/gm,
/test-repos\/mdn-content\/files\/en-us\/web\/api\/css_painting_api\/guide\/index.md: \d+: MD034\/.*$\r?\n?/gm
];
return lintTestRepo(t, globPatterns, configPath, ignoreRes);
});