From b3a4a3683c1d60ff12eb2eb476231cfd1703be68 Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Fri, 12 Jan 2018 14:31:35 -0800 Subject: [PATCH] fix(react-eslint): Enable the recommended react eslint rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously was included but not enabled. The errors fixed are: app/routes.js:9:16 ✖ 9:16 Component definition is missing display name react/display-name app/routes/contacts/components/Contacts.js:151:49 ✖ 151:49 Missing "key" prop for element in iterator react/jsx-key ✖ 167:22 Missing "key" prop for element in iterator react/jsx-key --- .eslintrc | 5 ++++- app/routes.js | 4 +++- app/routes/contacts/components/Contacts.js | 8 +++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.eslintrc b/.eslintrc index be435af2..e29f8784 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,7 +4,10 @@ "sourceType": "module", "allowImportExportEverywhere": true }, - "extends": "airbnb", + "extends": [ + "airbnb", + "plugin:react/recommended" + ], "env": { "browser": true, "node": true diff --git a/app/routes.js b/app/routes.js index bd62973d..b6442086 100644 --- a/app/routes.js +++ b/app/routes.js @@ -6,7 +6,7 @@ import Activity from './routes/activity' import Contacts from './routes/contacts' import Network from './routes/network' -export default () => ( +const routes = () => ( @@ -15,3 +15,5 @@ export default () => ( ) + +export default routes diff --git a/app/routes/contacts/components/Contacts.js b/app/routes/contacts/components/Contacts.js index d22c2337..63690200 100644 --- a/app/routes/contacts/components/Contacts.js +++ b/app/routes/contacts/components/Contacts.js @@ -148,23 +148,21 @@ class Contacts extends Component {