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.
I 100% agree with you. I'm all on board with using a style guide, I just think we'll chose one with better explanation of the reasons behind the rules. AirrBnB seems to be the strictest out of the popular styleguides, yet the documentation has the least explanation as to why some of the rules are there. The 1 sentence above each rules doesn't do a good job of explaining most.
Perfect, just what I was looking for! Wish all the style guides had something like this so we could choose the one the suits us best instead of just the one with the best documentation!
I agree, I've found the eslint rule pages really handy for understanding why they've included something. Would be nice in all the style guides, especially AirBnB.
I mean first I’d start with the reason you don’t like it. Is it because it’s unfamiliar? If so, fix that. Or Is it because it’s actually not a super essential rule?
The main rules I tend to disable are things like the strict arrow function rules (they are very very opinionated and are not essential for using arrow functions at all), comma dangle (airbnb requires dangling commas for better git diffing but most people I know hate this rule, it’s not essential), don’t require file extensions for import, etc.
It takes some expertise to fairly judge what is essential and what is too much opinion. If you lack this expertise, there’s an easy fix for that, start learnin! :)
Another thought: I generally start a discussion when we are looking at changing our linting rules so anyone can voice their opinions. I will push back any feedback like “that looks weird”, “I’ve never heard of that so I don’t want it”, because those are not valid arguments for making an informed decision. Everyone is entitled to an opinion, but nobody is entitled to force others to be affected by this opinion, they have to back it up with a convincing argument.
I'm all about code formatting and good-practice (e.g. using const). I'm not sure that I need to warned about every console.log in my code. It's distracting to work flow and AirBnB marks a lot of things as erros that could be warnings.
Is 'comma dangling' the requirement for a comma to be after the last element in a static object?
Yes, that is what comma-dangle refers to (that and arrays).
I hear ya, and honestly if you are working on a project by yourself then do whatever you want. But when you start working with a team, consistency is much more important. I don't want to reverse engineer someone else's code every time I jump into a new project.
I agree that airbnb is not perfect, which is why we've adjusted it at my company, to more closely fit everyone's liking. It wasn't the easiest process to all agree on, but it has made an enormous impact on our productivity. Code reviewing a PR is so much easier now, and we can focus on important things like architecture, patterns, paradigms, and naming, rather than on basic issues and arguing about style.
18
u/fucking_passwords May 28 '19
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