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

Unignoring directories and their inner files in .eslintignore does not work #11684

Closed
belochub opened this issue May 8, 2019 · 2 comments
Closed
Assignees
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 core Relates to ESLint's core APIs and features

Comments

@belochub
Copy link
Contributor

belochub commented May 8, 2019

Tell us about your environment

  • ESLint Version: 5.16.0
  • Node Version: 10.14.2
  • npm Version: 6.4.1

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

Please show your full configuration:

Configuration
{
  "rules": { "no-octal": "error" }
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

A minimal example that can be used to reproduce the issue:
In the project with the following directory structure:

.
├── dir
│   └── file.js
├── .eslintignore
├── .eslintrc
├── file.js
├── node_modules
│   └── ...
├── package.json
└── package-lock.json

This is the .eslintignore file:

*
!/dir/
!/dir/file.js

Both files ./file.js and ./dir/file.js contain the following code:

01
npx eslint .

What did you expect to happen?

File ./dir/file.js is linted and an error is reported:

/path/to/project/dir/file.js
  1:1  error  Octal literals should not be used  no-octal

✖ 1 problem (1 error, 0 warnings)

What actually happened? Please include the actual, raw output from ESLint.

All files matched by '.' are ignored.

Are you willing to submit a pull request to fix this bug?
Yes, I have a possible fix for this issue that I would like to submit.

AFAIU, this was broken in #6783 since I've tried this on the ESLint versions that do not include that change (<3.4.0), and they seem to be working correctly.

@belochub belochub added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels May 8, 2019
belochub added a commit to belochub/eslint that referenced this issue May 8, 2019
belochub added a commit to belochub/eslint that referenced this issue May 8, 2019
@platinumazure platinumazure added core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels May 8, 2019
@platinumazure
Copy link
Member

Hi @belochub, thanks for the issue.

This does look like a bug, and I think I understand what you're trying to do in your pull request. That said, do you happen to have any documentation (etc.) from node-glob/node-ignore which helps explain the changes in your PR (i.e., what requirements on their side we might have missed)? Not strictly required but would help me understand and review the PR better 😄

mysticatea added a commit that referenced this issue May 9, 2019
@mysticatea mysticatea added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels May 9, 2019
@mysticatea mysticatea self-assigned this May 9, 2019
belochub added a commit to belochub/eslint that referenced this issue May 10, 2019
belochub added a commit to belochub/eslint that referenced this issue May 10, 2019
belochub added a commit to belochub/eslint that referenced this issue May 10, 2019
@belochub
Copy link
Contributor Author

@platinumazure since #11546 has landed, I've updated my PR, and node-glob is no longer used. As for node-ignore, one of the conventions specified in the documentation is relevant to this issue: https://github.com/kaelzhang/node-ignore#2-filenames-and-dirnames

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Nov 15, 2019
@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 Nov 15, 2019
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 core Relates to ESLint's core APIs and features
Projects
None yet
Development

No branches or pull requests

3 participants