You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When defining a plugin key in the flat config ESLint enforces that you only ever redefine they key with the same plugin. This check is done by comparing by reference -- i.e. configA.plugin.react === configB.plugin.react
eslint-plugin-react fails this check because it defines its "plugin" in two locations:
It's also worth noting that this affects using multiple configurations from this plugin too. It prevents using both the flat recommended and jsx-runtime configurations at the time time for example, which is the recommended configuration when using the React 17 JSX transform.
I believe this is actually to do with the fact that the recommended config defines the plugin, and your config which uses the recommended config is also defining the plugin. It shouldn't have anything to do with plugins being defined in other places in the package. Can you try removing from your config?
Is there an existing issue for this?
Description Overview
Repro
npx eslint eslint.config.js
Expected
No errors
Actual
More Info
When defining a plugin key in the flat config ESLint enforces that you only ever redefine they key with the same plugin. This check is done by comparing by reference -- i.e.
configA.plugin.react === configB.plugin.react
eslint-plugin-react
fails this check because it defines its "plugin" in two locations:eslint-plugin-react/index.js
Lines 14 to 31 in 36e791d
eslint-plugin-react/configs/all.js
Lines 23 to 26 in 36e791d
For this to work there needs to be exactly 1 copy of the "plugin" defined by the package.
For example:
eslint-plugin-react version
v7.33.2
eslint version
v8.56.0
node version
v20.11.0
The text was updated successfully, but these errors were encountered: