Skip to content

Commit 9e37838

Browse files
committed
Disable new gitignore option when a custom file system implementation is provided due to globby issue (sindresorhus/globby#265).
1 parent a083dec commit 9e37838

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

markdownlint-cli2.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,8 @@ const main = async (params) => {
10051005
globPatterns,
10061006
dirToDirInfo,
10071007
optionsOverride,
1008-
Boolean(baseMarkdownlintOptions.gitignore),
1008+
// https://github.com/sindresorhus/globby/issues/265
1009+
!params.fs && Boolean(baseMarkdownlintOptions.gitignore),
10091010
noRequire
10101011
);
10111012
// Output linting status

webworker/webworker-test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const configNoMd047 = "{\n\"single-trailing-newline\": false\n}";
1313
const files = [
1414
[ "/file.md", md009md010 ],
1515
[ "/file-two.md", md047 ],
16+
[ "/.gitignore", "dir*" ],
1617
[ "/package.json", `{\n"markdownlint-cli2": {\n"config": ${configNoMd047},\n"customRules": [],\n"markdownItPlugins": []\n}\n}` ],
1718
[ "/dir1/file.md", md009md010 ],
1819
[ "/dir1/.markdownlint.json", configNoMd010 ],
@@ -183,3 +184,18 @@ QUnit.test("workspace", (assert) => {
183184
}
184185
});
185186
});
187+
188+
QUnit.test("workspace, gitignore (unsupported)", (assert) => {
189+
assert.expect(1);
190+
const filesWithGitignore = [
191+
...files,
192+
[ "/.markdownlint-cli2.jsonc", `{\n"gitignore":true\n}` ]
193+
];
194+
return markdownlintCli2.main({
195+
"fs": new FsVirtual(filesWithGitignore),
196+
"argv": [ "**/*.md" ],
197+
"optionsOverride": {
198+
"outputFormatters": [ [ outputFormatterLengthIs(assert, 8) ] ]
199+
}
200+
});
201+
});

0 commit comments

Comments
 (0)