Quick start · project shape

Type-checked JavaScript for Deno

Deno ships with TypeScript's checker built in, so there is nothing to install: deno check checks your project. Per the Deno documentation, it checks .js files when you ask for it: checkJs in the config, a // @ts-check comment, or deno check --check-js. JSDoc types work the same way as with tsc.

  • Deno
  • Nothing to install
  • deno task lint

Also per the Deno documentation, since Deno 2.1 a jsconfig.json is picked up when the project has a package.json, which is the setup below. We did not run Deno for this page: the example is checked with tsc (TypeScript 5.9) using the same jsconfig.json, and it uses only web APIs that both checkers know.

Install

Nothing beyond Deno. deno task lint runs the script below: per the Deno documentation, deno task falls back to the scripts in package.json when there is no task of that name in a deno.json.

Terminal
deno task lint

jsconfig.json

checkJs is the line that matters to Deno; its default is false, so without it deno check skips .js files. Deno is strict by default, and strict keeps tsc in step. module: "nodenext" is Deno's own default and lets tsc read the file as an ES module. The config sets no lib, so each checker uses its own default: Deno its runtime types, tsc the standard library with the DOM.

Per the Deno documentation, Deno ignores options that only matter for writing output and warns about options it does not use in a tsconfig.json.

jsconfig.json
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "module": "nodenext",
    "types": []
  }
}

npm scripts

deno check . checks every JavaScript and TypeScript file under the folder.

package.json
{
  "type": "module",
  "scripts": {
    "lint": "deno check ."
  }
}

When Deno checks, and when it does not

Per the Deno documentation:

  • deno run does not check types; deno run --check does, before running
  • deno test and deno bench check by default
  • deno check checks local files; --all also checks remote modules and npm packages

Or a deno.json

A Deno-only project can skip package.json and jsconfig.json and turn on checking in deno.json. Per the Deno documentation, compilerOptions in deno.json take precedence over a tsconfig.json or jsconfig.json when both exist.

deno.json
{
  "compilerOptions": {
    "checkJs": true
  },
  "tasks": {
    "lint": "deno check ."
  }
}

Deno's own APIs

Code that uses the Deno namespace (Deno.serve, Deno.readTextFile) is checked by deno check, which has Deno's types; tsc does not know them. For deno serve, the Deno documentation types the default export with Deno.ServeDefaultExport, which in a .js file is a @satisfies tag on the exported object. The example below stays with Request and Response, which both checkers understand, so this site can check it.

main.js Error confirmed 5.9.3 TypeScript 5.9.3, run 21 October 2026: main.js(9,36): error TS2551: Property 'pathnme' does not exist on type 'URL'. Did you mean 'pathname'? 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. main.js(9,36): error TS2551: Property 'pathnme' does not exist on type 'URL'. Did you mean 'pathname'? 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. main.js(9,36): error TS2551: Property 'pathnme' does not exist on type 'URL'. Did you mean 'pathname'? checked 21 October 2026
/**
 * Answer every request with the path it asked for, as JSON.
 * @param {Request} request
 * @returns {Response}
 */
function handler(request) {
  const url = new URL(request.url);
  return Response.json({ path: url.pathnme });error TS2551: Property 'pathnme' does not exist on type 'URL'. Did you mean 'pathname'?
}

export default { fetch: handler };
A typo in a URL property.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "module": "nodenext",
    "types": []
  }
}

The example project

A default export with a fetch method, the shape deno serve expects, answering every request with JSON.

main.js TypeScript 5.9.3 TypeScript 5.9.3, run 21 October 2026: No errors. 6.0.3 TypeScript 6.0.3, run 21 October 2026: the same as 5.9.3. No errors. 7.0.2 TypeScript 7.0.2, run 21 October 2026: the same as 5.9.3. No errors. checked 21 October 2026
/**
 * Answer every request with the path it asked for, as JSON.
 * @param {Request} request
 * @returns {Response}
 */
function handler(request) {
  const url = new URL(request.url);
  return Response.json({ path: url.pathname });
}

export default { fetch: handler };
A request handler for deno serve, in JavaScript.
jsconfig.json for this example
{
  "compilerOptions": {
    "checkJs": true,
    "noEmit": true,
    "strict": true,
    "module": "nodenext",
    "types": []
  }
}

In your editor

Per the Deno documentation, VS Code needs the Deno extension, turned on for the workspace with the command "Deno: Initialize Workspace Configuration"; other editors start Deno's language server with deno lsp. Without it, the editor's built-in TypeScript checks the file as tsc would and does not know the Deno namespace.

Sources

Last reviewed 20 October 2026.