Closed AhmedBaset closed 4 months ago
You've misunderstood how flat config files work.
By default eslint applies all configurations to all files being linted.
When you use files
it makes eslint apply just that specific config object to the matched files.
It does not prevent other config objects from matching.
So your config is setup has
js.configs.recommended,
tseslint.configs.eslintRecommended,
tseslint.configs.base,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
None of those configs have a files
- So that means that eslint applies all of those to every single file.
You then have files: ["**/en.json", "**/ar.json"]
which does two things: first it tells eslint that json files should be included in the lint run, and second it restricts that specific config object to json files.
The first part is the kicker - all the above configs are applied to all files being linted. And you just added json files to the files being linted.
There's no bug here. The issue is your config is wrong.
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
I can't write json in the playground
Repro Code
ESLint Config
tsconfig
Expected Result
I expect to ignore json files
Actual Result
It runs on json files
Additional Info
No response