TypeScript Compiler Options
listFiles — TypeScript compiler diagnostics
Lists source and declaration files included in a compilation, including transitive dependencies and libraries. It does not explain why a file entered the program and does not prevent normal checking or emission. Use explainFiles for inclusion reasons or listFilesOnly to stop after listing. Baseline: TypeScript 5.8.3. Default: false. Create the labeled files in an isolated directory and run the commands below. The list includes index.ts, dep.ts and lib.es5.d.ts, without JavaScript output because noEmit is also enabled.
Formal Syntax & Structure
typescript syntaxtypescript
{ "compilerOptions": { "listFiles": true }}Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| listFiles | boolean | Compiler option; default: false. |
Working Example
Example Snippettypescript
// File: tsconfig.json (omit this label){ "compilerOptions": { "target": "ES5", "module": "CommonJS", "lib": [ "ES5" ], "strict": true, "types": [], "outDir": "dist", "noEmitOnError": true, "listFiles": true, "noEmit": true }, "files": [ "index.ts" ]}// File: index.ts (omit this label)import { value } from "./dep";export const count = value;// File: dep.ts (omit this label)export const value = 7;
// Run these commands in order in an isolated project:// tsc -p . --pretty false