mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 06:48:05 -05:00
[eslint-v2][arrow functions] improve examples
This commit is contained in:
committed by
Jordan Harband
parent
6a03a32915
commit
ba10353e9b
@@ -821,13 +821,13 @@ Other Style Guides
|
||||
|
||||
```js
|
||||
// bad
|
||||
const isActive = item => item.height > 256 ? true : false;
|
||||
const itemHeight = item => item.height > 256 ? item.largeSize : item.smallSize;
|
||||
|
||||
// bad
|
||||
const isActive = (item) => item.height > 256 ? true : false;
|
||||
const itemHeight = (item) => item.height > 256 ? item.largeSize : item.smallSize;
|
||||
|
||||
// good
|
||||
const isActive = item => { return item.height > 256 ? true : false; }
|
||||
const itemHeight = item => { return item.height > 256 ? item.largeSize : item.smallSize; }
|
||||
```
|
||||
|
||||
**[⬆ back to top](#table-of-contents)**
|
||||
|
||||
Reference in New Issue
Block a user