Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add tests to verify #16038 is fixed #16538

Merged
merged 1 commit into from Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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