Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Clarify that node_modules is ignored by default #13054

Merged
merged 1 commit into from Mar 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/user-guide/command-line-interface.md
Expand Up @@ -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).
Expand Down
9 changes: 5 additions & 4 deletions docs/user-guide/configuring.md
Expand Up @@ -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": {
//...
}
Expand Down Expand Up @@ -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/*
Expand Down