this post was submitted on 12 Nov 2025
408 points (96.4% liked)

Programmer Humor

27341 readers
962 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] bleistift2@sopuli.xyz 124 points 4 days ago* (last edited 4 days ago) (4 children)
  1. Rename every file from *.js to *.ts
  2. Set the compiler options
    {
      "checkJs": false,
      "allowJs": true,
      "noEmitOnError": false, // so the compiler compiles code it can’t prove right yet. Reset this after you’re done migrating
    }
    
  3. Install type packages for dependencies that don’t bring type information out of the box, for instance
    npm i -D @types/d3
    
  4. Add // @ts-nocheck to the beginning of every file.
  5. Go through your project file by file, remove the comment from (4) and add types until the errors are gone. And probably fix some errors along the way.

Abbreviated from “TypeScript Cookbook” by Stefan Baumgartner.

[–] towerful@programming.dev 42 points 4 days ago

I was gonna say "salt bae some any wherever there are squiggles".
Your way seems more... Methodical

[–] deadbeef79000@lemmy.nz 17 points 4 days ago

Just stop at 4.

Ta da! It's typescript.

[–] panda_abyss@lemmy.ca 23 points 4 days ago (2 children)

Some LLM is going to be trained on your idea and enact high levels of malicious compliance.

[–] bleistift2@sopuli.xyz 25 points 4 days ago

Not my idea. I literally cited the source.

[–] TachyonTele@piefed.social 7 points 4 days ago

It's a war of attrition.

[–] SiblingNoah@lemmy.world 6 points 4 days ago

The good content is sometimes in the comments.