Mute/ignore TS2307 error from TypeScript tsc

前端 未结 3 1675
长发绾君心
长发绾君心 2021-02-12 05:34

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条回答
  •  醉酒成梦
    2021-02-12 06:25

    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.

提交回复
热议问题