2 min read

Yesterday, Kent C. Dodds, a JavaScript engineer at PayPal, shared in a post that now every app created at PayPal uses TypeScript by default replacing its previous type checker, Flow.  He also shared why it took them so much time to migrate to TypeScript and what are the drawbacks of using Flow which TypeScript solves.

Dodds works on a toolkit called paypal-scripts, which is a package of all the tools common to PayPal applications and published modules. It was created to replace the huge list of devDependencies in the package.json and all the config files with a single entry in the devDependencies. Keeping all the tools and config in a single package, also made updating very easier. Now, this paypal-scripts module is also merged with their base GitHub repo named “sample-app”, to ensure that every new application will get their start with modern technology and tools. These applications will also be statically typed with TypeScript and tested with Jest.

It took Dodds so long to adopt TypeScript because he was hesitant towards leaving Babel and ESLint. He was using these tools for several years and enjoyed building custom plugins for both. Also, earlier, TypeScript users faced some challenges when using Babel and ESLint. A common theme was that Babel users found it difficult to set up TypeScript. The linting experience also needed some improvement, so the TypeScript team started working on improving TypeScript’s compatibility for ESLint. This meant for Dodds that he did not have to give up these tools to adopt TypeScript, and that is why he decided to replace Flow with TypeScript.

Dodds mentions that the regular unreliability of Flow made him take this decision. Explaining the challenges, he wrote, “The editor plugins only sometimes worked (full disclosure, I never tried Nuclide and maybe my life would’ve been different if I had, but I tried Flow in Atom and VSCode) and I would get issues like the one all the time. It was incredibly frustrating because I could never trust my type checker. There were other issues as well.

Read more in detail on Kent C. Dodds’ post: Why every new web app at PayPal starts with TypeScript.

Read Next

Future of ESLint support in TypeScript

The Angular 7.2.1 CLI release fixes a webpack-dev-server vulnerability, supports TypeScript 3.2 and Angular 7.2.0-rc.0

Announcing ‘TypeScript Roadmap’ for January 2019- June 2019