Configuration File
Rslint uses a flat config format (an array of config entries), aligned with ESLint v10. JS/TS configuration files are the recommended approach.
Supported filenames
During automatic discovery, Rslint checks config files in the following order:
rslint.config.jsrslint.config.mjsrslint.config.tsrslint.config.mts
Automatic discovery does not consider .cjs or .cts config files. They can still be selected explicitly with --config or API overrideConfigFile.
Config discovery
When you run rslint, it searches for a config file by walking upward from the target file or directory to the filesystem root. It uses the nearest candidate that loads successfully and falls back to an ancestor when a nearer candidate cannot be loaded.
rslint src/foo.ts— searches fromsrc/upwardrslint src/— searches fromsrc/upwardrslint(no args) — searches from the current working directory upward
In a monorepo, different files can automatically use different config files based on their location:
When linting from the monorepo root, Rslint automatically discovers all nested configs and applies the nearest one to each file.
Global ignores and nested configs
For directory or no-argument lint runs, global ignores in a parent config prevent nested configs in ignored directories from contributing lint targets.
With this config, a rslint.config.ts inside e2e/ or any fixtures/ directory is not used by a root directory traversal. An explicitly named file is still resolved from its nearest config.
Only global ignore entries (entries containing only ignores) block directory target discovery. Entry-level ignores do not affect config discovery. See ignores for the distinction.
You can specify a config file explicitly, which overrides automatic discovery:
For automatically discovered configs, relative files, ignores, and languageOptions.parserOptions.project patterns are resolved from the config file's directory.
For a config supplied with --config, those patterns are resolved from the current working directory.
To generate a default config, run:
Basic configuration
A typical TypeScript project configuration:
When using both JavaScript and TypeScript recommended presets, place js.configs.recommended before ts.configs.recommended. The TypeScript preset disables ESLint core rules that are handled by TypeScript-aware rules, and later config entries override earlier ones.
See the Configuration overview for every available option and Rules & Presets for the available presets.
Config merging
When multiple config entries match a file, they are merged in array order:
- Global ignores — entries containing only
ignoresremove files from the target set - Selector union — the implicit default baseline and effective explicit
filesentries decide whether the config selects the file - Files matching — entries whose explicit
filespatterns don't match are skipped; entries withoutfilescascade across the selector union - Entry-level ignores — matching entries do not select or configure the file, but cannot remove a target selected elsewhere
- Rules — later entries override earlier ones; a severity-only value retains earlier options
- Plugins — union from all matching entries
- Settings — ordinary nested objects merge recursively; arrays and scalar values are replaced
- Language options — ordinary nested objects merge recursively; arrays and scalar values are replaced
If no entry matches a selected file, no lint rules run for it, but the file is still parsed and included in the result so parser diagnostics remain visible. This applies to default-baseline files found during directory discovery as well as explicitly requested supported files. Global ignores remove matching targets; CLI and JavaScript API runs apply .gitignore as an additional global ignore source.
JSON configuration (deprecated)
JSON config files (rslint.json, rslint.jsonc) are deprecated and will be removed in a future version. Run rslint --init to automatically migrate your JSON config to a JS/TS config. The migration preserves your custom rules and settings while deduplicating rules already covered by recommended presets.
The key difference is that JSON configs automatically enable all core rules and declared plugin rules as "error". JS/TS configs only enable rules explicitly declared in presets or the rules field.