-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionbugESLint is working incorrectlyESLint is working incorrectlyrepro:yesIssues with a reproducible exampleIssues with a reproducible example
Description
Environment
Node version: v22.14.0
npm version: v10.9.2
Local ESLint version: v9.28.0
Global ESLint version: no
Operating System: windows
What parser are you using?
Default (Espree)
What did you do?
Configuration
export default [
{
files: [["**/*.myjs", "src/**"]],
rules: {
"no-undef": 2
}
}
];
// src/foo.myjs
foo
What did you expect to happen?
I'd expect all .myjs files in src
directory to be included in linting.
What actually happened?
$ npx eslint src/foo.myjs
C:\projects\tmp\tmp\src\foo.myjs
0:0 warning File ignored because no matching configuration was supplied
✖ 1 problem (0 errors, 1 warning)
Link to Minimal Reproducible Example
https://stackblitz.com/edit/stackblitz-starters-vajknonf
Participation
- I am willing to submit a pull request for this issue.
Additional comments
This is because the code that checks whether a pattern is an explicit match doesn't account for arrays in files
:
If the order is changed to files: [["src/**", "**/*.myjs"]]
, then it is considered explicit match, by chance due to the way arrays are coerced to strings.
Metadata
Metadata
Assignees
Labels
acceptedThere is consensus among the team that this change meets the criteria for inclusionThere is consensus among the team that this change meets the criteria for inclusionbugESLint is working incorrectlyESLint is working incorrectlyrepro:yesIssues with a reproducible exampleIssues with a reproducible example
Type
Projects
Status
Complete