eslint-plugin-import
eslint-plugin-import copied to clipboard
Following the ESLint 9 support, `import/no-unused-modules` only works in flat config if an `.eslintrc` file exists as well
I have seen various discussions about this rule, but not quite in the exact same context, so I am unsure if that could be merged with an existing issue:
I upgraded to eslint-plugin-import v2.31.0, which officially supports ESLint V9. Enabling the import/no-unused-modules with the existing unusedExports option results in the ESLint CLI not recognizing the eslint.config.js unless there's a .eslintrc file next to it (the .eslintrc file can be empty; it just ignores it).
Oops! Something went wrong! :(
ESLint: 9.11.1
ESLint couldn't find a configuration file. To set up a configuration file for this project, please run:
npm init @eslint/config@latest
ESLint looked for configuration files in <project rootDir> and its ancestors. If it found none, it then looked in your home directory.
If you think you already have a configuration file or if you need more help, please stop by the ESLint Discord server: https://eslint.org/chat
As long as the .eslintrc exists, the rule works as expected.