Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
tokumei21316yWait, 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.
-
resdac8826yI never used this tester but i think it bables about 'babylon' as a var not the function? Or am i mistaken
-
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 -
7Raiden8786y@Strannch it's generally marked as "unused" if you literally don't do anything else that storing it in a temporary variable :)
-
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.
-
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 -
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”.
-
@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.
-
@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.
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.
rant