import-js/eslint-plugin-import
View on GitHub[import/no-unused-modules] - "No files matching the pattern" error
Open
#1,645 opened on Feb 5, 2020
help wanted
Repository metrics
- Stars
- (4,946 stars)
- PR merge metrics
- (Avg merge 138d 22h) (3 merged PRs in 30d)
Description
I'm using both eslint-plugin-import and eslint-plugin-json. When there are only *.json files in my project, I get "No files matching the pattern" error from the import/no-unused-modules rule, and ESLint crashes.
Steps to reproduce:
- Clone this minimal reproducible case: https://github.com/EvgenyOrekhov/eslint-config-hardcore/tree/no-files-matching-the-pattern-bug
npm installnpm test
Actual result:
> no-files-matching-the-pattern-bug@0.0.0 test C:\eslint-config-hardcore
> eslint --ext .js,.json .
Oops! Something went wrong! :(
ESLint: 6.8.0.
No files matching the pattern "C:\eslint-config-hardcore" were found.
Please check for typing mistakes in the pattern.
npm ERR! Test failed. See above for more details.
Expected result: there should be no "No files matching the pattern" error, there should be only one warning from eslint-plugin-json
> no-files-matching-the-pattern-bug@0.0.0 test C:\eslint-config-hardcore
> eslint --ext .js,.json .
C:\eslint-config-hardcore\invalid.json
1:2 error Expected a JSON object, array or literal json/*
✖ 1 problem (1 error, 0 warnings)
npm ERR! Test failed. See above for more details.
When I remove the import/no-unused-modules rule from .eslintrc.json, the problem goes away.