Skip to content
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

--no-ignore should not prevent --ignore-pattern #6260

Closed
alberto opened this issue May 26, 2016 · 6 comments
Closed

--no-ignore should not prevent --ignore-pattern #6260

alberto opened this issue May 26, 2016 · 6 comments
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion cli Relates to ESLint's command-line interface documentation Relates to ESLint's documentation

Comments

@alberto
Copy link
Member

alberto commented May 26, 2016

According to the doc the purpose of --no-ignore is to "Disables excluding of files from .eslintignore and --ignore-path files. However it also prevents any usage of --ignore-pattern.

What version of ESLint are you using?
2.10.2

What parser (default, Babel-ESLint, etc.) are you using?
default

Please show your full configuration:
N/A

What did you do? Please include the actual source code causing the issue.
/bin/eslint.js test.js --no-ignore --ignore-pattern 'test.js'

What did you expect to happen?
test.js is still ignored

What actually happened? Please include the actual, raw output from ESLint.
test.js was linted

@alberto alberto added bug ESLint is working incorrectly cli Relates to ESLint's command-line interface evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels May 26, 2016
@nzakas
Copy link
Member

nzakas commented May 27, 2016

I think the documentation just needs to be updated. --no-ignore is meant to turn off all ignore features outside of the defaults.

@platinumazure
Copy link
Member

@nzakas If that's how we want --no-ignore to behave, then I think we should also have an option that suppresses ignore files so that users can still specify ignore patterns. I still think that's a valid use case (ignore file exists, user wants to invoke with no ignore file, user wants to provide patterns); do you?

@alberto
Copy link
Member Author

alberto commented May 27, 2016

@nzakas What would be the reasoning for also ignoring --ignore-path, since both would be command line options?

@nzakas
Copy link
Member

nzakas commented May 30, 2016

@alberto sorry, I'm not sure what you're asking.

@platinumazure I don't think so. Again, as I said in my comment, --no-ignore is meant to turn off all ignore features. I'm not sure why you'd want to have an ignore file but not use it and then specify an ignore pattern on the command line. Given that we've received zero requests to change that behavior, I'd venture to say this isn't a common use case.

So, I'm still of the mind that the documentation is just incorrect and should be updated.

@platinumazure
Copy link
Member

platinumazure commented May 30, 2016

@nzakas Okay. I do think the use case I have outlined is valid, but I don't feel strongly enough about it to consider your interpretation wrong. If someone requests an enhancement to allow patterns but suppress ignore files, we can revisit then.

I agree this just needs a docs update in that case. Should this say bug/cli/docs/accepted then?

@alberto
Copy link
Member Author

alberto commented May 30, 2016

Sorry, I'll try to explain myself better.

What you are saying is that --no-ignore invalidates --ignore-pattern, so it wouldn't ever make sense using both at the same time.

I was thinking it could be somewhat useful to not invalidate it (and it's a trivial change to do so). So, for example someone with an .eslintignore file which ignores some parts of his project, could run with --no-ignoreto see the status of things in the ignored folders, but also use --ignore-pattern to skip the known really problematic ones. Something like eslint --no-ignore --ignore-pattern "hereBeDragons/*". Not a big deal, since it can also be achieved editing the ignore file or using a different one, so if you don't think it adds enough value, we can update the docs instead, as you said.

@alberto alberto added documentation Relates to ESLint's documentation accepted There is consensus among the team that this change meets the criteria for inclusion and removed bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels May 31, 2016
@nzakas nzakas closed this as completed in 38dccdd Jun 1, 2016
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion cli Relates to ESLint's command-line interface documentation Relates to ESLint's documentation
Projects
None yet
Development

No branches or pull requests

3 participants