TypeScript Compiler Options

synchronousWatchDirectory — TypeScript watch configuration

Requests synchronous directory-watcher callbacks and state updates on systems without native recursive watching. Deferred directory updates normally coalesce changes. Enabling this can change scheduling and overhead; this example validates configuration only, not platform-specific scheduling. Baseline: TypeScript 5.8.3. Default: false. Create the labeled files in an isolated project; omit file labels. Run the indicated command.

Formal Syntax & Structure

typescript syntaxtypescript
{  "watchOptions": {    "synchronousWatchDirectory": true  }}

Parameters & Attributes

NameTypeDescription
synchronousWatchDirectorybooleanWatch option; default: false.

Working Example

Example Snippettypescript
// File: tsconfig.json (omit this label){  "compilerOptions": {    "target": "ES2022",    "module": "CommonJS",    "strict": true,    "types": [],    "noEmit": true  },  "include": [    "src/**/*.ts"  ],  "watchOptions": {    "synchronousWatchDirectory": true  }}// File: src/index.ts (omit this label)export const count: number = 1;
// Run in a temporary project:// tsc -p . --showConfig
TypeScript Reference