JavaScript file should not get generated if Typescript file has any error
<p>Consider below Typescript code</p>

<pre><code>class formal
{
    private startString: String = "";
    constructor(startString:String)
    {
        this.startString = startString;
    }

    public sayHello = function() :Number {
       alert(this.startString);
    }     

}

var myIntro = new formal("hello world");
myIntro.sayHello();
</code></pre>

<p>Currently It has following error
"<strong>A function whose declared type is neither 'void' nor 'any' must return a value.
An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers.</strong>"</p>

<p>But after running tsc command it is generating corresponding js file.
What I need is that it should not generate corresponding JS file until all the errors are resolved of typescript file.</p>

<p>Is there any way to achieve this?</p>