Skip to content

Commit 803e4af

Browse files
authored
docs: simplify gitignore path handling in includeIgnoreFile section (#19596)
1 parent 6d979cc commit 803e4af

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

docs/src/use/configure/ignore.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,9 @@ If you want to include patterns from a `.gitignore` file or any other file with
183183
// eslint.config.js
184184
import { defineConfig } from "eslint/config";
185185
import { includeIgnoreFile } from "@eslint/compat";
186-
import path from "node:path";
187186
import { fileURLToPath } from "node:url";
188187

189-
const __filename = fileURLToPath(import.meta.url);
190-
const __dirname = path.dirname(__filename);
191-
const gitignorePath = path.resolve(__dirname, ".gitignore");
188+
const gitignorePath = fileURLToPath(new URL(".gitignore", import.meta.url));
192189

193190
export default defineConfig([
194191
includeIgnoreFile(gitignorePath),

0 commit comments

Comments
 (0)