r/javascript • • Mar 27 '15

Airbnb JavaScript Style Guide - A mostly reasonable approach to JavaScript

https://github.com/airbnb/javascript/blob/master/README.md
315 Upvotes

158 comments sorted by

View all comments

Show parent comments

12

u/amirmikhak Mar 27 '15

Because in my limited experience, no one actually goes through the extra steps, so in practice, you get a complete mess of styles.

2

u/[deleted] Mar 27 '15

Put beautification with all your style rules in either the build process, the unit test cycle, or in git hooks. If this were automated you shouldn't be going back to fix any of this madness.

0

u/[deleted] Mar 28 '15

[deleted]

1

u/lolmeansilaughed Mar 28 '15

So you'd even declare your loop iteration variables at the top of the function?

To be fair to your coworkers, hoisting is a crazy concept and the lack of a block scope is bizarre. Hoisting came from the same mindset that he gave us the dangerous with keyword.