Vscode-eslint: ESLint linter doesn't honor .eslintignore file

Created on 30 Nov 2015  路  16Comments  路  Source: microsoft/vscode-eslint

I would like to know how about how to use "eslint.options" ? I am really not having much luck with getting .eslintignore files to work.

I have tried placing it in the root directory, this doesn't appear to work.

I have tried adding the .eslintignore file using "eslint.options" :
"eslint.options": {
"ignorePath": ".eslintignore"
}

And also with an absolute path:
"eslint.options": {
"ignorePath": "/path/to/this/file/.eslintignore"
}

I have also tried adding the patterns with the "ignorePattern" option:
"eslint.options": {
"ignorePattern": "somefile.js"
}

All without luck! All on OS X.

I am making the assumption here that this is not a bug and rather its my miss-understanding of the implementation...

bug

Most helpful comment

I would like to see this bug fixed as well. Not being able to ignore 3rd party libraries, for example, is problematic.

All 16 comments

Same in Windows environment

I would like to see this bug fixed as well. Not being able to ignore 3rd party libraries, for example, is problematic.

Same issue here, too many error and warning message cause vscode can't work anymore (with node_modules in project folder)

EDIT:
On VSCode Insider 1.6 for Windows, with extension HTML CSS Class Completion

I tried to reproduce this and wasn't able to do so using a simple setup.

See the two screen shots.

capture

capture

Can some of you share your setup so that I can investigate why this isn't working for you.

sp160920_143425

@dbaeumer I have add node_modules to .eslintignore, but it still cause vscode stop response after install HTML CSS Class Completion and open a folder contain node_modules with a lot of npm package.

Or it can't match folder, only file?

@ArianeLu this looks like a different issue unrelated to eslint. Could you share your workspace so that we can investigate this?

I am closing this issue since I can't reproduce and @ArianeLu issue is different.

I have the same problem.
could you try with .eslintignore with */.js ? mac environment.

@sonnn do you have a workspace I can reproduce I could clone.

Just encountered this still.... in windows and using .eslintignore

// .eslintignore
dbin/*

still linting dbin/x.js

With or without an .eslintignore, I'm seeing eslint retporting problems for open javascript files within my node_modules (which should be ignored by default.) This is on a Mac with VS Code 1.9.0.

@Irowe the linting of files inside the node_modules folder was caused by a bug I introduced in 1.2.3. If fix this in 1.2.4.

@dbaeumer Open files are still being linted in VS Code 1.12.0 and ESLint extension 1.2.8

@cdierkens can you provide a workspace to reproduce. I can't not using my setup:

cast

Sorry for the dig ...

@dbaeumer I have created a repo to reproduce the issue
This demo web-store project is combined by frontend and backend sub projects. The frontend is an webpack project created by vue-cli, the backend is an django project.

I have tried to config the ignorePath param in the workspace's settings.json as follows

{
  "eslint.options": {
    "ignorePath": "${workspaceRoot}/frontend/.eslintignore"
  }
}

But it seems that eslint-plugin can not read the eslintignore file and the ignored files are still linted?

image

BTW, if I move the .eslintignore file to the root directory, the eslint plugin can work as expect.

This requires a working directory setup since the .eslintignore file is read relative to the current working directory by eslint. See https://github.com/Microsoft/vscode-eslint#settings-options

Was this page helpful?
0 / 5 - 0 ratings