Syntax - Tasty Web Development Treats

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.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ADVICE

tsconfig Setup

  • Start with a default tsconfig.json and add configurations as needed.
  • Initially, set allowJS: true and strict: false for a smoother transition.
ADVICE

Essential Tooling

  • Choose a compiler like Vite, Parcel, or TSX.
  • A type checker, like TSC (with noEmit), helps, but isn't initially crucial.
ANECDOTE

ESLint Overrides

  • Wes used ESLint overrides to apply different configurations for .js and .ts files.
  • This helped manage linting during the conversion process.
Get the Snipd Podcast app to discover more snips from this episode
Get the app