diff --git a/README.md b/README.md index f2c7b15..9604650 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,8 @@ for more information. - react/no-deprecated: ['warn'] - react/prefer-stateless-function: 'off' - react/jsx-filename-extension: ['error', { extensions: ['.js'] }] +- react-hooks/rules-of-hooks: 'error' +- react-hooks/exhaustive-deps: 'error' ``` [npm-image]: https://badge.fury.io/js/eslint-config-yoctol.svg diff --git a/package.json b/package.json index 25c632b..a820ec5 100644 --- a/package.json +++ b/package.json @@ -33,10 +33,10 @@ "eslint-plugin-jsx-a11y": "^6.2.1", "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-react": "^7.12.4", - "eslint-plugin-react-hooks": "^1.0.2", + "eslint-plugin-react-hooks": "^1.2.0", "eslint-plugin-sort-imports-es6-autofix": "^0.3.0", "prettier": "^1.16.4", - "react": "^16.8.2" + "react": "^16.8.3" }, "peerDependencies": { "eslint": "^5.14.1", diff --git a/rules/react.js b/rules/react.js index 7ac5ad7..6e19f93 100644 --- a/rules/react.js +++ b/rules/react.js @@ -42,5 +42,6 @@ module.exports = { // https://github.com/facebook/react/tree/master/packages/eslint-plugin-react-hooks 'react-hooks/rules-of-hooks': 'error', + 'react-hooks/exhaustive-deps': 'error', }, }; diff --git a/yarn.lock b/yarn.lock index fb9f48e..7e20555 100644 --- a/yarn.lock +++ b/yarn.lock @@ -567,10 +567,10 @@ eslint-plugin-prettier@^3.0.1: dependencies: prettier-linter-helpers "^1.0.0" -eslint-plugin-react-hooks@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.0.2.tgz#89d9ab0690a45956696e652368a952fb09f7134d" - integrity sha512-pY1RSD3CGkGOV+e+rzjfs+JXKRum7VlJKPHznhU0GnFWfDm6zKLmOmg/lKcwNRH3LTSnF2PbfF8x3w90tyHlYw== +eslint-plugin-react-hooks@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.2.0.tgz#a1c78e792b8d7d3e9c2a2aad28df80b9b5cd1101" + integrity sha512-pb/pwyHg0K3Ss/8loSwCGRSXIsvPBHWfzcP/6jeei0SgWBOyXRbcKFpGxolg0xSmph0jQKLyM27B74clbZM/YQ== eslint-plugin-react@^7.12.4: version "7.12.4" @@ -1536,15 +1536,15 @@ punycode@^2.1.0: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -react@^16.8.2: - version "16.8.2" - resolved "https://registry.yarnpkg.com/react/-/react-16.8.2.tgz#83064596feaa98d9c2857c4deae1848b542c9c0c" - integrity sha512-aB2ctx9uQ9vo09HVknqv3DGRpI7OIGJhCx3Bt0QqoRluEjHSaObJl+nG12GDdYH6sTgE7YiPJ6ZUyMx9kICdXw== +react@^16.8.3: + version "16.8.3" + resolved "https://registry.yarnpkg.com/react/-/react-16.8.3.tgz#c6f988a2ce895375de216edcfaedd6b9a76451d9" + integrity sha512-3UoSIsEq8yTJuSu0luO1QQWYbgGEILm+eJl2QN/VLDi7hL+EN18M3q3oVZwmVzzBJ3DkM7RMdRwBmZZ+b4IzSA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" prop-types "^15.6.2" - scheduler "^0.13.2" + scheduler "^0.13.3" read-pkg-up@^2.0.0: version "2.0.0" @@ -1676,10 +1676,10 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -scheduler@^0.13.2: - version "0.13.2" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.2.tgz#969eaee2764a51d2e97b20a60963b2546beff8fa" - integrity sha512-qK5P8tHS7vdEMCW5IPyt8v9MJOHqTrOUgPXib7tqm9vh834ibBX5BNhwkplX/0iOzHW5sXyluehYfS9yrkz9+w== +scheduler@^0.13.3: + version "0.13.3" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.3.tgz#bed3c5850f62ea9c716a4d781f9daeb9b2a58896" + integrity sha512-UxN5QRYWtpR1egNWzJcVLk8jlegxAugswQc984lD3kU7NuobsO37/sRfbpTdBjtnD5TBNFA2Q2oLV5+UmPSmEQ== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1"