- Never ever use tabs to indent, always 2 spaces
- Indent continued lines 2 spaces
- Initialize arrays using
[] - Initialize empty objects and hashes using
{} - Use
CamelCasefor classes,smallCamelCasefor variables and functions,SCREAMING_SNAKE_CASEfor constants,_single_leading_underscorefor private variables and functions. - Prefer
isto==or=== - Prefer
orandandto||and&& - Avoid functions with more than 10 lines
- Avoid prototype definitions with more than 100 lines
- Avoid functions with more than 4 parameters
- Avoid functions with more than 3 return values in callback
- Prefer single quotes for strings
- Prefer an asynchronous workflow over a synchronous one
- Avoid more than 3 nested callbacks
- Avoid explicit
return