Commit 762f2d29 authored by Sindre Sorhus's avatar Sindre Sorhus

Update codestyle.md

parent 24a88ea3
...@@ -10,11 +10,11 @@ We think it's best for the project if the code you write looks like the code the ...@@ -10,11 +10,11 @@ We think it's best for the project if the code you write looks like the code the
- Semicolon - Semicolon
- Strict mode - Strict mode
- No trailing whitespace - No trailing whitespace
- Variables at the top of the scope - Variable declaration at the top of the scope when used by both outer and inner scope
- Multiple variable statements - Multiple variable statements
- Space after keywords and between arguments and operators - Space after keywords and between arguments and operators
- Return early - Return early
- JSHint valid - JSHint and JSCS valid
- Consistency - Consistency
Example: Example:
...@@ -23,14 +23,14 @@ Example: ...@@ -23,14 +23,14 @@ Example:
'use strict'; 'use strict';
function foo(bar, fum) { function foo(bar, fum) {
var i, l, ret; var ret;
var hello = 'Hello'; var hello = 'Hello';
if (!bar) { if (!bar) {
return; return;
} }
for (i = 0, l = bar.length; i < l; i++) { for (var i = 0; i < bar.length; i++) {
if (bar[i] === hello) { if (bar[i] === hello) {
ret += fum(bar[i]); ret += fum(bar[i]);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment