-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"eslint --ignore-path" should accept multiple file paths #9794
Comments
Hi @ratson, thanks for the issue. It looks like there's not enough information for us to know how to help you. If you're reporting a bug, please be sure to include:
Requesting a new rule? Please see Proposing a New Rule for instructions. Requesting a rule change? Please see Proposing a Rule Change for instructions. If it's something else, please just provide as much additional information as possible. Thanks! |
Update issue body with the following, hope it is clear enough.
|
I'm 👍 to this enhancement as long as we have a clear path for how the ignores will be applied and whether the ignore patterns apply from the location of the ignore file or from the current working directory. My suggestions on those points:
|
Second bullet point would add a bunch of additional complexity to the code to cover an edge case scenario. Not sure how necessary this is. |
@ilyavolodin .gitignore + .eslintignore is a really common case. I've got a vendor directory in source control and I want to ignore my /build directories etc. Currently both ignore files are in the root of the repo so it's less important that relative paths are preserved. |
Ideally this should also be configurable via the config file (e.g. |
@maxmilton See #3529 for previous discussion on why config files cannot have ESLint ignore paths/patterns. Basically, we read and resolve configurations only after knowing what directories to traverse, which means we have to know what directories to ignore before we start reading configuration files. So I don't think that's going to change. |
@platinumazure thank you for clarifying, I hadn't seen that issue thread before. I'll continue to maintain multiple ignore files in my projects. |
…o .gitignore files which are then not working anymore. See issue: eslint/eslint#9794
Seems discussion has stalled on this... I would love to see support for multiple ignore files specified in Maybe it would be worth trying to prove the concept with a CLIEngine change first? E.g., add a method |
Here is an actual usecase. I want eslint to only check files I can modify so I do The only way I can do this now is to copy everything from .gitignore to .eslintignore and add flow-typed/* there. But then I have to always add lines to .gitignore and .eslintignore every time I want to ignore something. This is kinda minor but I would love to know about a better way |
Unfortunately, it looks like there wasn't enough interest from the team or community to implement this change. While we wish we'd be able to accommodate everyone's requests, we do need to prioritize. We've found that issues failing to be implemented after 90 days tend to never be implemented, and as such, we close those issues. This doesn't mean the idea isn't interesting or useful, just that it's not something the team can commit to. |
For reference, Prettier currently cannot accept multiple |
Current,
eslint --ignore-path
accept only one ignore file, it is useful if.gitignore
and.eslintignore
could be used together.As of
ESLint v4.14.0
,--ignore-path
command line argument is acceptingpath::String
, is is proposed to change to[path::String]
, so addition files could be included.The text was updated successfully, but these errors were encountered: