Ignoring Files
ignores
- Type:
string[]
Glob patterns for files to exclude. An entry containing only ignores and an optional name acts as a global ignore: matching files are removed from the lint target set. An entry-level ignore prevents that entry's files selector, rules, and options from contributing. It cannot remove a path selected by the default extension baseline or another entry, so such a path may still receive configuration or a zero-rule syntax pass.
The globalIgnores helper
Writing an entry with only ignores is common enough that @rslint/core exports a globalIgnores helper, mirroring ESLint v10. It returns a config entry containing just the given patterns, so the global-ignore intent is explicit:
This is exactly equivalent to writing the entry by hand:
globalIgnores throws a TypeError if it receives a non-array or an empty array.
Pattern types in global ignores
Global ignore patterns affect both file matching and directory traversal (including config discovery in monorepos):
Use dir/** to completely exclude a directory. Use dir/**/* when the walker must still enter the directory so later negations can make selected files or config candidates reachable. An automatically discovered rslint.config.* that still matches the file-cover ignore is not loaded; explicitly negate that candidate when you want it to become a config boundary.
You can use ! negation patterns to re-include specific files. Patterns are evaluated sequentially — later patterns override earlier ones:
For directory-level patterns (dir/**), ! negation cannot re-include files because the directory traversal is blocked entirely. Use dir/**/* instead if you need negation:
node_modules and .git are automatically excluded by rslint — you don't need to add them to ignores.
.gitignore integration
The CLI, JavaScript API, and LSP automatically read .gitignore files and treat their patterns as additional global ignores. Collection starts at the directory of the governing rslint config and never searches its parents. In a multi-config repository, a child config starts a new .gitignore scope, so put package-specific ignores beside that package's config. In the editor, saved .gitignore changes refresh diagnostics for open files.
- Nested
.gitignorefiles inside one config-owned tree are supported — each one only affects its own directory subtree - Parent patterns cascade to child directories within that tree (e.g., root
dist/also ignorespackages/app/dist/when both use the root config) - Child
.gitignorecan override parent patterns with!negation - Child configs are boundaries — they do not inherit
.gitignorefiles from a parent config directory - Config
!negation can also override.gitignorepatterns (they are evaluated sequentially in the same global ignores list)
To make a lint target reachable, re-include it in the applicable .gitignore policy or with a later global ignore entry in rslint.config.*:
Configuration discovery is independent of .gitignore: an automatically discovered or explicitly selected rslint.config.* is still loaded when its path matches an ignore rule. .gitignore is applied later, when Go selects lint targets inside that config's ownership scope.