[guide] Separate 19.2 code blocks into diff + javascript sections

This commit is contained in:
Mark Miyashita
2016-11-06 05:19:22 -08:00
parent 86f52012cd
commit 556846745c

View File

@@ -2393,7 +2393,7 @@ Other Style Guides
> Why? This leads to cleaner git diffs. Also, transpilers like Babel will remove the additional trailing comma in the transpiled code which means you don't have to worry about the [trailing comma problem](https://github.com/airbnb/javascript/blob/es5-deprecated/es5/README.md#commas) in legacy browsers.
```javascript
```diff
// bad - git diff without trailing comma
const hero = {
firstName: 'Florence',
@@ -2408,7 +2408,9 @@ Other Style Guides
lastName: 'Nightingale',
+ inventorOf: ['coxcomb chart', 'modern nursing'],
};
```
```javascript
// bad
const hero = {
firstName: 'Dana',