No compilation error without d.ts files

前端 未结 2 562
暗喜
暗喜 2020-12-22 05:14

I would like that the compilation of my TypeScript application fails if I don\'t have the typings (installed and references in TypeScript files) corresponding to external li

相关标签:
2条回答
  • 2020-12-22 05:48

    One quick way to make the compiler shut up is to declare the toastr variable as any.

    declare toastr: any;
    
    0 讨论(0)
  • 2020-12-22 06:02

    By default TypeScript will emit JavaScript even in the presence of errors. This is a feature. See Why TypeScript.

    That said you have in your tsconfig "noEmitOnError": false,. If you change it to true you will not get an emit if there is any error. Please note that this can decrease incremental compilation performance as the compiler needs to do whole program analysis even to give an emit on a single file.

    0 讨论(0)
提交回复
热议问题