Skip to content

Commit e94a4a9

Browse files
authored
chore: Add tests to verify #16038 is fixed (#16538)
This test just verifies that we can have `files` pattern that include two dots in a row like "a..b.js". Closes #16038
1 parent 0515628 commit e94a4a9

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("Running");
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = [
2+
{
3+
files: ["a..b.js"]
4+
},
5+
{
6+
ignores: ["eslint.config.js"]
7+
}
8+
];

tests/lib/eslint/flat-eslint.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,21 @@ describe("FlatESLint", () => {
794794
assert.strictEqual(results[1].suppressedMessages.length, 0);
795795
});
796796

797+
// https://github.com/eslint/eslint/issues/16038
798+
it("should allow files patterns with '..' inside", async () => {
799+
eslint = new FlatESLint({
800+
ignore: false,
801+
cwd: getFixturePath("dots-in-files")
802+
});
803+
const results = await eslint.lintFiles(["."]);
804+
805+
assert.strictEqual(results.length, 2);
806+
assert.strictEqual(results[0].messages.length, 0);
807+
assert.strictEqual(results[0].filePath, getFixturePath("dots-in-files/a..b.js"));
808+
assert.strictEqual(results[0].suppressedMessages.length, 0);
809+
});
810+
811+
797812
// https://github.com/eslint/eslint/issues/16299
798813
it("should only find files in the subdir1 directory when given a directory name", async () => {
799814
eslint = new FlatESLint({

0 commit comments

Comments
 (0)