3 ms·
can you explain how this works ? this is very interesting to us. We have a large react app (created using create-react-app) in ES6 and have been considering ado
by sandGorgon 8y ago
can you explain how this works ? this is very interesting to us. We have a large react app (created using create-react-app) in ES6 and have been considering adopting TS gradually.
This seems a great first step.
- 52-6F-62 8y agoAFAIU, just add typescript to your project or globally then in your project set a tsconfig.json file with the allowJs and esModuleInterop flags set to true. Don’t quote me on this but you can probably leave out most of the rest of the flags besides your source location. For example: { “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-options.html https://www.typescriptlang.org/docs/handbook/compiler-option...
- nojvek 8y agoSee https://github.com/Microsoft/TypeScript/wiki/JSDoc-support-in-JavaScript https://github.com/Microsoft/TypeScript/wiki/JSDoc-support-i... Also Google’s puppeteer project is typechecked with tsc and the type info is all in jsdocs https://github.com/GoogleChrome/puppeteer https://github.com/GoogleChrome/puppeteer