typescript - can tsc be run against an entire folder?

Not that I know of. Using tsc from the command line without a tsconfig.json requires that you specify each file individually, like so:

tsc MyFile1.ts MyFile2.ts MyFile3.ts

However, it looks like you can simply create an empty tsconfig.json (i.e. just {}) at the root of your TypeScript directory and it will do what you want. From 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.


You can use globs

tsc x/file1.ts x/file2.ts x/file3.ts

should be equivalent to

tsc x/*.ts

Tags:

Typescript