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:
Without parserOptions.project no TypeScript program is built and type-check produces no diagnostics.
What gets type-checked
parserOptions.project accepts one or more tsconfig paths:
Each entry produces one TypeScript program. Type-check runs over every program independently.
The type-check scope is each tsconfig's include / files minus exclude — nothing in your rslint config or on the CLI changes it. Specifically, the following are lint-phase concepts that do not affect type-check 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
Files that match your rslint config's files pattern but are not in any tsconfig (root-level scripts, ad-hoc config files, etc.) are called gap files. Syntactic lint rules still run on them, but type-check skips them — semantic type information requires tsconfig coverage. To enable type-check for a gap file, add it to an existing tsconfig's include or create a dedicated tsconfig that covers it.
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).
Summary line
Three templates depending on mode:
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 in the project, 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).