question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[import/no-unused-modules] - "No files matching the pattern" error

See original GitHub issue

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:

  1. Clone this minimal reproducible case: https://github.com/EvgenyOrekhov/eslint-config-hardcore/tree/no-files-matching-the-pattern-bug
  2. npm install
  3. 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:open
  • Created 4 years ago
  • Reactions:1
  • Comments:38 (18 by maintainers)

github_iconTop GitHub Comments

22reactions
mcabs3commented, Jun 16, 2020

@EvgenyOrekhov

I was having a relevant issue with the cli

eslint --ext .js,.jsx,.ts,.tsx src and alternative eslint src/**/*.{js,jsx,ts,tsx}

what worked for me to “fix” this error was to add quotes… ** facepalm **

eslint --ext ".js,.jsx,.ts" src and eslint \"src/**/*.{js,jsx,ts,tsx}\"

NOT a fix, but it looks like the CLI accepts this

1reaction
EvgenyOrekhovcommented, Jun 6, 2020

@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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found