Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Basically, it fulfills the role of a linter like eslint but with more thorough checking.
It checks your static typing across the code before the code running.
Unit testing is better to catch errors.
But checking static typing can be important too at least at big code base for additional testing coverage percent. -
Looking at TypeScript as independent language is another problem. Don't get it wrong - TypeScript wasn't intended (because it cannot) fix runtime issues of JavaScript itself.
It's an ecosystem. I can't imagine serious big ass libraries today without TypeScript typings. Community can create typings separately from the main package and enjoy the type safety.
TypeScript doesn't hold you back, when you place operators that you supposedly know what to do with them, and neither does it hold you by hand and tell you what conventions should be followed in the project. But we need it to make JavaScript a little bit sane. Let JS in the wild, and it will definitely shoot you in the leg. -
@darkwind honest question, do you know of any linters that will tell you wether or not the parameters you're passing into a function have the type expected by the function?
-
Use TypeScript when @jsdoc is not enough for type hints, auto complete suggestions and warnings in the IDE.
-
@black-kite I am more of a python ecosystem
Quite fresh to js, but regardless if to Google
"JavaScript static type checker"
It yields Flow instrument, besides recommendation to use typescript
https://ageek.dev/static-type-check...
Perhaps to try Flow, especially if u a using react. Flow is Facebookish invention -
typescript looks after some of javascript's shortcomings. one that i remember is the variable scope issue
-
It tries to make a static representation of JavaScript and does it well.
I can not count how many times TypeScript has saved me when doing refactoring work. -
we need TypeScript because JavaScript's (non-existent) handling and enforcement of types is horrible, just like most of JavaScript is.
we shouldn't use TypeScript, because it disables basically the only upside of JavaScript.
yes, i know what i just said.
Related Rants
Someone explain typescript to me , I still don't get why we need it?
question
typescript