-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
The types added in #3097 do not match with what the plugin currently exports.
The type definitions declare a default export, which this plugin does not have. The ESLint documentation recommends a default export.
Not providing this export, and then declaring that it is provided, can cause user confusion. For instance, I would expect the following to work:
Outdated, see comment # 2 below
import importPlugin from 'eslint-plugin-import';
import { defineConfig } from 'eslint/config';
export default defineConfig(
{
plugins: {
import: importPlugin,
},
rules: {
'import/named': 'error',
}
},
{
files: ['src/**/*.{ts,tsx}'],
extends: [importPlugin.flatConfigs.typescript]
}
);
TypeScript compiles this without any warning, but ESLint will produce this error:
Oops! Something went wrong! :(
ESLint: 9.36.0
ConfigError: Config "UserConfig[1] > import/typescript": Key "plugins": Cannot redefine plugin "import".
Metadata
Metadata
Assignees
Labels
No labels