DEV Community

Discussion on: Pitch me on TypeScript

Collapse
 
nickytonline profile image
Nick Taylor • Edited

I've written about it before, but the big things for me are the refactoring story, discoverability, avoiding silly mistakes, and adopting into as much type safety as you want. For example, you can add TypeScript (TS) to your project and enable the compiler options to allow for JavaScript (JS) files. Just that alone you'll already see a benefit. I would suggest being as strict as possible, but when migrating a project from JS, this is a great way to do this.

Generics and having types inferred from other types is what also makes it super powerful. Is it a silver bullet, no, but it's a great tool.

And even if you don't use TypeScript, you still get a lot of its benefits if you're using an editor like VS Code. It's what provides Intellisense and refactoring to your JS projects (as well as TS projects)

#vscode

Official tag for Visual Studio Code, Microsoft's open-source editor