Skip to content

shouldIgnoreFile

shouldIgnoreFile(filePath, rootDir, customPatterns?, enabled?): boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/utils/aiignoreUtils.ts:119

Check if a file path should be ignored based on aiignore patterns

Matching follows .gitignore rules — a bare pattern applies at every depth, a pattern with a separator is anchored to rootDir, and either kind hides the subtree beneath whatever it matches. The module-private expandPattern above implements that mapping and documents the two deliberate departures from .gitignore.

string

The file path to check

string

The root directory for relative pattern matching

string[] | undefined

Optional custom patterns to use instead of loading from file

boolean = true

Whether aiignore is enabled

boolean

True if the file should be ignored, false otherwise