import-js/eslint-plugin-import

import/no-unused-modules breaks `--no-eslintrc` and eslint fails

Open

#2,907 opened on Oct 26, 2023

View on GitHub
 (3 comments) (0 reactions) (0 assignees)JavaScript (1,540 forks)batch import
help wanted

Repository metrics

Stars
 (4,946 stars)
PR merge metrics
 (Avg merge 138d 22h) (3 merged PRs in 30d)

Description

When using import/no-unused-modules with unusedExports: true, it will overwrite CLI --no-eslintrc and start looking for eslint config files - and if it finds none (because they are in a different path and provided with --config) eslint will fail. (originally though it's an eslint bug, see https://github.com/eslint/eslint/issues/17682)

ESLint couldn't find a configuration file. To set up a configuration file for this project, please run:

Additionally (not tested) this might also mean that in this case eslint will start to use eslintrc files or data from package.json it shouldn't use, since the flag is set.

Contributor guide