TypeScript ignore error


TL;DR: to ignore a line:

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore

To disable type checking for an entire file, add the comment to the top of the file:

// @ts-nocheck

To disable the compiler error for a single line, add the comment before the line:

// @ts-ignore

If you’re getting the lint error:

error  Do not use "@ts-ignore" because it alters compilation errors  @typescript-eslint/ban-ts-comment

Add the comment above // @ts-ignore:

// eslint-disable-next-line @typescript-eslint/ban-ts-comment


Please support this site and join our Discord!