mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 08:38:08 -05:00
[guide] Separate 19.2 code blocks into diff + javascript sections
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user