From 3f352bd7f0ad768f7ade5ab74f114c416ffbe638 Mon Sep 17 00:00:00 2001 From: Apostolof Date: Tue, 3 Nov 2020 23:11:49 +0200 Subject: [PATCH] Add lint rules for react-hooks --- packages/concordia-app/.eslintrc.js | 6 +++++- packages/concordia-app/package.json | 20 +++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/packages/concordia-app/.eslintrc.js b/packages/concordia-app/.eslintrc.js index db831ff..bd3cafc 100644 --- a/packages/concordia-app/.eslintrc.js +++ b/packages/concordia-app/.eslintrc.js @@ -12,6 +12,7 @@ module.exports = { 'Atomics': 'readonly', 'SharedArrayBuffer': 'readonly' }, + parser: 'babel-eslint', 'parserOptions': { 'ecmaFeatures': { 'jsx': true @@ -20,7 +21,8 @@ module.exports = { 'sourceType': 'module' }, 'plugins': [ - 'react' + 'react', + 'react-hooks', ], 'rules': { 'react/jsx-props-no-spreading': 'off', @@ -35,6 +37,8 @@ module.exports = { ], 'react/require-default-props': 'off', 'react/prop-types': 'off', + 'react-hooks/rules-of-hooks': 'error', + 'react-hooks/exhaustive-deps': 'error', 'max-len': ['warn', {'code': 120, 'tabWidth': 4}], 'no-unused-vars': 'warn', 'no-console': 'warn', diff --git a/packages/concordia-app/package.json b/packages/concordia-app/package.json index 0e039b8..cb5150e 100644 --- a/packages/concordia-app/package.json +++ b/packages/concordia-app/package.json @@ -28,14 +28,19 @@ "@ezerous/drizzle": "~0.4.0", "@reduxjs/toolkit": "~1.4.0", "concordia-contracts": "~0.1.0", + "history": "^5.0.0", + "i18next": "^19.8.3", + "i18next-browser-languagedetector": "^6.0.1", + "i18next-http-backend": "^1.0.21", "level": "~6.0.1", "orbit-db-identity-provider": "~0.3.1", "prop-types": "~15.7.2", "react": "~16.13.1", "react-dom": "~16.13.1", + "react-i18next": "^11.7.3", "react-redux": "~7.2.1", - "react-router": "~5.2.0", - "react-router-dom": "~5.2.0", + "react-router": "^5.2.0", + "react-router-dom": "^5.2.0", "react-scripts": "~3.4.3", "redux-saga": "~1.1.3", "semantic-ui-css": "~2.4.1", @@ -43,11 +48,12 @@ "web3": "1.3.0" }, "devDependencies": { - "eslint": "6.8.0", - "eslint-config-airbnb": "18.1.0", - "eslint-plugin-import": "2.20.2", - "eslint-plugin-jsx-a11y": "6.2.3", - "eslint-plugin-react": "7.19.0", + "eslint": "^6.8.0", + "eslint-config-airbnb": "^18.1.0", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-jsx-a11y": "^6.2.3", + "eslint-plugin-react": "^7.19.0", + "eslint-plugin-react-hooks": "^4.2.0", "patch-package": "~6.2.2", "postinstall-postinstall": "~2.1.0", "source-map-explorer": "~2.5.0"