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.

Top comments (0)