diff --git a/docs/user-guide/command-line-interface.md b/docs/user-guide/command-line-interface.md index 9a6e43a74e8..b8f10497a36 100644 --- a/docs/user-guide/command-line-interface.md +++ b/docs/user-guide/command-line-interface.md @@ -480,7 +480,7 @@ Example: ESLint supports `.eslintignore` files to exclude files from the linting process when ESLint operates on a directory. Files given as individual CLI arguments will be exempt from exclusion. The `.eslintignore` file is a plain text file containing one pattern per line. It can be located in any of the target directory's ancestors; it will affect files in its containing directory as well as all sub-directories. Here's a simple example of a `.eslintignore` file: - node_modules/* + temp.js **/vendor/*.js A more detailed breakdown of supported patterns and directories ESLint ignores by default can be found in [Configuring ESLint](configuring.md#ignoring-files-and-directories). diff --git a/docs/user-guide/configuring.md b/docs/user-guide/configuring.md index b31ce2ebbc7..13f723fa380 100644 --- a/docs/user-guide/configuring.md +++ b/docs/user-guide/configuring.md @@ -1021,7 +1021,7 @@ You can tell ESLint to ignore specific files and directories by `ignorePatterns` ```json { - "ignorePatterns": ["temp.js", "node_modules/"], + "ignorePatterns": ["temp.js", "**/vendor/*.js"], "rules": { //... } @@ -1061,12 +1061,13 @@ Of particular note is that like `.gitignore` files, all paths used as patterns f Please see `.gitignore`'s specification for further examples of valid syntax. -In addition to any patterns in a `.eslintignore` file, ESLint always ignores files in `/**/node_modules/*`. +In addition to any patterns in a `.eslintignore` file, ESLint ignores files in `/**/node_modules/*` by default. It can still be added using `!`. -For example, placing the following `.eslintignore` file in the current working directory will ignore all of `node_modules/*` and anything in the `build/` directory except `build/index.js`: +For example, placing the following `.eslintignore` file in the current working directory will not ignore `node_modules/*` and ignore anything in the `build/` directory except `build/index.js`: ```text -# node_modules/* are ignored by default +# node_modules/* is ignored by default, but can be added using ! +!node_modules/* # Ignore built files except build/index.js build/*