15

I love linters and all. They’re great for maintaining good practice. But sometimes they’re a little too aggressive, and when the rules are being imported from elsewhere, I am not sure how to temporarily disable them.

This is especially frustrating when the linter decides it will break your shit instantly, so I found it easier to just call a method and remove it when the functionality is built.

Right now there’s at least 4 “this.stopBitchingAbout([all, the, things])” in my code.

Comments
  • 2
    Wait, the linter you're using sucks if it can't detect an unused assignment. You should've ditched that piece of shit in the first place.
  • 1
    @tokumei would if I could :/
  • 0
    I never used this tester but i think it bables about 'babylon' as a var not the function? Or am i mistaken
  • 1
    Isn't it saying that your variable is useless since you assign a raw value (empty string), thus meaning your parameter is not used ?

    Well, it's used as a temporary variable anyway
  • 0
    @Strannch it's generally marked as "unused" if you literally don't do anything else that storing it in a temporary variable :)
  • 1
    Why have variables you don't use? The check is good because it will notify you if you think you used the variable somewhere but erroneously used some other variable.
  • 4
    Well, you could disable them per line or block if you want to.

    // eslint-disable-next-line

    /* eslint-disable */
    /* eslint-enable */

    You could also say what rule you want disabled so it picks other broken rules.

    // eslint-disable-next-line no-unused-variablr
  • 0
    no@Strannch no, the error came before the function. I add the empty string to literally shut it up as I don’t want it logging a bunch of huge objects to console. The assignment is initially to the passed in variable because it makes the linter see that the variable was “used”.
  • 2
    @7Raiden Well the thing is, I was building out the functionality for it, and had defined it, but I like to code incrementally, which doesn’t work when the linter won’t compile until you have a complete functional program. Kind of hard to check functionality and structure when the linter won’t let any of it work until it deems it finished.
  • 0
    @electrineer They will be used once the app is finished. It’s frustrating checking that everything is working incrementally when it crashes every time the linter sees I’ve added something new.
  • 1
    @rusty-hacker Yaaaas! Did not know this was a thing
Your Job Suck?
Get a Better Job
Add Comment