From b79e9512801f798698f15baaaec92c328c0af6c0 Mon Sep 17 00:00:00 2001 From: Harrison Shoff Date: Sat, 20 Feb 2016 23:33:39 -0800 Subject: [PATCH] [eslint-v2][arrays] update array-callback-return good/bad ex --- README.md | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e423c594..e89fc1cd 100644 --- a/README.md +++ b/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)**