Skip to content

Does not respect nested eslintignore files #111

@jdforsythe

Description

@jdforsythe

The plugin does a good job of working up the tree to find the most local configuration file, but it doesn't do the same with .eslintignore files.

Consider the project layout:

inner/
  .eslintignore
  .eslintrc.json
  test.js
.eslintignore
.eslintrc.json
test.js

Root directory files

/.eslintrc.json

{
  "rules": {
    "eqeqeq": [ "error", "always" ]
  }
}

/.eslintignore

inner/*

/test.js

if (0 == 1) console.log('what?!');

/inner files

/inner/.eslintrc.json

{
  "rules": {
    "eqeqeq": ["warn", "always"]
  }
}

/inner/.eslintignore

!test.js

/inner.test.js

if (0 == 1) console.log('what?!');

If you remove the .eslintignore files, you will correctly get an error in /test.js and a warning in /inner/test.js.

If you add just the /.eslintignore file, it ignores the inner folder. I think the expected behavior would be to reset the "ignore" blobs at the same root as the .eslintrc.json file is found. That's what I had expected anyway.

So I added the /inner/.eslintignore file and it does not override the root ignore blobs. This still produces no warning in the /inner/test.js file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions