Do not create JavaScript files on errors #828
Labels
Fixed
A PR has been merged for this issue
Help Wanted
You can do this
Suggestion
An idea for TypeScript
Milestone
It seems that the TypeScript compiler still produces JavaScript output when the .ts files contains errors:
Compiling this file gives me an error message:
E:/tmp/typescripttest/Errors.ts(3,1): error TS2082: Supplied parameters do not match any signature of call target:
Could not apply type 'string' to argument 1 which is of type 'number'.
E:/tmp/typescripttest/Errors.ts(3,1): error TS2087: Could not select overload for 'call' expression.
But nevertheless a .js is created.
This seems odd to me. If a compiler reports an error, I do not expect it to create an output file and do as if the compilation would succeed. So the hint which tsc is giving me here is more of a type of a warning: There is something wrong, but the compiler still tries to continue.
Why is this important?
People tend to "ignore" the errors if they are not fatal.
Additionally, this heavily confuses our CI server, since the error just "disappears" on the next build (we do not recompile the tsc if they are older than the resulting JavaScript).
The text was updated successfully, but these errors were encountered: