You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/use/configure/ignore.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ You can configure ESLint to ignore certain files and directories while linting b
23
23
24
24
## Ignoring Files
25
25
26
-
In your `eslint.config.js` file, if an `ignores` key is used without any other keys in the configuration object, then the patterns act as global ignores. Here's an example:
26
+
In your `eslint.config.js` file, you can use the `globalIgnores()` helper function to indicate patterns of files to be ignored. Here's an example:
27
27
28
28
```js
29
29
// eslint.config.js
@@ -43,7 +43,7 @@ You can also ignore files on the command line using [`--ignore-pattern`](../comm
43
43
44
44
## Ignoring Directories
45
45
46
-
Ignoring directories works the same way as ignoring files, by placing a pattern in the `ignores` key of a configuration object with no other keys. For example, the following ignores the `.config` directory as a whole (meaning file search will not traverse into it at all):
46
+
Ignoring directories works the same way as ignoring files, by passing a pattern to the `globalIgnores()` helper function. For example, the following ignores the `.config` directory as a whole (meaning file search will not traverse into it at all):
47
47
48
48
```js
49
49
// eslint.config.js
@@ -127,8 +127,8 @@ You can also unignore files on the command line using [`--ignore-pattern`](../co
127
127
128
128
How glob patterns are evaluated depends on where they are located and how they are used:
129
129
130
-
1. When using `ignores` in an `eslint.config.js` file, glob patterns are evaluated relative to the `eslint.config.js` file.
131
-
1. When using `ignores` in an alternate configuration file specified using the [`--config`](../command-line-interface#-c---config) command line option, glob patterns are evaluated relative to the current working directory.
130
+
1. When using `globalIgnores()` in an `eslint.config.js` file, glob patterns are evaluated relative to the `eslint.config.js` file.
131
+
1. When using `globalIgnores()` in an alternate configuration file specified using the [`--config`](../command-line-interface#-c---config) command line option, glob patterns are evaluated relative to the current working directory.
132
132
1. When using [`--ignore-pattern`](../command-line-interface#--ignore-pattern), glob patterns are evaluated relative to the current working directory.
0 commit comments