r/typescript•
GrumpyGuss

React app: incremental conversion to TypeScript

I'm upgrading a create-react-app and part of that includes bringing it into Typescript.

Since the version of React was really old and just upgrading it incrementally was proving more difficult that it should have been, I've started a new, parrallel repository with a brand new create-react-app <myproject> --typscript build and ported all the files to there, renamed them to .ts and .tsx as appropriate, and begun the process of inserting typed information.

However that's going to be a lot of work, I've got a list of compiler errors a mile long in a JS app that runs, and I can't simply stop doing everything else and spend the next week+ adding types to every single file.

I'd like to be able to compile, emit the JS code that I know works even though the TS compiler doesn't like it, and incrementally add types just as advertised.

However my current tsconfig file (the default one generated by CRA) is providing me with plenty of helpful errors that I would like to go away for now.

What is a permissive tsconfiguration that will allow me to work normally until I'm really to tackle the beefier bits?

Posted Sep 8, 2019, 11:05 PM UTC

66
Loading comments…