'Exclude line of code from being compiled without ts-ignore

I use ESLint with Angular v13.

I got the following lint error while using // @ts-ignore:

Do not use "// @ts-ignore" comments because they suppress compilation errors @typescript-eslint/ban-ts-ignore

Seems @typescript-eslint doesn't recommend the use of @ts-ignore.

Is there any alternative way to tell the TypeScript compiler to ignore a specific line from the code?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source