Skip to content

Commit 00e3e6a

Browse files
authored
docs: add support for custom name parameter to includeIgnoreFile (#19795)
1 parent 9bda4a9 commit 00e3e6a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/src/use/configure/ignore.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ This message occurs because ESLint is unsure if you wanted to actually lint the
179179

180180
If you want to include patterns from a [`.gitignore`](https://git-scm.com/docs/gitignore) file or any other file with gitignore-style patterns, you can use [`includeIgnoreFile`](https://github.com/eslint/rewrite/tree/main/packages/compat#including-ignore-files) utility from the [`@eslint/compat`](https://www.npmjs.com/package/@eslint/compat) package.
181181

182+
By default, `includeIgnoreFile()` will assign a name to the config that represents your ignores. You can override this name by providing a second argument to `includeIgnoreFile()`, which is the name you'd like to use instead of the default:
183+
182184
```js
183185
// eslint.config.js
184186
import { defineConfig } from "eslint/config";
@@ -188,7 +190,7 @@ import { fileURLToPath } from "node:url";
188190
const gitignorePath = fileURLToPath(new URL(".gitignore", import.meta.url));
189191

190192
export default defineConfig([
191-
includeIgnoreFile(gitignorePath),
193+
includeIgnoreFile(gitignorePath, "Imported .gitignore patterns"),
192194
{
193195
// your overrides
194196
},

0 commit comments

Comments
 (0)