

Converting JS to TypeScript
4 snips Feb 8, 2023
Discover the fascinating process of converting JavaScript to TypeScript, and learn why this transition can bolster your development confidence. The hosts share personal strategies for effective refactoring and the emotional nuances of the migration journey. Explore the advantages of strict type checking for improving code quality and readability, and hear how tools like GraphQL Code Generator and Zod can aid in streamlining your coding experience. Plus, get practical tips on managing types and enhancing your project with error tracking solutions.
AI Snips
Chapters
Transcript
Episode notes
tsconfig Setup
- Start with a default
tsconfig.json
and add configurations as needed. - Initially, set
allowJS: true
andstrict: false
for a smoother transition.
Essential Tooling
- Choose a compiler like Vite, Parcel, or TSX.
- A type checker, like TSC (with noEmit), helps, but isn't initially crucial.
ESLint Overrides
- Wes used ESLint overrides to apply different configurations for .js and .ts files.
- This helped manage linting during the conversion process.