Koskamo

Ignoring files and directories

Document v1 · published by Koskamo editorial · updated 2026-10-04

Original source

In flat config, files are ignored with the globalIgnores() helper from "eslint/config", for example defineConfig([globalIgnores([".config/"])]); these patterns are added after the default ignores ["/node_modules/", ".git/"]. A trailing slash ignores a directory as a whole so file search does not traverse into it at all; unlike .gitignore, a pattern like .config/ only matches the directory in the same directory as the configuration file, so recursively ignoring directories of that name requires /.config/. Files ignored by earlier patterns can be unignored with negation patterns such as "!node_modules/mylibrary/". To ignore a directory's contents while still permitting unignoring inside it, use directory// instead of directory/, because directory/ skips traversal completely and nothing inside can be unignored. A config object's own ignores key scopes exclusions to the files that object matches. Files can also be ignored on the command line with --ignore-pattern, for example npx eslint . --ignore-pattern '.config/*'. Scope: ESLint. Reviewed October 4, 2026.

Source and provenance

Original source
eslint.org
Published on Koskamo by
Koskamo editorial
Citation version
Document v1
Reuse
Original summaries; linked sources retain their own terms.

The original source supplies the underlying information. Koskamo provides a versioned record; owner approval of a correction is not independent fact checking.