-
4 space indentation
-
80 character max per line
-
if's always have space before braces
-
if's always have braces
if() { return; }
- exception:
if(err) throw err;
- exception:
-
else aligns with if's closing brace
if() {
} else {
}
-
multi command ifs must be multi line
if(bla) { bla; doubleBla; }
- exception:
if(err) { callback(err); return; }
- exception:
-
function definitions never have spaces before brackets
-
function definitions have a space before the opening brace function() { return; }
or function bla() { return; }
- exception: single line/empty function definition:
function(){}
- exception: single line/empty function definition:
-
parameters have spaces after comma bla(b1, b2, b3);
-
when comma'd stuff needs to be broken up into multiple lines they are in front
{ bla: 'bla' , bla2: 'bla' } or bla(blaaaaaaaaaaaaaaaaaaaaaaaaaaa , blaaaaaaaaaaaaaaaaa2)
Created
December 29, 2010 20:04
-
-
Save DanielG/758995 to your computer and use it in GitHub Desktop.
Unhosted.js coding guidelines
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment