Lev
Lev

Reputation: 15654

typescript compilation errors never stop compilation

Below is the content of the index.ts file that I am transpiling to js with default settings of tsconfig --init (tsc v3.2.4)

console.log("foo");
these crazy typos will compile all though compilation raises errors
console.log("bar")

The typescript compiler will output a build whatever the input may be.

Is there a way to control this ?

For example: make typescript compiler output nothing if errors are raised during compilation.

Upvotes: 2

Views: 2658

Answers (1)

blackening
blackening

Reputation: 953

Take a look at the noEmitOnError flag in https://www.typescriptlang.org/docs/handbook/compiler-options.html

Upvotes: 3

Related Questions