Skip to content
DevMeme
781 of 7590
Languages Post #885 · source on Telegram

JavaScript to TypeScript Migration: Mom's Edition

Description

This image is a screenshot of a tweet from the account 'JavaScript Daily' (@JavaScriptDaily). The tweet presents a humorous dialogue. A flight attendant asks for a TypeScript developer. The developer's mom nudges them, but they clarify, 'I'm a JavaScript developer.' In a surprising twist of technical knowledge, the mom replies with a shell command: 'Just for f in *.js; do mv "$f" "${f%.js}.ts"; done'. The joke centers on the vast oversimplification of migrating a project from JavaScript to TypeScript. While the mom's command correctly renames all JavaScript files to TypeScript files, it completely ignores the actual, often arduous, work of adding type annotations, fixing the resulting compiler errors, and configuring the entire TypeScript ecosystem. This is deeply relatable to senior engineers who understand that such a migration is a complex undertaking, not a mere file extension change

Comments

7
Anonymous ★ Top Pick The mom's script is the sales pitch for the migration. The 'any' types and 'ts-ignore' comments you'll be adding for the next six months are the technical debt
  1. Anonymous ★ Top Pick

    The mom's script is the sales pitch for the migration. The 'any' types and 'ts-ignore' comments you'll be adding for the next six months are the technical debt

  2. Anonymous

    Our org’s “TypeScript migration plan” was literally `git mv '**/*.js' '**/*.ts' && echo '// @ts-ignore' >> **/*.ts` - boom, instant type safety and another OKR in the bag

  3. Anonymous

    Mom's bash script is technically correct but philosophically wrong - exactly like every migration strategy I've ever proposed to management

  4. Anonymous

    Ah yes, the classic 'TypeScript migration' where you rename .js to .ts and suddenly have 47,000 type errors, zero type safety, and a codebase that's technically TypeScript but spiritually still JavaScript with trust issues. Mom's bash one-liner is actually the perfect metaphor for those 'we're migrating to TypeScript' projects where management thinks changing file extensions equals type safety, and six months later you're still using 'any' everywhere because nobody allocated time for actual migration work

  5. Anonymous

    TypeScript migration plan: rename *.js to *.ts, set strict:false, and declare victory - now the compiler confidently reports every bug as type any

  6. Anonymous

    Rename-driven development: for f in *.js; do mv "$f" "${f%.js}.ts"; done; then commit '@ts-nocheck' and report 'type safety achieved' to the steering committee

  7. Anonymous

    Mom's mv alias outpaces tsc - because at 30k feet, type errors are optional turbulence

Use J and K for navigation