I imagine it can be more convinent sometimes to have a function-scoped variable. But even then we're probably talking about quickly hacking things together.
Out of the blue I cannot give you a production example of "a var variable would be better here"
It's not an IDE that errors anything, it's linters. And VSCode comes with ESLint which gives a warning for var usage with default rules, so idk what you're talking about.
Gotta shake that attitude, if adjusting how you code makes you really upset, you are setting yourself to have a bad time in this industry.
I use airbnb core, but with a few rules adjusted to my liking. It took a while to get used to, and some of my teammates complained, but you know what, now our PRs all look consistent. I don’t care how much people complain, it’s worth it
Do you know anywhere that has good explanations for why some of the rules exist in the airbnb style guide? The team I'm on is going to start using a style guide soon as we have expanded the team, and looking through the airbnb styleguide, about half of the rules I don't really understand what they are for. I don't want to use AirBnB's if we are going to end up ignoring half the rules, and go for something less strict instead at least to begin with.
The official repo explains all the rules. At my company we ended up making our own config that extends the airbnb one, and I’m generally fine with people ignoring certain very opinionated rules in their projects if they want.
No regrets. Our projects are much more consistent, and nobody has really complained
It really doesnt though. It has one line for what the rules does without why it's needed, what its there to prevent. It seems like overkill for smaller teams where people mostly work on their own code, but still want it to match.
Looks like there is a "Why" statement for many rules/examples. The ones that lack a "Why" seem to mostly just be "because consistency".
I gradually learned what each rule does, by reading their docs and googling the rule if I still didn't understand it. Might not be ideal, but honestly I learned a ton by doing this.
I'm conflicted. I've worked alone, on small teams, and large teams. I now lead a medium sized team and oversee the projects of other teams. I've used airbnb to varying degrees, also standardjs. Now I don't like working without it. It took some getting used to, to feel like the linter wasn't getting in the way, but now I would never go back, even in personal projects.
At some point you have to compromise. Not everybody is going to love every single rule, especially if you use Airbnb out of the box.
People on your team may only work on their own projects, but what happens when someone quits? Now somebody else has to take over that project, and the closer it is to a common linting config, the easier that process is going to be.
protip: edit the config to only warn (or even disable) some stuff while writing (whitespace stuff mostly), and fix all of them at once before deployment. saved me a ton of nerves
0
u/[deleted] May 28 '19
[deleted]