gpt4 book ai didi

typescript - tsc 可以针对整个文件夹运行吗?

转载 作者:搜寻专家 更新时间:2023-10-30 20:31:02 26 4
gpt4 key购买 nike

我很惊讶这不在我能找到的文档中 - 但是有什么方法可以告诉 tsc 对目录及其子目录中的所有文件运行而无需经过整个 tsconfig.json 设置?

最佳答案

据我所知没有。在没有 tsconfig.json 的命令行中使用 tsc 需要您单独指定每个文件,如下所示:

tsc MyFile1.ts MyFile2.ts MyFile3.ts

但是,看起来您只需在 TypeScript 目录的根目录下创建一个空的 tsconfig.json(即只是 {}),它就会执行您的操作想。来自 https://github.com/Microsoft/TypeScript/wiki/tsconfig.json :

If no "files" property is present in a tsconfig.json, the compiler defaults to including all TypeScript (*.ts or *.tsx) files in the containing directory and subdirectories.

关于typescript - tsc 可以针对整个文件夹运行吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35734366/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com