[import/no-unused-modules] - "No files matching the pattern" error
See original GitHub issueI’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 install
npm 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.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:38 (18 by maintainers)
Top Results From Across the Web
How can I suppress the "No files matching the pattern ...
If no JS files exist, it's currently throwing an error. I'd prefer if it'd succeeded when no JS files exist. Is this possible?...
Read more >Error: No files matching the pattern found #28 - GitHub
Whenever i run the command provided on npm clinic doctor --on-port 'autocannon http://localhost:$PORT' -- node server.js I get the error ...
Read more >"No files matching the pattern" then "Module build failed ...
Hello, I'm a new user trying out Sage. I first ran into the No files matching the pattern "/Volumes/…/resources/assets/**/*.s?
Read more >Getting an error 'No files matching the pattern were ... - YouTube
HTML : Getting an error ' No files matching the pattern were found' when using prettier [ Beautify Your Computer ...
Read more >Control-M Advanced File Transfer jobs are not failing (ENDED ...
Prior to upgrading to AFT 8.2.00, the message "No matching files for pattern" was present in the output, but it is no longer...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@EvgenyOrekhov
I was having a relevant issue with the cli
eslint --ext .js,.jsx,.ts,.tsx src
and alternativeeslint src/**/*.{js,jsx,ts,tsx}
what worked for me to “fix” this error was to add quotes… ** facepalm **
eslint --ext ".js,.jsx,.ts" src
andeslint \"src/**/*.{js,jsx,ts,tsx}\"
NOT a fix, but it looks like the CLI accepts this
@ljharb I updated all dependencies (including all transitive ones) in my repro case. Still getting the same error. Looking forward to the next release of eslint-plugin-import!