diff --git a/markdownlint-cli2.js b/markdownlint-cli2.js index 9818f231..d6fb6f8b 100755 --- a/markdownlint-cli2.js +++ b/markdownlint-cli2.js @@ -1005,7 +1005,8 @@ const main = async (params) => { globPatterns, dirToDirInfo, optionsOverride, - Boolean(baseMarkdownlintOptions.gitignore), + // https://github.com/sindresorhus/globby/issues/265 + !params.fs && Boolean(baseMarkdownlintOptions.gitignore), noRequire ); // Output linting status diff --git a/webworker/webworker-test.js b/webworker/webworker-test.js index 8b714248..c84459c9 100644 --- a/webworker/webworker-test.js +++ b/webworker/webworker-test.js @@ -13,6 +13,7 @@ const configNoMd047 = "{\n\"single-trailing-newline\": false\n}"; const files = [ [ "/file.md", md009md010 ], [ "/file-two.md", md047 ], + [ "/.gitignore", "dir*" ], [ "/package.json", `{\n"markdownlint-cli2": {\n"config": ${configNoMd047},\n"customRules": [],\n"markdownItPlugins": []\n}\n}` ], [ "/dir1/file.md", md009md010 ], [ "/dir1/.markdownlint.json", configNoMd010 ], @@ -183,3 +184,18 @@ QUnit.test("workspace", (assert) => { } }); }); + +QUnit.test("workspace, gitignore (unsupported)", (assert) => { + assert.expect(1); + const filesWithGitignore = [ + ...files, + [ "/.markdownlint-cli2.jsonc", `{\n"gitignore":true\n}` ] + ]; + return markdownlintCli2.main({ + "fs": new FsVirtual(filesWithGitignore), + "argv": [ "**/*.md" ], + "optionsOverride": { + "outputFormatters": [ [ outputFormatterLengthIs(assert, 8) ] ] + } + }); +});