mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Convert markdownlint library to an ECMAScript module, replace markdownlint-micromark with micromark, stop publishing (large) markdownlint-browser.js, see https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c for guidance.
This commit is contained in:
parent
191226f070
commit
1e71f6f44e
140 changed files with 1087 additions and 10428 deletions
100
test/markdownlint-test-repos-small.mjs
Normal file
100
test/markdownlint-test-repos-small.mjs
Normal file
|
@ -0,0 +1,100 @@
|
|||
// @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);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue