-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Closed
Copy link
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 inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussioncoreRelates to ESLint's core APIs and featuresRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLint
Description
ESLint version
8.49.0
What problem do you want to solve?
The Flat Rule Tester currently reports an error when setting the filename
of a test case to a non-JavaScript file (e.g. file.ts
):
No matching configuration found for file.ts
.
As I understand it, this is because files ending with .js
are always matched in the flat config system even if there is no files
property.
What do you think is the correct solution?
Translate the filename
property to files
in the config passed to the linter:
...
const itemConfig = { ...item }
if (item.filename) {
itemConfig.files = [item.filename]
}
...
This ensures that the generated config matches the file.
Participation
- I am willing to submit a pull request for this change.
Additional comments
This problem can also be circumvented by providing a baseConfig
but this solution is more ergonomical and this was also not required when using the "legacy" rule tester, so this may be seen as a bug.
mdjermanovic
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 inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionThis issue has been archived; please open a new issue for any further discussioncoreRelates to ESLint's core APIs and featuresRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLintThis change enhances an existing feature of ESLint
Type
Projects
Status
Complete