deno check: Type-Check Without Running
deno check runs the TypeScript type-checker over a module graph without executing any code.
When you run scripts with --no-check for speed, deno check is the separate gate that still verifies types in CI.
What it does
deno check resolves the module graph from an entry point and type-checks it, reporting TS errors and exiting non-zero on failure. It does not run the program, so it is safe to run with no permissions.
Common usage
deno check main.ts
deno check --all main.ts
# also type-check JSDoc code blocks
deno check --doc main.tsOptions
| Flag | What it does |
|---|---|
| --all | Type-check all code, including remote (npm/jsr) dependencies |
| --doc | Type-check code examples in JSDoc and Markdown |
| --no-remote | Do not download remote modules; use cache only |
| --reload | Re-fetch and re-check, ignoring the cache |
In CI
Run deno check on entry points so a type error fails the build even when deno run uses --no-check for speed. Cache DENO_DIR first so dependency types are not re-downloaded. In Deno 1, this command was "deno check"; the older "deno cache" also performed type-checking.
Common errors in CI
Type errors surface as "TS2304 [ERROR]: Cannot find name ..." or "TS2345 [ERROR]: Argument of type ... is not assignable". "error: Module not found" means an import path or specifier is wrong. With --no-remote, "Specifier not found in cache" means DENO_DIR was not restored before the check.