-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support flat config #80
Comments
But it works with flat config, doesn't it? const json = require('eslint-plugin-json');
module.exports = [
{
files: ['**/*.json'],
plugins: { json },
processor: json.processors['.json'],
rules: json.configs.recommended.rules,
},
] |
It looks like it will work that way, but it the plug-in can also be migrated to support flag configuration better: https://eslint.org/docs/latest/extend/plugin-migration-flat-config (it can also support both new & old). |
Also, update README with flat config example(s). |
in Eslint v9 the work-around of @4a-ge does not work unchanged - the recommended ruleset throws. I used import globals from "globals";
import pluginJs from "@eslint/js";
import pluginJson from "eslint-plugin-json";
export default [
pluginJs.configs.recommended,
pluginJson.configs.recommended,
{
files: [ '**/*.js' ],
languageOptions: {
globals: globals.nodeBuiltin,
},
rules: {
},
},
{
files: [ '**/*.json' ],
plugins: {
pluginJson,
},
processor: pluginJson.processors['.json'],
rules: {
...pluginJson.configs.recommended.rules
},
}
]; and got
Manual config works, but I prefer using recommended configurations.
|
...
This is incorrect you're trying to include the whole recommended configuration, whereas you want to only include
I suspect if you took out those first two lines it would work fine. |
https://eslint.org/blog/2023/10/flat-config-rollout-plans/
The text was updated successfully, but these errors were encountered: