What is tsgo-strict?
tsgo-strict is a fast, strict-only TypeScript checker. It drives the native TypeScript compiler shipped in TypeScript 7 or later (the typescript package, formerly the tsgo native preview) and emits only the diagnostics you would see if strict mode were turned on for a specific subset of your project — enabling a file-by-file or path-by-path migration to strict: true.
It is written in Rust and distributed through per-platform npm packages (a tsgo-strict launcher plus one prebuilt binary + N-API addon per target, resolved via optionalDependencies).
What it does
- Reads
typescript-strict-pluginconfig fromcompilerOptions.plugins. - Honors
// @ts-strict/// @ts-strict-ignorepragmas. - Supports checking an explicit subset of files or globs from the CLI.
- Runs
tsgoonce with"strict": trueenabled, scoped to the selected files, and reports the diagnostics it produces.
Why you'd use it
Flipping "strict": true on a large, legacy codebase typically surfaces thousands of errors at once. tsgo-strict lets you enable strict mode only for the files or paths that are ready, so you can migrate incrementally without drowning the build.
You opt files in via one of:
- A plugin config in
tsconfig.jsonlisting the paths (and optional exclude regex) that should be checked strictly. See Configuration. - A
// @ts-strictcomment at the top of a file to force it into scope. - A
// @ts-strict-ignorecomment to force a file out of scope, even if the plugin paths would match it.
See Pragmas for precedence rules.
Everything else is checked under your normal, non-strict tsconfig settings and its errors are filtered out of the output.
What it's not
- Not a replacement for
tsc. Usetsc(ortsgo) for your normal build.tsgo-strictruns alongside them and reports only the strict diagnostics you care about during migration. - Not a code transformer. It doesn't edit files or auto-fix errors.
- Not a watch-mode checker. It runs once and exits.