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

Fix: don't ignore the entry directory (fixes #12604) #12607

Merged
merged 1 commit into from Nov 30, 2019
Merged

Conversation

mysticatea
Copy link
Member

What is the purpose of this pull request? (put an "X" next to item)

[X] Bug fix: #12604

What changes did you make? (Give an overview)

This PR fixes #12604 as unignoring the entry directory.

Previously, the eslint dir command had checked if the directly given directory (dir) is ignored by .eslintignore or not. By #12274, the ignore check has gotten to load config files from the directory that the dir exists in order to check ignorePatterns property. As a result, the eslint . command has gotten to try loading config files from ../. Then if config files were not found from ../ and ancestors, ESLint loads personal config file.

I think that it's not intuitive if the eslint . command checks the ignore of ., so this PR changes that behavior. If eslint dir is present and dir is a directory, ESLint doesn't ignore dir itself.

Actually, this change has pretty small impacts. When dir is an ignored path, it still ignores dir/** even if ESLint doesn't ignore dir itself. Therefore, the only impact is error messages ("All files matched by 'dir' are ignored" instead of "No files matching 'dir' were found") in most cases.

Is there anything you'd like reviewers to focus on?

  • Is this direction right?

@mysticatea mysticatea added the evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion label Nov 27, 2019
@mysticatea mysticatea added accepted There is consensus among the team that this change meets the criteria for inclusion patch candidate This issue may necessitate a patch release in the next few days and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Nov 28, 2019
@kaicataldo kaicataldo merged commit 4928d51 into master Nov 30, 2019
@kaicataldo kaicataldo deleted the issue12604 branch November 30, 2019 16:42
@kaicataldo kaicataldo added the bug ESLint is working incorrectly label Nov 30, 2019
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators May 30, 2020
@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 May 30, 2020
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 bug ESLint is working incorrectly patch candidate This issue may necessitate a patch release in the next few days
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[6.7] running eslint through npm script throws error.
4 participants