@ts-ignore is almost always the worst option

@ts-ignore is almost always the worst optionby Evan Hahn, posted Sep 21, 2025In short: in TypeScript, any and @ts-expect-error are almost always better than @ts-ignore.Sometimes, I want to ignore a TypeScript error without doing a proper fix. Maybe I’m prototyping and don’t need perfect type safety. Maybe TypeScript isn’t smart enough to understand a necessary workaround. Or maybe I’m unable to figure out a solution because I’m not a TypeScript expert!In these moments, I’m be tempted to reach for a // @ts-ignore comment, which will suppress all errors on the following line. For example, this code will report no errors even though the type of foo is wrong:// @ts-ignore const foo: string = 123; This quick fix is even recommended by editors like Visual Studio Code, and seems like…

Read more on Lobste.rs