by zwbetz · 5y ago · 0 comments
Although there are alternatives (Flow, for example), to me it seems like the community has picked TS as the way forward, so in my opinion TS is a very low risk technology with real benefits, so I wouldn't hesitate adding it to a project's tech stack.
It's here to stay and a big chunk of JavaScript developers enjoy using TypeScript.
As you can already infer from the headline of that post, I tried writing a statement that is about how Typescript is weakening the JavaScript ecosystem.
Really, I hope that in a couple of years browsers would just allow for WebIDL integration and that is it.
e.g. for VS Code, stick a jsconfig.json in your project's root:
{
"compilerOptions": {
"checkJs": true,
"target": "es2020"
}
}
If you want TypeScript to know about the types in your project, or help it with stuff it can't figure out on its own you can add them using JSDoc comments:https://www.typescriptlang.org/docs/handbook/jsdoc-supported...
The best thing is if TypeScript is being silly about your working code (its type definitions for the DOM can be particularly painful to work with), you can just ignore it :)