Mute/ignore TS2307 error from TypeScript tsc

前端 未结 3 644
悲&欢浪女
悲&欢浪女 2021-02-12 05:26

Is there a way to mute the TS2307 error from the TypeScript tsc compiler?

It makes it really hard to spot real/new errors and warnings as there are many

3条回答
  •  旧时难觅i
    2021-02-12 06:21

    UPDATE

    This is possible in newer version of TypeScript. See answer from stsloth.

    ORIGINAL ANSWER

    No, there is not a way to direct the compiler to suppress TS2307. There has been some discussion about it for exactly the reason you describe. For large projects, this becomes a huge barrier to entry.

    Details here: Making JavaScript to TypeScript migration easier : Suppress errors

    And here: Find a way to suppress the errors generated by importing modules

    What you might be able to do is add a step to your build process that filters the error messages. That, of course, depends on how you are doing your builds.

提交回复
热议问题