Skip to content

Commit 40dbe2a

Browse files
authored
docs: fix mismatch between globalIgnores() code and text (#19914)
docs: Update paragraphs to reference globalIgnores() helper examples
1 parent 76c2340 commit 40dbe2a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/src/use/configure/ignore.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ You can configure ESLint to ignore certain files and directories while linting b
2323

2424
## Ignoring Files
2525

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:
2727

2828
```js
2929
// eslint.config.js
@@ -43,7 +43,7 @@ You can also ignore files on the command line using [`--ignore-pattern`](../comm
4343

4444
## Ignoring Directories
4545

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):
4747

4848
```js
4949
// eslint.config.js
@@ -127,8 +127,8 @@ You can also unignore files on the command line using [`--ignore-pattern`](../co
127127

128128
How glob patterns are evaluated depends on where they are located and how they are used:
129129

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.
132132
1. When using [`--ignore-pattern`](../command-line-interface#--ignore-pattern), glob patterns are evaluated relative to the current working directory.
133133

134134
## Name the Global Ignores Config

0 commit comments

Comments
 (0)