Closed rakleed closed 11 months ago
That's because this plugin doesn't support flat config yet, so it's correct to not be in the documentation. See #891.
I also spent some time looking through PR issues that mention "flat config" to finally find this one. I think it might be valuable to add a note to the readme that says it's currently not supported but coming soon?
@vmerino then i'd get no end to issues asking "when" :-p
@ljharb So I was able to make the plugin work with the following config object in the flat config with v6.8.0
(for anyone else finding this thread):
import jsxA11y from 'eslint-plugin-jsx-a11y';
// ...
{
plugins: {
'jsx-a11y': {
rules: jsxA11y.rules,
},
},
rules: jsxA11y.configs.recommended.rules,
},
It may also need the languageOptions
config for jsx but probably works in mine because I already have eslint-plugin-react
in there.
If you don't want to make any changes to the code itself, could just put the above snippet in the readme?
@gregjacobs if you can confirm that all of the rules actually work that way, then I'd be happy to accept a PR with a flat
entrypoint that does that (including relevant docs).
From the next version 9, ESLint will deprecate the current eslintrc format, and by default will use the new flat config format (
eslint.config.js
). Already from version 8.2.23 you can fully use the flat config format. But your README (which is used as a description for the NPM package) doesn’t say anything about how to configure it correctly. Although the READMEeslint-plugin-react
contains this information. Please add this information to the documentation.