I am running tsc
in the terminal.
Each time I save a file the TypeScript compiler it emits:
[2:05:49 PM] File change detected. Starting incremental compilation...
[2:05:49 PM] Found 0 errors. Watching for file changes.
How do I prevent the TypeScript compiler from outputting these messages? I would like a "silent" compilation on save and I can't seem to find any applicable flags in the documentation.
Thanks.
Based on a brief look through the TypeScript source, this doesn't seem possible to suppress with any flags because it will log when reporting the watch host status (see here).
What you could do is setup your own incremental watcher by following the steps at the following link and provide your own WatchStatusReporter
that doesn't log:
That's a lot of work though and maintaining your own custom watcher might introduce its own set up problems and limitations. Maybe just suppress the output?
# powershell / windows command prompt
tsc --watch >null
# bash
tsc --watch >/dev/null
That suppresses the diagnostics too though and limiting that to only standard out doesn't help (seems the diagnostics aren't logged to standard error). Maybe it would be good to open an issue on the TypeScript repo to request disabling outputting the watch status.