Configuration File
Rslint uses JS/TS module configuration with a flat config array aligned with ESLint v10.
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 ignores plus optional name or basePath, with no configuration fields) 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:
Path resolution and basePath
Relative config paths normally resolve from the config entry's authored directory. Use basePath to give one entry a different starting directory. See the basePath configuration reference for its complete matching, TypeScript project, config-source, and .gitignore behavior.
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
ignoresplus optionalnameorbasePath, with no configuration fields, remove 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.
Migrating a legacy JSON configuration
Rslint no longer loads rslint.json or rslint.jsonc while linting. Passing one to --config is rejected; automatic discovery ignores those filenames.
Run rslint --init in a project that still has a legacy JSON/JSONC file to migrate it to a JS/TS module config. The migration preserves custom rules and settings while deduplicating rules already covered by recommended presets.