mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
100 lines
3.2 KiB
JavaScript
100 lines
3.2 KiB
JavaScript
// @ts-check
|
|
|
|
import path from "node:path";
|
|
const { join } = path.posix;
|
|
import test from "ava";
|
|
import { excludeGlobs, lintTestRepo } from "./markdownlint-test-repos.mjs";
|
|
|
|
// Run markdownlint the same way the corresponding repositories do
|
|
|
|
test("https://github.com/apache/airflow", (t) => {
|
|
const rootDir = "./test-repos/apache-airflow";
|
|
const globPatterns = [ join(rootDir, "**/*.{md,mdown,markdown}") ];
|
|
const configPath = join(rootDir, ".markdownlint.yml");
|
|
return lintTestRepo(t, globPatterns, configPath);
|
|
});
|
|
|
|
test("https://github.com/electron/electron", (t) => {
|
|
const rootDir = "./test-repos/electron-electron";
|
|
const globPatterns = [
|
|
join(rootDir, "*.md"),
|
|
join(rootDir, "docs/**/*.md")
|
|
];
|
|
const configPath = join(rootDir, ".markdownlint-cli2.jsonc");
|
|
return lintTestRepo(t, globPatterns, configPath);
|
|
});
|
|
|
|
test("https://github.com/eslint/eslint", (t) => {
|
|
const rootDir = "./test-repos/eslint-eslint";
|
|
const globPatterns = [ join(rootDir, "docs/**/*.md") ];
|
|
const configPath = join(rootDir, ".markdownlint.yml");
|
|
return lintTestRepo(t, globPatterns, configPath);
|
|
});
|
|
|
|
test("https://github.com/mkdocs/mkdocs", (t) => {
|
|
const rootDir = "./test-repos/mkdocs-mkdocs";
|
|
const globPatterns = [
|
|
join(rootDir, "README.md"),
|
|
join(rootDir, "CONTRIBUTING.md"),
|
|
join(rootDir, "docs"),
|
|
...excludeGlobs(
|
|
rootDir,
|
|
"docs/CNAME",
|
|
"docs/**/*.css",
|
|
"docs/**/*.png",
|
|
"docs/**/*.py",
|
|
"docs/**/*.svg"
|
|
)
|
|
];
|
|
const configPath = join(rootDir, ".markdownlint.yaml");
|
|
return lintTestRepo(t, globPatterns, configPath);
|
|
});
|
|
|
|
test("https://github.com/mochajs/mocha", (t) => {
|
|
const rootDir = "./test-repos/mochajs-mocha";
|
|
const globPatterns = [
|
|
join(rootDir, "*.md"),
|
|
join(rootDir, "docs/**/*.md"),
|
|
join(rootDir, ".github/*.md"),
|
|
join(rootDir, "lib/**/*.md"),
|
|
join(rootDir, "test/**/*.md"),
|
|
join(rootDir, "example/**/*.md"),
|
|
...excludeGlobs(
|
|
rootDir,
|
|
"CHANGELOG.md"
|
|
)
|
|
];
|
|
const configPath = join(rootDir, ".markdownlint.json");
|
|
return lintTestRepo(t, globPatterns, configPath);
|
|
});
|
|
|
|
test("https://github.com/pi-hole/docs", (t) => {
|
|
const rootDir = "./test-repos/pi-hole-docs";
|
|
const globPatterns = [ join(rootDir, "**/*.md") ];
|
|
const configPath = join(rootDir, ".markdownlint.json");
|
|
return lintTestRepo(t, globPatterns, configPath);
|
|
});
|
|
|
|
test("https://github.com/v8/v8.dev", (t) => {
|
|
const rootDir = "./test-repos/v8-v8-dev";
|
|
const globPatterns = [ join(rootDir, "src/**/*.md") ];
|
|
const configPath = join(rootDir, ".markdownlint.json");
|
|
return lintTestRepo(t, globPatterns, configPath);
|
|
});
|
|
|
|
test("https://github.com/webhintio/hint", (t) => {
|
|
const rootDir = "./test-repos/webhintio-hint";
|
|
const globPatterns = [
|
|
join(rootDir, "**/*.md"),
|
|
...excludeGlobs(rootDir, "**/CHANGELOG.md")
|
|
];
|
|
const configPath = join(rootDir, ".markdownlintrc");
|
|
return lintTestRepo(t, globPatterns, configPath);
|
|
});
|
|
|
|
test("https://github.com/webpack/webpack.js.org", (t) => {
|
|
const rootDir = "./test-repos/webpack-webpack-js-org";
|
|
const globPatterns = [ join(rootDir, "**/*.md") ];
|
|
const configPath = join(rootDir, ".markdownlint.json");
|
|
return lintTestRepo(t, globPatterns, configPath);
|
|
});
|