Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Clarify default ignoring of node_modules #456

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 4 additions & 2 deletions docs/user-guide/configuring.md
Expand Up @@ -840,16 +840,18 @@ Globs are matched using [node-ignore](https://github.com/kaelzhang/node-ignore),

In addition to any patterns in a `.eslintignore` file, ESLint always ignores files in `/node_modules/*` and `/bower_components/*`.

For example, placing the following `.eslintignore` file in the current working directory will ignore all of `node_modules`, `bower_components` and anything in the `build/` directory except `build/index.js`:
For example, placing the following `.eslintignore` file in the current working directory will ignore all of `node_modules`, `bower_components` in the project root and anything in the `build/` directory except `build/index.js`:

```text
# /node_modules/* and /bower_components/* ignored by default
# /node_modules/* and /bower_components/* in the project root are ignored by default

# Ignore built files except build/index.js
build/*
!build/index.js
```

**Important**: Note that `node_modules` in for example `packages` directories are *not* ignored by default and need to be added to `.eslintignore` explicitly.

### Using an Alternate File

If you'd prefer to use a different file than the `.eslintignore` in the current working directory, you can specify it on the command line using the `--ignore-path` option. For example, you can use `.jshintignore` file because it has the same format:
Expand Down