From de4d3c14c30a88795b9075d59827d3fe63a42c5e Mon Sep 17 00:00:00 2001 From: Milos Djermanovic Date: Thu, 8 Jun 2023 20:40:03 +0200 Subject: [PATCH] docs: update flat config default ignore patterns (#17258) --- .../src/use/configure/configuration-files-new.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/src/use/configure/configuration-files-new.md b/docs/src/use/configure/configuration-files-new.md index 083be3d93c9..857089775e2 100644 --- a/docs/src/use/configure/configuration-files-new.md +++ b/docs/src/use/configure/configuration-files-new.md @@ -145,7 +145,21 @@ export default [ ]; ``` -This configuration specifies that all of the files in the `.config` directory should be ignored. This pattern is added after the default patterns, which are `["**/node_modules/**", ".git/**"]`. +This configuration specifies that all of the files in the `.config` directory should be ignored. This pattern is added after the default patterns, which are `["**/node_modules/", ".git/"]`. + +You can also unignore files and directories that are ignored by the default patterns. For example, this config unignores `node_modules/mylibrary`: + +```js +export default [ + { + ignores: [ + "!node_modules/", // unignore `node_modules/` directory + "node_modules/*", // ignore its content + "!node_modules/mylibrary/" // unignore `node_modules/mylibrary` directory + ] + } +]; +``` Note that only global `ignores` patterns can match directories. `ignores` patterns that are specific to a configuration will only match file names.