- Indent 2 spaces
- Always use single quotes
- Use ASI (no semicolons unless needed)
- Maximum line length is 80 characters
- Write tests
- Code must pass
npm test
- Space after
if
while
for
etc. Key rule: if it's a function call then no space, if it is a keyword then use a space - Space after
function
- No space for function declarations or named functions:
function foo() { }
- One var per line, and try to declare them at the top of the function
//
for comments