diff --git a/README.md b/README.md index 7a0108e4..189381ec 100644 --- a/README.md +++ b/README.md @@ -848,7 +848,6 @@ following projects or one of the tools in the [Related section](#Related): * [Reactable](https://glittershark.github.io/reactable/) ([Search repository](https://github.com/glittershark/reactable/search?q=markdownlint)) * [Sinon.JS](https://sinonjs.org/) ([Search repository](https://github.com/sinonjs/sinon/search?q=markdownlint)) * [TestCafe](https://devexpress.github.io/testcafe/) ([Search repository](https://github.com/DevExpress/testcafe/search?q=markdownlint)) -* [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html) ([Search repository](https://github.com/Microsoft/TypeScript-Handbook/search?q=markdownlint)) * [V8](https://v8.dev/) ([Search repository](https://github.com/v8/v8.dev/search?q=markdownlint)) * [webhint](https://webhint.io/) ([Search repository](https://github.com/webhintio/hint/search?q=markdownlint)) * [webpack](https://webpack.js.org/) ([Search repository](https://github.com/webpack/webpack.js.org/search?q=markdownlint)) diff --git a/package.json b/package.json index d23ce7b1..639b10c9 100644 --- a/package.json +++ b/package.json @@ -21,8 +21,16 @@ "build-example": "npm install --no-save --ignore-scripts grunt grunt-cli gulp through2", "ci": "npm-run-all --continue-on-error --parallel test-cover lint declaration build-config build-demo && git diff --exit-code", "clean-test-repos": "rimraf test-repos", - "clone-test-repos": "mkdir test-repos && cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet", - "clone-test-repos-large": "npm run clone-test-repos && cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet", + "clone-test-repos-dotnet-docs": "cd test-repos && git clone https://github.com/dotnet/docs dotnet-docs --depth 1 --no-tags --quiet", + "clone-test-repos-eslint-eslint": "cd test-repos && git clone https://github.com/eslint/eslint eslint-eslint --depth 1 --no-tags --quiet", + "clone-test-repos-mkdocs-mkdocs": "cd test-repos && git clone https://github.com/mkdocs/mkdocs mkdocs-mkdocs --depth 1 --no-tags --quiet", + "clone-test-repos-mochajs-mocha": "cd test-repos && git clone https://github.com/mochajs/mocha mochajs-mocha --depth 1 --no-tags --quiet", + "clone-test-repos-pi-hole-docs": "cd test-repos && git clone https://github.com/pi-hole/docs pi-hole-docs --depth 1 --no-tags --quiet", + "clone-test-repos-v8-v8-dev": "cd test-repos && git clone https://github.com/v8/v8.dev v8-v8-dev --depth 1 --no-tags --quiet", + "clone-test-repos-webhintio-hint": "cd test-repos && git clone https://github.com/webhintio/hint webhintio-hint --depth 1 --no-tags --quiet", + "clone-test-repos-webpack-webpack-js-org": "cd test-repos && git clone https://github.com/webpack/webpack.js.org webpack-webpack-js-org --depth 1 --no-tags --quiet", + "clone-test-repos": "mkdir test-repos && cd test-repos && npm run clone-test-repos-eslint-eslint && npm run clone-test-repos-mkdocs-mkdocs && npm run clone-test-repos-mochajs-mocha && npm run clone-test-repos-pi-hole-docs && npm run clone-test-repos-webhintio-hint && npm run clone-test-repos-webpack-webpack-js-org", + "clone-test-repos-large": "npm run clone-test-repos && cd test-repos && npm run clone-test-repos-dotnet-docs && npm run clone-test-repos-v8-v8-dev", "declaration": "npm run build-declaration && npm run test-declaration", "example": "cd example && node standalone.js && grunt markdownlint --force && gulp markdownlint", "lint": "eslint --max-warnings 0 .", diff --git a/test/markdownlint-test-repos.js b/test/markdownlint-test-repos.js index ea48a6e9..16781be6 100644 --- a/test/markdownlint-test-repos.js +++ b/test/markdownlint-test-repos.js @@ -54,6 +54,7 @@ function lintTestRepo(t, globPatterns, configPath) { files, config }; + console.log(`${t.title}: Linting ${files.length} files...`); return markdownlintPromise(options).then((results) => { const resultsString = results.toString(); if (resultsString.length > 0) { @@ -79,13 +80,27 @@ test("https://github.com/mkdocs/mkdocs", (t) => { const globPatterns = [ join(rootDir, "README.md"), join(rootDir, "CONTRIBUTING.md"), - join(rootDir, "docs/*"), + join(rootDir, "docs/**/*.md"), "!" + join(rootDir, "docs/CNAME") ]; const configPath = join(rootDir, ".markdownlintrc"); 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") + ]; + 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") ]; @@ -93,6 +108,23 @@ test("https://github.com/pi-hole/docs", (t) => { return lintTestRepo(t, globPatterns, configPath); }); +test("https://github.com/webhintio/hint", (t) => { + const rootDir = "./test-repos/webhintio-hint"; + const globPatterns = [ + join(rootDir, "**/*.md"), + "!" + join(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); +}); + // Optional repositories (very large) const dotnetDocsDir = "./test-repos/dotnet-docs"; @@ -112,3 +144,13 @@ if (existsSync(dotnetDocsDir)) { return lintTestRepo(t, globPatterns, configPath); }); } + +const v8v8DevDir = "./test-repos/v8-v8-dev"; +if (existsSync(v8v8DevDir)) { + test("https://github.com/v8/v8.dev", (t) => { + const rootDir = v8v8DevDir; + const globPatterns = [ join(rootDir, "src/**/*.md") ]; + const configPath = join(rootDir, ".markdownlint.json"); + return lintTestRepo(t, globPatterns, configPath); + }); +}