.eslintignore is a file which lists files that esLint should not lint as part of a javascript projet
.eslintignore
is a file which lists files that esLint
should not lint as part of a javascript projet. The file should be located int the root directory of the project.
eslintignore grammar
- Lines starint with
#
are treated as comments and are not ignored. - All paths are treated as relative paths to the
.eslintignore
file. - Patterns follow the same behavior as the
.gitignore
. - Lines strating with
!
are treated as reinclusion from a previous exclusion.
Some pattern are always ignore by default, this is the case for directories like /node_modules/*
and /bower_components/*
/# This line will be ignored
/build/*
/|build/index.js
/*.min.js
The following files will be ignored:
- Every files in the
build
directory, exceptindex.js
. - Every minified javascript files.
You can specify any file as a eslintignore when launching eslint with the --ignore-path
argument, as long as the file follows the .eslintignore
standard. For example you could use a .jshintignore
. Although when using this argument this file will be used in place of the project .eslintignore
/eslint --ignore-path .jshintignore myfile.js
Files can also be ignored in the package.json if no .eslintignore file is found.
/{
/ "name": "mypackage",
/ "version": "0.0.1",
/ "eslintIgnore": ["hello.js", "world.js"]
/}
The --no-ignore
argument can also be used to bypass the the ignore rules.