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

mysticatea commented Nov 27, 2019

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?
@kaicataldo kaicataldo merged commit 4928d51 into master Nov 30, 2019
18 checks passed
18 checks passed
Verify Files
Details
Test (ubuntu-latest, 13.x)
Details
Test (ubuntu-latest, 12.x)
Details
Test (ubuntu-latest, 10.x)
Details
Test (ubuntu-latest, 8.x)
Details
Test (ubuntu-latest, 8.10.0)
Details
Test (windows-latest, 12.x)
Details
Test (macOS-latest, 12.x)
Details
Browser Test
Details
commit-message Commit message follows guidelines
Details
continuous-integration Build #20191127.1 succeeded
Details
continuous-integration (Test on Node.js 10 (Linux)) Test on Node.js 10 (Linux) succeeded
Details
continuous-integration (Test on Node.js 12 (Linux)) Test on Node.js 12 (Linux) succeeded
Details
continuous-integration (Test on Node.js 12 (Windows)) Test on Node.js 12 (Windows) succeeded
Details
continuous-integration (Test on Node.js 12 (macOS)) Test on Node.js 12 (macOS) succeeded
Details
continuous-integration (Test on Node.js 8 (Linux)) Test on Node.js 8 (Linux) succeeded
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor This change is semver-patch
Details
@kaicataldo kaicataldo deleted the issue12604 branch Nov 30, 2019
@kaicataldo kaicataldo added the bug label Nov 30, 2019
@hzhu hzhu mentioned this pull request Dec 11, 2019
0 of 1 task complete
@eslint eslint bot locked and limited conversation to collaborators May 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.