Skip to content

Commit

Permalink
chore: Add tests to verify #16038 is fixed (#16538)
Browse files Browse the repository at this point in the history
This test just verifies that we can have `files` pattern that include
two dots in a row like "a..b.js".

Closes #16038
  • Loading branch information
nzakas committed Nov 11, 2022
1 parent 0515628 commit e94a4a9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/fixtures/dots-in-files/a..b.js
@@ -0,0 +1 @@
console.log("Running");
8 changes: 8 additions & 0 deletions tests/fixtures/dots-in-files/eslint.config.js
@@ -0,0 +1,8 @@
module.exports = [
{
files: ["a..b.js"]
},
{
ignores: ["eslint.config.js"]
}
];
15 changes: 15 additions & 0 deletions tests/lib/eslint/flat-eslint.js
Expand Up @@ -794,6 +794,21 @@ describe("FlatESLint", () => {
assert.strictEqual(results[1].suppressedMessages.length, 0);
});

// https://github.com/eslint/eslint/issues/16038
it("should allow files patterns with '..' inside", async () => {
eslint = new FlatESLint({
ignore: false,
cwd: getFixturePath("dots-in-files")
});
const results = await eslint.lintFiles(["."]);

assert.strictEqual(results.length, 2);
assert.strictEqual(results[0].messages.length, 0);
assert.strictEqual(results[0].filePath, getFixturePath("dots-in-files/a..b.js"));
assert.strictEqual(results[0].suppressedMessages.length, 0);
});


// https://github.com/eslint/eslint/issues/16299
it("should only find files in the subdir1 directory when given a directory name", async () => {
eslint = new FlatESLint({
Expand Down

0 comments on commit e94a4a9

Please sign in to comment.