8000 fix: treat `*` as a universal pattern (#18586) · eslint/eslint@6880286 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6880286

Browse files
authored
fix: treat * as a universal pattern (#18586)
Fixes #18550
1 parent 8127127 commit 6880286

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"dependencies": {
6969
"@eslint-community/eslint-utils": "^4.2.0",
7070
"@eslint-community/regexpp": "^4.6.1",
71-
"@eslint/config-array": "^0.15.1",
71+
"@eslint/config-array": "^0.16.0",
7272
"@eslint/eslintrc": "^3.1.0",
7373
"@eslint/js": "9.4.0",
7474
"@humanwhocodes/module-importer": "^1.0.1",

tests/lib/eslint/eslint.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff C400 line numberDiff line change
@@ -1305,6 +1305,22 @@ describe("ESLint", () => {
13051305
assert.strictEqual(results[0].suppressedMessages.length, 0);
13061306
});
13071307

1308+
// https://github.com/eslint/eslint/issues/18550
1309+
it("should skip files with non-standard extensions when they're matched only by a '*' files pattern", async () => {
1310+
eslint = new ESLint({
1311+
cwd: getFixturePath("files"),
1312+
overrideConfig: { files: ["*"] },
1313+
overrideConfigFile: true
1314+
});
1315+
const results = await eslint.lintFiles(["."]);
1316+
1317+
assert.strictEqual(results.length, 2);
1318+
assert(
1319+
results.every(result => /^\.[cm]?js$/u.test(path.extname(result.filePath))),
1320+
"File with a non-standard extension was linted"
1321+
);
1322+
});
1323+
13081324
// https://github.com/eslint/eslint/issues/16413
13091325
it("should find files and report zero messages when given a parent directory with a .js", async () => {
13101326
eslint = new ESLint({

0 commit comments

Comments
 (0)
0