Take a look at the following TypeScript code snippet:
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();
The current issue is:
"A function that doesn't have a return type of 'void' or 'any' must return a value. An object representing a numerical value, derived from any JavaScript numbers having 64-bit floating-point precision."Upon executing the tsc command, it generates the corresponding JS file even with errors in the TypeScript file. Is there a way to prevent the generation of the JS file until all TypeScript errors are resolved?