@ts-ignore is almost always the worst option

· Evan Hahn · Sept. 21, 2025, 4:31 p.m.
Summary
In TypeScript, using // @ts-expect-error is preferred over @ts-ignore for suppressing errors, as it alerts you to unnecessary directives. For specific type ignoring, 'any' can be more useful. Alternatively, fixing errors is the best approach. The post discusses these techniques and suggests avoiding @ts-ignore except in rare cases like supporting multiple versions of TypeScript.
AUTHOR
Sponsored
Zulip logo Zulip
Organized team chat for people who take work seriously. Topic-based threading keeps conversations focused.
Try Zulip
Become a sponsor →
BLOG POST FEATURED ON

Add this plugin to your blog