#Mr.doob's Code Style™
Known for its generous use of whitespace as seen in three.js and elsewhere mrdoob.com
##Warning This is an unoffical style guide by @blurspline and still a WIP. Test at your own risk. Might be imported to three.js later.
- also some rules eg.
"requirePaddingNewlinesInBlocks": true
may require updates from JSCS project.
##Examples
Valid
for ( a = 0; a < 23; a ++ ) {
hello = 'world';
}
Invalid
for ( a = 0; a < 23; a ++ ) {
hello = 'world';
}
for ( a=0; a<23; a ++ ) {
hello = 'world';
}
for (a = 0; a < 23; a ++) {
hello = 'world';
}
for ( a = 0;a < 23; a ++ ) {
hello = 'world';
}
#JSCS
to install,
npm install -g jscs
to validate,
jscs *.js -c mrdoob.json
More about JSCS and its plugins here.