Skip to main content
The deno check command type-checks TypeScript and JavaScript files without executing them.

Usage

deno check [OPTIONS] [FILES]...

Description

Download and type-check files without execution. Unless --reload is specified, this command will not re-download already cached dependencies.

Flags

--all
boolean
Type-check all code, including remote modules and npm packages
--doc
boolean
Type-check code blocks in JSDoc as well as actual code
--doc-only
boolean
Type-check code blocks in JSDoc and Markdown only
--check-js
boolean
Enable type-checking of JavaScript files (equivalent to compilerOptions.checkJs: true)
--import-map
string
Load import map file
--lock
string
Check the specified lock file
--node-modules-dir
boolean
Enables or disables the use of a local node_modules folder for npm packages
--no-remote
boolean
Do not resolve remote modules
--no-npm
boolean
Do not resolve npm modules
--reload
boolean | string
Reload source code cache (recompile TypeScript)
--config
string
Specify the configuration file
--no-config
boolean
Disable automatic loading of the configuration file
--allow-import
string
Allow importing from specified hosts
--deny-import
string
Deny importing from specified hosts

Examples

Type-check a file

deno check main.ts

Type-check current directory

When no files are specified, checks the current directory:
deno check

Type-check with all dependencies

Include remote modules and npm packages:
deno check --all main.ts

Type-check JavaScript files

deno check --check-js script.js

Type-check JSDoc comments

Check type annotations in JSDoc:
deno check --doc main.ts

Type-check only documentation

Check code blocks in JSDoc and Markdown without checking the actual source:
deno check --doc-only README.md

Type-check multiple files

deno check src/main.ts src/utils.ts

Type-check with import map

deno check --import-map=import_map.json main.ts

Build docs developers (and LLMs) love