How Airbnb gave the SECRET to perfect JavaScript code

preview_player
Показать описание
Today we go over how Airbnb revolutionized JavaScript code quality with their ESLint configuration. In this video, we talk its widespread adoption, and impact on coding standards. We'll break down key examples of code consistency, best practices for asynchronous code, and improving readability with complex data transformations. Maybe it will shed some light to why Airbnb's ESLint configuration is considered a gold standard by many developers.

Check out the repo here:

0:00 background
0:34 object destructuring
0:54 aysnc code with promises
1:04 don't use arrays I guess
Рекомендации по теме
Комментарии
Автор

Nice video. But I would prefer to see side by side comparision because it is easier to see differences

hakier_
Автор

I liked the concept of the video, but I felt like everything was so fast and I couldn't see the benefits of the linting either

waleedbinshabbir
Автор

If i remember it correctly, airbnb doesn't use that eslint config.

theether
Автор

Airbnb ESLint config is an ok baseline if you want to use it, but I wouldn't treat is as "the gold standard" or even use it in new projects. There are definitely rules there that you should override with your own preferences or preferences of the team you are working in. Just following this blindly is bad.

To be honest, if you are starting a project in 2024, just use default recommended ESLint rules, use typescript-eslint and use an ESLint plugin specific to your framework (e.g. React) and just tweak rules as you go and think is best. Don't use these rules provided by companies that don't even use these rules themselves anymore apparently.

You can definitely read their style guide to read about reasons why some of these rules are set up the way they are, but actually make your own decisions in the end.

randmtv
Автор

I like the video, and I do have to check out the styleguide, but I also agree with the other's comments! For the example, I would've love to have a side-by-side of the before and after, and also know what they specifically do different from other style guides.
(And maybe slightly adjust the visual styles to set yourself apart from other creators)
But defo earned my sub, looking forward to see this channel grow!

antontimeboy
Автор

i thought the airbnb style guide was deprecated a long time ago

LukePighetti
Автор

Amazing video, would be glad to know more of such information

qaz
Автор

Actually we won an inside bootcamp competition for Airbnb's lint config, the code review was smooth and helped us a lot with development. Now is 'normal' to do this things, but back then on 2021 was more of a manual investigation thing.

curcodes
Автор

So what do they really do that differs from the other?
Or
Let me put the question this way
Is there any person here who codes like airbnb but haven't seen their guidelines?

asagiai
Автор

sickk, there's should be more video covering style guides

RedStone
Автор

Airbnb js conventions and uber go conventions are my goto addresses.

cariyaputta
Автор

Airbnb eslint config has not been updated in years. Used to be my favorite until I realized that.

rodrigososa
Автор

YOURE PUTTING ALL THIS SMOKE IN MY HEAD MAN. ITS MAKING ME ANGRY MAN.

ssps
Автор

I thought airbnb itself does not use that eslint repo (eslint-config-airbnb) lol

chun-lunlin
Автор

I not too long ago implemented the Airbnb eslint config on our react project and it’s not perfect by any means. The biggest thing it’s going to give you is readability. Performance? No. Some of the rules and styles are certainly good but you should certainly make your own conclusions about a lot of them.

The biggest problem I’ve found is with the looping. Yeah sure the high order array methods are easy to read and declarative but by no means performant.

forEach loops are straight up slow. And you also cannot break out of them so if you were searching for some value now you have to loop over the entire array or whatever.

Then you would instead maybe use a reduce or something but then id argue that reading a “for of” loop is much easier if you’re going to have any remotely advanced logic

You’re going to end up adding a dozen or so to your ignore list anyways. And that’s not to mention that airbnb doesn’t even use this config anymore. It was maybe a good idea a few years ago

ivyZorz
Автор

This is funny.
Because this standard is so good, that Airbnb don't actually use it.
As was stated in a recent interview 😂

shaygus
Автор

Single quotes for strings? oh hell nah

floskater
Автор

thought this was a fireship video.. ehh

dragidavid
Автор

You know what's funny, Airbnb does not use this style guide in their own projects :)

georgestan
Автор

I thought everyone follows these best practices

romania-nq