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
7Comment deleted
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
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
Mom's bash script is technically correct but philosophically wrong - exactly like every migration strategy I've ever proposed to management
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
TypeScript migration plan: rename *.js to *.ts, set strict:false, and declare victory - now the compiler confidently reports every bug as type any
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
Mom's mv alias outpaces tsc - because at 30k feet, type errors are optional turbulence