When using the legacy ESLint config system, you may see this error running ESLint after installing dependencies:
ESLint couldn't determine the plugin "${pluginId}" uniquely.
- ${filePath} (loaded in "${importerName}")
- ${filePath} (loaded in "${importerName}")
...
Please remove the "plugins" setting from either config or remove either plugin installation.
ESLint configuration files allow loading in plugins that may include other plugins. A plugin package might be specified as a dependency of both your package and one or more ESLint plugins. Legacy ESLint configuration files may use extends to include other configurations. Those configurations may depend on plugins to provide certain functionality in the configuration.
For example, if your config depends on eslint-plugin-a@2 and eslint-plugin-b@3, and you extend eslint-config-b that depends on eslint-plugin-a@1, then the eslint-plugin-a package might have two different versions on disk:
node_modules/eslint-plugin-anode_modules/eslint-plugin-b/node_modules/eslint-plugin-aIf the legacy ESLint configuration system sees that both plugins exists in multiple places with different versions, it won’t know which one to use.
Note that this issue is only present in the legacy eslintrc configurations. The new “flat” config system has you import the dependencies yourself, removing the need for ESLint to attempt to determine their version uniquely.
Common resolutions for this issue include:
npm dedupe or the equivalent package manager command to deduplicate packages, if their version ranges are compatible.overrides or the equivalent package manager package.json field, to force a specific version of a plugin package. For more information, see:
© OpenJS Foundation and other contributors
Licensed under the MIT License.
https://eslint.org/docs/latest/use/troubleshooting/couldnt-determine-the-plugin-uniquely