Type Checking
Rslint runs TypeScript semantic type-check alongside or instead of lint rules — a drop-in replacement for tsc --noEmit in CI.
--type-check— lint rules and type-check, in one pass.--type-check-only— type-check only; lint phase is skipped entirely.
Quick start
Point rslint at your tsconfig(s) via languageOptions.parserOptions.project:
Then:
When parserOptions.project is omitted, rslint uses tsconfig.json in the governing config directory when present. If neither configured projects nor that fallback tsconfig exist, no real TypeScript Program is built and type-check produces no diagnostics for that config.
What gets type-checked
parserOptions.project accepts one or more tsconfig paths:
Each normalized declared tsconfig path in the effective loaded config catalog produces one TypeScript Program, even when multiple rslint configs reference that path. Parent global ignores can prevent a nested config from entering that catalog during directory discovery. File-symlink declarations remain distinct because TypeScript resolves relative paths from the declared location. Rslint retains every config association and project declaration order for lint-rule binding. Type-check runs over every real Program independently.
After the effective config catalog is established, each Program's type-check scope is its tsconfig include / files minus exclude. The following lint-phase concepts do not filter that Program scope:
- rslint config's
filespatterns - rslint config's
ignorespatterns (root-level or per-entry) .gitignore- CLI file / directory arguments —
rslint --type-check-only foo.tsstill type-checks every file in the program(s), not justfoo.ts
If a file is included by tsconfig but matched by rslint ignores, lint rules do not run on it, but type errors for it are still reported. To exclude it from type-check as well, add it to the tsconfig's exclude or prepend // @ts-nocheck to the file.
Gap files
Selected files that are not present in any tsconfig Program declared by their governing config (root-level scripts, ad-hoc config files, etc.) are called gap files. They receive a non-project-backed fallback Program, so rules that do not require type information still run while type-aware rules do not. The program-wide type-check phase also skips the fallback. To enable type information, add the file to one of the governing config's tsconfigs or declare a dedicated project there.
Output
Type errors carry TypeScript(TS<code>) as the rule name and severity error:
Chained errors indent the TypeScript message chain:
Type errors appear in every output format (default, jsonline, github, gitlab).
Summary line
Three templates depending on mode:
In combined mode, linted counts files visited by the lint phase, while type-checked counts unique root files across every real tsconfig Program. The counts can differ because lint targets and rslint ignores do not restrict program-wide type-check. In color-enabled terminals, the complete parenthesized execution details are rendered dim.
Exit codes
Alignment with tsc --noEmit
For any given program, --type-check (and --type-check-only) produces the same diagnostics as tsc --noEmit / tsgo --noEmit — same error code, same file, same line and column.
One intentional difference: TypeScript diagnostics without a source-file anchor (e.g. TS18003 "No inputs were found in config file", TS5108 removed-option warnings) are not reported, because rslint output is per file. Run tsc --noEmit directly to surface these configuration-level errors.
Replacing tsc --noEmit in CI
For inline annotations on PR diffs:
If your CI keeps lint and type-check as separate jobs, use --type-check-only in the type-check job:
--type-check-only
Skips every lint rule and runs only the type-check phase. Use this when CI splits "type-check" and "lint" into separate steps and you want the type-check step to pay zero lint-side cost.
--type-check-only implies --type-check; passing both is redundant.
vs. --type-check
* The lint phase emits per-file stderr warnings like <file> was not found, skipping and <file> is ignored because of a matching ignore pattern. In --type-check-only the lint phase doesn't run, so these are suppressed — they would otherwise mislead users into thinking the file wasn't type-checked, when in fact Phase 2 is independent of CLI scope and rslint ignores (see What gets type-checked).