mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 05:58:04 -05:00
[eslint-v2][arrays] update array-callback-return good/bad ex
This commit is contained in:
committed by
Jordan Harband
parent
822c0dfdfe
commit
b79e951280
19
README.md
19
README.md
@@ -374,9 +374,10 @@ Other Style Guides
|
||||
});
|
||||
|
||||
// bad
|
||||
[1, 2, 3].filter((x) => {
|
||||
if (x > 2) {
|
||||
return true;
|
||||
inbox].filter((msg) => {
|
||||
const { subject, author } = msg;
|
||||
if (subject === 'Mockingbird') {
|
||||
return author === 'Harper Lee';
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -384,12 +385,14 @@ Other Style Guides
|
||||
|
||||
// good
|
||||
[1, 2, 3].filter((x) => {
|
||||
if (x > 2) {
|
||||
return true;
|
||||
}
|
||||
inbox].filter((msg) => {
|
||||
const { subject, author } = msg;
|
||||
if (subject === 'Mockingbird') {
|
||||
return author === 'Harper Lee';
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
return false;
|
||||
});
|
||||
```
|
||||
|
||||
**[⬆ back to top](#table-of-contents)**
|
||||
|
||||
Reference in New Issue
Block a user