Closed daniel-shuy closed 4 months ago
Could you please create a minimal repository that reproduces the issue and share it?
Ah, I figured out the issue. Because I can't apply the eslint-plugin-jsonc
flat preset to subset of files, e.g.
import eslintPluginJsonc from 'eslint-plugin-jsonc';
export default [
{
files: ["*.json5"],
...eslintPluginJsonc.configs['flat/recommended-with-json5'],
rules: {
// ...
},
},
];
it is detecting files generated by my build with eslint-disable
directives (in my case, jquery-ui.js
).
I solved it by configuring ESLint to use my .gitignore
file.
It would be nice if the flat presets can be applied to a subset of files, but it can be worked around as far as this issue is concerned.
How can I apply a flat preset to only certain file formats (e.g.
.json5
)?I tried:
but it is applying the rules to other file formats (e.g.
.js
) as well