TSConfig文件详解45

编译器配置项-compilerOptions

编译诊断配置项04

列出编译文件 - listFiles

打印编译部分的文件名称。当您不确定 TypeScript 是否已包含您期望的文件时非常有用。

例如:

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配置项,它也提供了添加编译过程中为什么添加这些文件的原因的解释。

禁止检查 - noCheck

禁用完整的类型检查(仅解析和输出严重错误时报告)。

跟踪方案 - traceResolution

当您尝试调试为什么未包含某个模块时,您可以将 traceResolution 设置为 true ,让 TypeScript 为每个已处理的文件打印有关其解析过程的信息。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容