DEV Community

Shailen Naidoo
Shailen Naidoo

Posted on

@ts-ignore is a symptom of a code smell

I never was a fan of TypeScript, I believe that TypeScript was a response to Java developers wanting to work on the front end. I believe that you can achieve what you need in terms of type inference using plain old JavaScript and JSDoc.

TypeScript is a marketing point from Microsoft to get developers to use their tools and technologies. The fact that TypeScript allows developers to use @ts-ignore to ignore the type-checking errors is a symptom of a far deeper problem thus a code smell.

The fact that @ts-ignore even exists is a signal of TypeScript's poor design as it creates an escape-hatch for developers to use when they have broken their typing somewhere in the application logic. This defeats the purpose of type-checking and leads to a broken application with another layer of complexity that is sprinkled on top of it. TypeScript is nothing more than fanfare to me with a breakable type-checking system.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay