Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add an option to not throw an error on an unmatched pattern #10587

@yvele

Description

@yvele

The version of ESLint you are using.

ESLint: 5.1.0.

The problem you want to solve.

Since breaking behaviour change 8b7c6ea #7390 #10143 bundled in ESLint 5, a fatal error is thrown if any file pattern return no files.

My company is using a generic ESLint configuration/runner for all our projects, and we are pretty happy with that:

eslint \
  --ext .js --ext .jsx --ext .mjs \
  -- src test "packages/*/src" "package/*/test"

The problem is that not ALL of our projects matches the same patterns, and we got this error since we upgraded to eslint@5

No files matching the pattern "test" were found.
Please check for typing mistakes in the pattern.

We don't want to implement custom code to check for pattern existence before appending them to eslint CLI parameters (and we where really happy with eslint@4 behaviour on this particular case).

NOTE: This issue is a bit related to #9977

Your take on the correct solution to problem.

Add a CLI option (exactly like how proposed here) not to throw errors on unmatched patterns.

Something like --no-error-on-missing-files or --no-error-on-unmatched-pattern

Metadata

Metadata

Assignees

Labels

acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussioncliRelates to ESLint's command-line interfaceenhancementThis change enhances an existing feature of ESLinthelp wantedThe team would welcome a contribution from the community for this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions