When developing a typescript project I run the compiler in watch mode:
tsc --watch
Yet when an error appears, I find it hard to discern in the output as I have plain formatted text:
Often time I don't even read it, as there are multiple outputs from previous runs.
I currently am trying to ease my pain by grepping for errors in order to mark those line in red:
tsc -w | egrep --color '.*error.*|$'
yet that feels hackish. Is there a more easy way to get errors printed out nicely in typescript?
TypeScript supports multiple compiler options, and one of them is pretty
:
Stylize errors and messages using color and context.
Alas, it defaults to false
so you have to enable it in your .tsconfig
:
{
"compilerOptions": {
"pretty": true
}
}
Then you get colors and more context information:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With