編譯器配置項(xiàng)-compilerOptions
編譯診斷配置項(xiàng)04
列出編譯文件 - listFiles
打印編譯部分的文件名稱与殃。當(dāng)您不確定 TypeScript 是否已包含您期望的文件時(shí)非常有用克蚂。
例如:
example
├── index.ts
├── package.json
└── tsconfig.json
tsconfig.json
配置如下:
{
"compilerOptions": {
"listFiles": true
}
}
將打印出如下路徑:
$ npm run tsc
path/to/example/node_modules/typescript/lib/lib.d.ts
path/to/example/node_modules/typescript/lib/lib.es5.d.ts
path/to/example/node_modules/typescript/lib/lib.dom.d.ts
path/to/example/node_modules/typescript/lib/lib.webworker.importscripts.d.ts
path/to/example/node_modules/typescript/lib/lib.scripthost.d.ts
path/to/example/index.ts
注意:如果使用 TypeScript 4.2,則首選啟用 explainFiles
配置項(xiàng)建芙,它也提供了添加編譯過程中為什么添加這些文件的原因的解釋漓滔。
禁止檢查 - noCheck
禁用完整的類型檢查(僅解析和輸出嚴(yán)重錯(cuò)誤時(shí)報(bào)告)戏自。
跟蹤方案 - traceResolution
當(dāng)您嘗試調(diào)試為什么未包含某個(gè)模塊時(shí)壁酬,您可以將 traceResolution
設(shè)置為 true
,讓 TypeScript 為每個(gè)已處理的文件打印有關(guān)其解析過程的信息辖所。