Skip to main content
On this page

deno check type-checks your TypeScript (or JavaScript) code without running it. This is useful in CI pipelines or before deploying to catch type errors early. For more on TypeScript in Deno, see the TypeScript guide.

Basic usage Jump to heading

›_
deno check main.ts

Check multiple files:

›_
deno check src/server.ts src/utils.ts

Scoping and excluding files Jump to heading

You can pass directories or globs as positional arguments to type-check a whole tree at once:

›_
deno check src/
deno check "src/**/*.ts"

To skip files or directories, use the top-level exclude field in deno.json. It applies to deno check along with other subcommands like deno fmt and deno lint:

deno.json
{
  "exclude": ["dist/", "vendor/", "**/*.generated.ts"]
}

See include and exclude in the configuration reference for the full glob syntax, including how to un-exclude a sub-path.

Type-checking remote modules Jump to heading

By default, only local modules are type-checked. Use --all to also type-check remote dependencies:

›_
deno check --all main.ts

Type-checking JavaScript files Jump to heading

If you have a JavaScript project and want to type-check it without adding // @ts-check to every file, use the --check-js flag:

›_
deno check --check-js main.js

Using in CI Jump to heading

deno check exits with a non-zero status code if there are type errors, making it suitable for CI pipelines:

›_
deno check main.ts && echo "Types OK"

Note that deno test and deno bench already perform type-checking by default, so you don't need a separate deno check step if you're already running tests. Use deno check when you want to type-check without running anything — for example, as a fast early step in CI:

›_
deno check main.ts
deno lint
deno test
Command line usage:
check

Type-check the dependencies

Options Jump to heading

Type-check all code, including remote modules and npm packages.

--allow-import, -I
Jump to heading

Allow importing from remote hosts. Optionally specify allowed IP addresses and host names, with ports as necessary. Default value: deno.land:443,jsr.io:443,esm.sh:443,raw.esm.sh:443,cdn.jsdelivr.net:443,raw.githubusercontent.com:443,gist.githubusercontent.com:443.

--cached-only
Jump to heading

Require that remote dependencies are already cached.

Load certificate authority from PEM encoded file.

Use this argument to specify custom conditions for npm package exports. You can also use DENO_CONDITIONS env var. .

Configure different aspects of deno including TypeScript, linting, and code formatting. Typically the configuration file will be called deno.json or deno.jsonc and automatically detected; in that case this flag is not necessary.

--deny-import
Jump to heading

Deny importing from remote hosts. Optionally specify denied IP addresses and host names, with ports as necessary.

Type-check using the type definitions for deno desktop.

Type-check code blocks in JSDoc as well as actual code.

Type-check code blocks in JSDoc and Markdown only.

--frozen-lockfile
Jump to heading

Error out if lockfile is out of date.

Load import map file from local file or remote URL.

Value of globalThis.location used by some web APIs.

Check the specified lock file. (If value is not provided, defaults to "./deno.lock").

--min-dep-age
Jump to heading

(Unstable) The age in minutes, ISO-8601 duration or RFC3339 absolute timestamp (e.g. '120' for two hours, 'P2D' for two days, '2025-09-16' for cutoff date, '2025-09-16T12:00:00+00:00' for cutoff time, '0' to disable).

Skip type-checking. If the value of "remote" is supplied, diagnostic errors from remote modules will be ignored.

--no-clear-screen
Jump to heading

Do not clear terminal screen when under watch mode.

--no-code-cache
Jump to heading

Disable V8 code cache feature.

--no-config
Jump to heading

Disable automatic loading of the configuration file.

Disable auto discovery of the lock file.

Do not resolve npm modules.

--no-remote
Jump to heading

Do not resolve remote modules.

--node-modules-dir
Jump to heading

Selects the node_modules directory mode for npm packages (not a path). One of: auto (create a local node_modules directory and install npm packages into it), manual (use the existing local node_modules directory, do not modify it), none (do not use a local node_modules directory; resolve npm packages from the global cache). Defaults to auto when the flag is passed without a value.

--node-modules-linker
Jump to heading

Sets the linker mode for npm packages (isolated or hoisted).

A list of files that will be executed before the main module.

--reload, -r
Jump to heading

Reload source code cache (recompile TypeScript). With no value, reloads everything. Pass a comma-separated list of specifiers to reload only those modules; npm: reloads all npm modules; npm:chalk reloads a single npm module; jsr:@std/http/file-server,jsr:@std/assert/assert-equals reloads specific modules.

A list of CommonJS modules that will be executed before the main module.

Set the random number generator seed.

--unsafely-ignore-certificate-errors
Jump to heading

DANGER: Disables verification of TLS certificates.

To see a list of all available flags use --v8-flags=--help Flags can also be set via the DENO_V8_FLAGS environment variable. Any flags set with this flag are appended after the DENO_V8_FLAGS environment variable.

Toggles local vendor folder usage for remote modules and a node_modules folder for npm packages.

Watch for file changes and restart process automatically. Only local files from entry point module graph are watched.

--watch-exclude
Jump to heading

Exclude provided files/patterns from watch mode.

Last updated on

Did you find what you needed?

Edit this page
Privacy policy