• bleistift2@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 months ago
    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.

  • trxxruraxvr@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    This is my colleague and I will have to clean up the crap, because he doesn’t understand what’s in his own commits.

    • abbadon420@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      ·
      2 months ago

      Fire him. I’m a teacher and I’ve got some wonderfull and talented students that can’t find a job because companies are affraid to hire juniors because of idiots like him.

      • trxxruraxvr@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        2 months ago

        I’m not his manager. He is a good designer though, so I’m fine as long as he stays with his css and photoshop.