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
-
Voxera113883yCode might complain if you have a linter installed but as far as i know js code is always functionally valid ts.
Typescript is a superset of js.
But often in ts you add a linter to enforce better practices available in ts. -
klutch3893yWhile you make the transition, set "allowJs" to true. You're getting 200 errors because that's the whole point of TS! Most of those are probably sythetic import, @type, and return errors. Totally common, and well worth it
-
I wasn’t sure if your rant was ironic or not until I’ve read the comments.
When you switched from js to ts, basically your runtime errors have been converted to compile time errors.
That‘s a good thing because now you can fix them easily without the need to debug.
TS doesn‘t magically fix anything. It is just assisting you in fixing the errors by telling you exactly where they are.
Everyone who says: "Just rename your .js file to .ts and it's going to work instantly, no errors, don't need to rewrite anything. WELL FUCK YOU ALL! VS code says: 200 errors in a 100(!) line file.
rant
js ts javascript typescript