Typescript - How to compile even if errors

The whole point in using typescript is to catch bugs & errors before or at last during compilation . You should not ignore typescript errors .

While I completely agree with this statement, there are scenarios where it’s just not controllable by you, especially when working with 3rd party libs. In addition to the workarounds mentioned already in this thread, you can also add a // @ts-ignore comment above the problematic line to make TypeScript ignore any errors with this line, or add a // @ts-nocheck comment on top of the file to turn off any TypeScript checks for this file completely.

I must warn you, this can be considered bad practice as you basically undermine what TypeScript is made for.

2 Likes