5
Vote

TypeScript compiler should accept wildcards

description

I should be able to execute this command line:

tsc "..\UnitTests*.ts" -target ES5

Note the use of *.ts. Right now I am forced to list each of my .ts files like this:

tsc "..\UnitTests\ArrayTests.ts" "..\UnitTests\StringTests.ts" -target ES5

This is tedious, un-maintainable, and error prone, especially if you consider the above example where I am relying on passing all of my unit tests using an automated build script. If I forget to include one script, then I might mistakenly think my tests are all passing.

Here's a workaround, but the wildcard syntax is much nicer and more efficient:

for /r "..\UnitTests" %%I in ("*.ts") do tsc "%%I" -target ES5

comments

RyanCavanaugh wrote Nov 28, 2012 at 9:07 PM

Assigning to Jonathan

catfriend wrote Nov 30, 2012 at 8:05 PM

The wildcard processing should be done by. It doesn't make sense to duplicate what the shell does for each command.

catfriend wrote Nov 30, 2012 at 8:05 PM

The wildcard processing should be done by the shell I meant to say.

catfriend wrote Nov 30, 2012 at 8:30 PM

It could be good to be able to pass a directory path to the typescript compiler though and have that make it process all the .ts files in that directory.

rb126 wrote Apr 30, 2013 at 10:11 AM

I used to get free glob support by linking my old C programs with setargv.obj (e.g., http://forums.devshed.com/c-programming-42/linking-to-setargv-obj-and-wildcards-90462.html).

Is there something similar for whatever tsc.exe is written in?

It would be really handy to be able to type:
tsc *.ts
to compile all the TypeScript in my project directory. As billyzkid said, it is unmaintainable to have to list each file on the command line. The similar command for, say, C++ works fine:
cl *.cpp
Please add simple globbing support to tsc.

JedrzejPaszkowski wrote Dec 10, 2013 at 9:46 AM

Maybe this will prevent Visual Studio from freezing while mouse hoovers tsc error on Error List. Now it's most annoying thing in developing in Type Script. Tooltip with all files has to be rendered and it takes 10-20 sec.