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

Eslint falsely reports matching configured ignore pattern for implicit ignore pattern #12873

Closed
snhardin opened this issue Feb 5, 2020 · 1 comment
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

@snhardin
Copy link
Contributor

snhardin commented Feb 5, 2020

Tell us about your environment

  • ESLint Version: 7.0.0-alpha.0
  • Node Version: v12.14.1
  • npm Version: v6.13.4

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

default

Please show your full configuration:

Configuration
{
    "extends": "airbnb-base"
}

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

I was told that an additional issue needed to be opened for code changes. #12348 has been scoped to be documentation changes only. That issue has the original instructions to reproduce the issue, although I have been able to successfully reproduce the issue myself.

If I have a file located in a dot directory (for example, client/.storybook/config.js), I can lint it by telling eslint to analyze the directory it lives in (npx eslint client/.storybook). However, if I try to lint the file directory, I am incorrectly told that the file has been ignored because of a matching ignore pattern. I have no ignore patterns defined, so this is incorrect. The file was actually ignored due to an implicit ignore rule.

Source: N/A

npx eslint client/.storybook/config.js

What did you expect to happen?

Eslint should indicate that the file was ignored by default.

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

Eslint indicated that the file was ignored because of a configured ignore pattern. I have no ignore patterns configured.

Are you willing to submit a pull request to fix this bug?

Yes

@snhardin snhardin added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Feb 5, 2020
@snhardin snhardin changed the title Implicit ignore falsely reports matching ignore pattern for implicit ignore pattern Eslint falsely reports matching configured ignore pattern for implicit ignore pattern Feb 5, 2020
@kaicataldo kaicataldo added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly and removed bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Feb 7, 2020
@kaicataldo
Copy link
Member

Thanks for reporting this. Given the fact that we show a more helpful error message for ignored dotfiles, I agree that this seems like a bug. It looks to me like we should update this logic to check if the file is located in a dotfolder and report an appropriate error message for that.

Maybe something like "File is in an ignored directory by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/directory>'\") to override."?

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

No branches or pull requests

2 participants