deno.json (or deno.jsonc) file in your project root. This file allows you to customize TypeScript compiler options, define tasks, configure linting and formatting, manage imports, and more.
Basic Configuration
Create adeno.json file in your project root:
deno.json
Compiler Options
ThecompilerOptions field instructs the TypeScript compiler how to compile .ts files:
deno.json
Common Compiler Options
Type Checking Options
Type Checking Options
strict- Enable all strict type checking options (default:true)noImplicitAny- Error on expressions with impliedanytype (default:true)strictNullChecks- Considernullandundefinedin type checking (default:true)noUnusedLocals- Error when local variables aren’t read (default:false)noUnusedParameters- Error when function parameters aren’t read (default:false)
JSX Options
JSX Options
jsx- Specify JSX code generation:"preserve","react","react-jsx","react-jsxdev","react-native", or"precompile"jsxFactory- JSX factory function (default:"React.createElement")jsxFragmentFactory- JSX Fragment reference (default:"React.Fragment")jsxImportSource- Module specifier for JSX factory functions (default:"react")
Module Options
Module Options
lib- Bundled library declaration files (default:["deno.window", "deno.unstable", "node"])module- Module code generation:"esnext","nodenext", or"preserve"moduleResolution- Module resolution strategy:"nodenext"or"bundler"
Tasks
Define custom commands that can be run withdeno task:
deno.json
Permissions
Define named permission sets that can be referenced in test, bench, or compile configurations:deno.json
Permission Types
all- Allow all permissions (run unrestricted)read- File system read accesswrite- File system write accessnet- Network accessenv- Environment variable accessrun- Subprocess executionffi- Foreign function interfacesys- System information accessimport- Dynamic import permissions
- Boolean:
true(allow all) orfalse(deny all) - Array: specific allowed items
["./data", "./config"] - Object: with
allow,deny, and/orignorefields
Lint and Format Configuration
Linting
deno.json
Formatting
deno.json
Node Modules Directory
Configure how Deno manages npm packages:deno.json
"auto"- Automatically create node_modules when needed"manual"- Only use node_modules if it exists"none"- Never use node_modules (default)true- Enable node_modules (legacy, equivalent to"auto")false- Disable node_modules (legacy)
Lock File
Configure dependency integrity checking:deno.json
deno.json
Test and Bench Configuration
deno.json
Compile Configuration
Set default permissions for compiled executables:deno.json
Publish Configuration
Configure what gets published to JSR:deno.json
deno.json
Deploy Configuration
Configure Deno Deploy settings:deno.json
Unstable Features
Enable specific unstable features:deno.json
Workspaces
Define workspace members for monorepos:deno.json
deno.json
Exclude Files
Exclude files or directories from all Deno operations:deno.json
Full Example
Here’s a comprehensive configuration example:deno.json