kopia lustrzana https://github.com/c9/core
Merge remote-tracking branch 'remotes/origin/pull/core/375'
commit
6fc2addfa6
|
@ -47,7 +47,7 @@ Semicolons
|
|||
|
||||
There are [rebellious forces][isaac] that try to steal your semicolons from you. But make no mistake, our traditional culture is still [well and truly alive][hnsemicolons]. So follow the community, and use those semicolons!
|
||||
|
||||
[isaac]: community.html#isaac-schlueter
|
||||
[isaac]: http://nodeguide.com/community.html#isaac-schlueter
|
||||
[hnsemicolons]: http://news.ycombinator.com/item?id=1547647
|
||||
|
||||
Trailing whitespace
|
||||
|
@ -130,7 +130,7 @@ If the block inside the curlys consists only of one statement the curlys may be
|
|||
return callback(err);
|
||||
```
|
||||
|
||||
However within one condition curlys must be used consistently.
|
||||
However, curlys must be used consistently throughout the statement.
|
||||
|
||||
*Right:*
|
||||
|
||||
|
@ -144,6 +144,15 @@ However within one condition curlys must be used consistently.
|
|||
}
|
||||
```
|
||||
|
||||
*Right:*
|
||||
|
||||
```javascript
|
||||
if (true)
|
||||
console.log("Yes");
|
||||
else
|
||||
console.log("Oh noo");
|
||||
```
|
||||
|
||||
*Wrong:*
|
||||
|
||||
```javascript
|
||||
|
@ -256,7 +265,7 @@ Constants
|
|||
|
||||
Constants should be declared as regular variables or static class properties, using all uppercase letters.
|
||||
|
||||
Node.js / V8 actually supports mozilla's [const][const] extension, but unfortunately that cannot be applied to class members, nor is it part of any ECMA standard.
|
||||
Node.js / V8 actually supports Mozilla's [const][const] extension, but unfortunately that cannot be applied to class members, nor is it part of any ECMA standard.
|
||||
|
||||
*Right:*
|
||||
|
||||
|
@ -655,7 +664,7 @@ NOTE: It is sometimes useful to write a case statement which falls through to th
|
|||
Vertical alignment
|
||||
------------------
|
||||
|
||||
Vertically aligning asignments can improve readability but also makes it harder to maintain the code. The style should be avoided.
|
||||
Vertically aligning assignments can improve readability but also makes it harder to maintain the code. The style should be avoided.
|
||||
|
||||
*Right*:
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue