-
Notifications
You must be signed in to change notification settings - Fork 14
Standards
Ideally responsive mobile first design
- IE 7 first class Support
- Firefox 3.6+
- Chrome Recent-1
- Safari Recent-1
- IE 8 First class Support
- Firefox 3.6+
- Chrome Recent-1
- Safari Recent-1
Use comma first for all variable declarations. It is up to you if you want to conform to the true comma first style (see https://gist.github.com/357981), I'll let you know when I have made up my mind on this one. Currently I'm trying to always us it.
Use mocha for testing and should as an assertion framework. Create small mocked unit tests wherever possible and not integration tests that require actual IO.
Always observe the node.js convention of having error as the first argument of any callback.
myFn(function (error, data) {
if (error) {
// Bad
}
console.log(data);
});Always give functions names to help debugging a stack trace. Also try and put a space after the name of the 'function' reserve word.
module.exports = function getProperties (environment) {
};Ideally each module should only return one function. See example above.
Filenames should be all lowercase and if possible a single word
model.js
server.js
If you need to join words use '-'
view-config.js
http-error.js
Try and make file names nouns without including verb parts.
JavaScript use '
Stylus use "
Jade use '
Json use "