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

3

u/brotherwayne Mar 27 '15

Mostly?

38

u/mrkipling Mar 27 '15

Yes - they suggest a tab indent of 2 spaces instead of the obviously-correct value of 4. Hence, mostly reasonable :)

2

u/DaemonXI Mar 27 '15

Normally I like four spaces, but JavaScript is so heavily nested with callbacks that I think using two spaces actually makes the code more readable.

3

u/mrkipling Mar 27 '15

All the more reason to use four spaces, so you don't indent too heavily. Also, ES6 promises.

I do see your point though.