I think it’s inferior because it allows you to rewrite only parts, and unless you convert your entire code base, then you’ll not have type safety. Because the bits that aren’t typescript won’t warn you when you compile.
You just wrote exactly why static types are great: you get warnings when you forget to refactor your shitty (sic) JS code.
We write all our new code in good ol ES6 flavor of JavaScript and typehint in jsdoc. Typescript as a typechecker serves as very well.
It’s a great incremental adoption strategy.
This seems a great first step.
{
“compilerOptions”: {
“allowJs”: true,
“esModuleInterop”: true
},
“include”: [ “src/**/*” ],
“exclude”: [ “node_modules/**/*” ]
}
You’ll probably have to tweak that, but I hope it helps.https://www.typescriptlang.org/docs/handbook/compiler-option...
Also Google’s puppeteer project is typechecked with tsc and the type info is all in jsdocs
That's exactly why it's superior, your project just becomes better step by step without an expensive and complicated full rewrite.