TypeScript Compiler Options

noResolve — TypeScript compiler option

Prevents imports and triple-slash references from automatically expanding the program input set. Imports must still resolve. Explicitly listing the dependency can restore checking. Default (5.8.3): false. Create the labeled files in an isolated project and run tsc -p tsconfig.json. No diagnostics; output: none. Local project fixture, not a single-file editor.

Formal Syntax & Structure

typescript syntaxtypescript
{  "compilerOptions": {    "noResolve": true  }}

Parameters & Attributes

NameTypeDescription
noResolvebooleanSet in compilerOptions; default: false.

Working Example

Example Snippettypescript
// File: tsconfig.json (omit this label){  "compilerOptions": {    "target": "ES2022",    "module": "CommonJS",    "strict": true,    "types": [],    "noEmitOnError": true,    "noEmit": true,    "noResolve": true  },  "files": [    "main.ts",    "dep.ts"  ]}// File: main.tsimport { value } from "./dep";const count: number = value;// File: dep.tsexport const value = 7;
TypeScript Reference