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: incorrect warning message for ignored dotfiles #17196

Merged
merged 1 commit into from May 19, 2023

Conversation

mdjermanovic
Copy link
Member

Prerequisites checklist

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

[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

Tell us about your environment (npx eslint --env-info):

  • Node version: v16.14.0
  • npm version: v8.3.1
  • Local ESLint version: v8.40.0
  • Global ESLint version: no
  • Operating System: windows

What parser are you using (place an "X" next to just one item)?

[x] Default (Espree)
[ ] @typescript-eslint/parser
[ ] @babel/eslint-parser
[ ] vue-eslint-parser
[ ] @angular-eslint/template-parser
[ ] Other

Please show your full configuration:

Configuration

This project's eslint.config.js

What did you do? Please include the actual source code causing the issue.

In eslint/eslint main branch, I ran this command:

eslint tests/fixtures/dot-files/.a.js

What did you expect to happen?

The flat config system doesn't ignore dotfiles by default. This file is ignored by pattern "tests/fixtures/**" in the config file.

I'd expect the common warning message for files ignored by the user's configuration:

 0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to override

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

The message suggests that the file is ignored by default:

  0:0  warning  File ignored by default.  Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override

What changes did you make? (Give an overview)

In function createIgnoreResult, I removed the conditional for dotfiles. After the change, this case will fall into the "File ignored because of a matching ignore pattern" branch.

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

@mdjermanovic mdjermanovic added bug ESLint is working incorrectly core Relates to ESLint's core APIs and features accepted There is consensus among the team that this change meets the criteria for inclusion labels May 18, 2023
@mdjermanovic mdjermanovic requested a review from a team as a code owner May 18, 2023 11:31
@netlify
Copy link

netlify bot commented May 18, 2023

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit 86f4db8
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/64660c8aa783cb0008fd3a4c

Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit 4f5440d into main May 19, 2023
22 checks passed
@mdjermanovic mdjermanovic deleted the dotfiles-ignore-message branch May 19, 2023 17:48
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Nov 16, 2023
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Nov 16, 2023
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
Status: Complete
Development

Successfully merging this pull request may close these issues.

None yet

2 participants