Should not be an error: No files matching the pattern "entry.js" were found.
See original GitHub issueDue to rule:
{
rules: {
'import/no-unused-modules': [
'error',
{
ignoreExports: ['index.js', 'entry.js', 'main.js'],
missingExports: true,
unusedExports: true
}
]
}
}
I get the error:
> eslint . --ext .js
Oops! Something went wrong! :(
ESLint: 6.8.0.
No files matching the pattern "entry.js" were found.
Please check for typing mistakes in the pattern.
If I dont have an “entry.js” file, it should just ignore it and move on.
However, I get the error even if I have an “entry.js” file 😦
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:13 (10 by maintainers)
Top Results From Across the Web
Should not be an error: No files matching the pattern "entry.js ...
Yes, it works now. But I was hoping that it'd just ignore if it can't find the file. Because I want the config...
Read more >How can I suppress the "No files matching the pattern ...
I have the same error. No files matching the pattern ".ts," were found. I just removed spaces between types .js, .ts, .tsx in...
Read more >eslint/eslint - Gitter
Running yarn lint on Linux/Mac works, but on Windows I get this error: No files matching the pattern "'**/*.ts'" were found.
Read more >Prettier [Error] No Files Matching The Pattern Were Found
Failed to compile No files matching 'C:/some folder/myapp/src/.' were found. If i use a path works fine. Is important to note that this...
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 >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
I agree with you that
my-tool my-file.js
should fail ifmy-file.js
does not exist because you’re explicitly passing an argument to a command, but that’s a different use case IMO. Ignore lists do not usually cause a tool to fail if there is not at least one file from the ignore list that actually exists.Until this behavior changes, we will not be able to use this rule organization-wide unfortunately, and I wouldn’t be surprised if other teams that have shared configurations encountered the same issue. I understand we can extend shared configurations per-repositories, but it makes it harder to ensure good practices organization-wide.
@ljharb, it’s however pretty standard practice to have configurations silently ignore files that do not exist:
.gitignore
,.eslintignore
, etc. And that’s not just among*ignore
files:include
/exclude
fields oftsconfig.json
,files
field ofpackage.json
, to name just a few.In our projects, some have a
webpack.config.ts
we need this rule to ignore and some don’t, some projects have a top-levelindex.ts
and others haveindex.tsx
where all things available outside the boundaries of each projects live (not the best example becauseindex.ts{,x}
is a valid pattern here). Another example is our configuration has an entry for**/*.d.ts
, which will break the linter when a project does not have any declaration files, but would work ok as long as there is a single file in the entire repo.It does seem counter-intuitive to me, and the opposite of what most tools out there accustomed us to. Would you be open to reconsider your position on this? 😃