You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-1Lines changed: 41 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1248,7 +1248,7 @@ Other Style Guides
1248
1248
}
1249
1249
```
1250
1250
1251
-
- [17.2](#17.2) <a name='17.2'></a> Use `//` for single line comments. Place single line comments on a newline above the subject of the comment. Put an empty line before the comment.
1251
+
- [17.2](#17.2) <a name='17.2'></a> Use `//` for single line comments. Place single line comments on a newline above the subject of the comment. Put an empty line before the comment unless it's on the first line of a block.
1252
1252
1253
1253
```javascript
1254
1254
// bad
@@ -1276,6 +1276,14 @@ Other Style Guides
1276
1276
1277
1277
return type;
1278
1278
}
1279
+
1280
+
// also good
1281
+
function getType() {
1282
+
// set the default type to 'no type'
1283
+
const type = this._type || 'no type';
1284
+
1285
+
return type;
1286
+
}
1279
1287
```
1280
1288
1281
1289
- [17.3](#17.3) <a name='17.3'></a> Prefixing your comments with`FIXME` or `TODO` helps other developers quickly understand if you're pointing out a problem that needs to be revisited, or if you're suggesting a solution to the problem that needs to be implemented. These are different than regular comments because they are actionable. The actions are `FIXME -- need to figure this out` or `TODO -- need to implement`.
@@ -1511,6 +1519,38 @@ Other Style Guides
1511
1519
return arr;
1512
1520
```
1513
1521
1522
+
- [18.8](#18.8) <a name='18.8'></a> Do not pad your blocks with blank lines.
0 commit comments