From 935f4e460d83c39f107118c4c4dbb7f6b58684b1 Mon Sep 17 00:00:00 2001 From: Matijs Brinkhuis Date: Fri, 16 Mar 2018 20:37:23 +0100 Subject: [PATCH] Docs: Clarify default ignoring of node_modules (#10092) When using ESLint from the root of a mono repo `node_modules` needs to be explicitly added to `.eslintignore` for ESLint to ignore for example `packages/*/node_modules`. Clarified this in the configuring documentation. --- docs/user-guide/configuring.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/user-guide/configuring.md b/docs/user-guide/configuring.md index 49d6f8149a1..8ee98568916 100644 --- a/docs/user-guide/configuring.md +++ b/docs/user-guide/configuring.md @@ -833,16 +833,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` directories in, for example, a `packages` directory in a mono repo 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: