Skip to content

Bug: [new config system] Directories cannot be unignored #16415

@mdjermanovic

Description

@mdjermanovic

Environment

Node version: v16.14.0
npm version: v8.3.1
Local ESLint version: main branch
Global ESLint version: Not found
Operating System: win32 10.0.19044

What parser are you using?

Default (Espree)

What did you do?

my-app/
├── eslint.config.js
└── foo/
    └── bar/
        └── a.js
// eslint.config.js
module.exports = [{
    ignores: [
      "foo/*",
      "!foo/bar"
    ]
}];

Command:

eslint "foo/**/*.js" -f tap

What did you expect to happen?

I would expect foo/bar/a.js to be linted, because neither the file itself nor any of its parent directories are ignored by the patterns.

TAP version 13
1..1
ok 1 - D:\tmp\my-app\foo\bar\a.js

What actually happened?

Oops! Something went wrong! :(

ESLint: 8.25.0

You are linting "foo/**/*.js", but all of the files matching the glob pattern "foo/**/*.js" are ignored.

If you don't want to lint these files, remove the pattern "foo/**/*.js" from the list of arguments passed to ESLint.

If you do want to lint these files, try the following solutions:

* Check your .eslintignore file, or the eslintIgnore property in package.json, to ensure that the files are not configured to be ignored.
* Explicitly list the files from this glob that you'd like to lint on the command-line, rather than providing a glob as an argument.

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbugESLint is working incorrectlyrepro:neededThis issue should include a reproducible example

    Type

    No type

    Projects

    Status

    Complete

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions