• masterspace@lemmy.ca
    link
    fedilink
    English
    arrow-up
    52
    ·
    2 days ago

    We have linting set up in our codebase, I had to switch and focus on one half of our project, and I nearly lost my mind when I came back to the other side and realized that every time someone said they were ‘addressing linting issues’, that actually meant they were putting eslint-disable everywhere until the pipeline stopped complaining.

  • ulterno@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 day ago
    • Case 1:
      • Just typed the ending ‘>’ for the include and see the annotation come up.
    • Case 2:
      • Did not include the header, so not getting the code completion recommendation, making me have to type the function/class/whatever name.
    • Case 3:
      • The code completion comes up with an option of including the header (except that it is including the wrong header, despite me having already included the correct one)
  • Quetzalcutlass@lemmy.world
    link
    fedilink
    English
    arrow-up
    8
    arrow-down
    7
    ·
    2 days ago

    Except those imports were used by a huge section of code you temporarily commented out, and now you’ll need to manually select a dozen imports to get it working again when you come back to it.

    (Sure you could have just commented out the unused imports, but the linter auto-sorted them and you’re feeling too lazy to copy-paste a dozen scattered lines)

    • CameronDev@programming.dev
      link
      fedilink
      arrow-up
      11
      ·
      2 days ago

      Use a good IDE, and readding the imports is pretty easy.

      I find commented code to be a bit of a smell on its own, just delete it, and if you really need it again, dig it out of source control.

      • jjjalljs@ttrpg.network
        link
        fedilink
        arrow-up
        8
        ·
        2 days ago

        Yeah. My last job, a PR with commented out code typically wouldn’t get approved. Either leave it in version history, or stick it on a branch

    • mmddmm@lemm.ee
      link
      fedilink
      arrow-up
      6
      ·
      2 days ago

      Hum… Ignore linter advice for code that you temporarily mangled.

      It’s not like you have to act upon it as soon as a blue line appears under your code.

      • bleistift2@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 days ago

        Depending on the configuration, a linter may cause the compilation or a CI pipeline to fail.

        • mmddmm@lemm.ee
          link
          fedilink
          arrow-up
          1
          ·
          2 days ago

          Failing your local compilation due to linter problems is just stupid.

          Sending “temporary” changes into your CI pipeline isn’t even stupid, it’s borderline malicious.

          • bleistift2@sopuli.xyz
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 days ago

            Sending “temporary” changes into your CI pipeline isn’t even stupid, it’s borderline malicious.

            No? “Hey customer, I’ve deployed the changes you requested to the staging area. Is this what you had in mind? Keep in mind it only looks good and isn’t fully functional yet.”

    • CaptDust@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      2 days ago

      Honestly I’ll disable linting across entire files during these kinds of refactors because it’s annoying having build output littered with unused imports and format warnings while I’m still working on a solution. Requires some extra diligence to re-enable and clean up before pushing though.

      • zqwzzle@lemmy.ca
        cake
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 days ago

        Use pre-commit with a linter config that checks all files, local dev can have a different config to disable as needed.