From e9fea4af63b97ace9f28b2994c6e6511866fb952 Mon Sep 17 00:00:00 2001 From: Ben Scott Date: Fri, 14 Jun 2019 11:59:19 -0700 Subject: [PATCH] Enable checkAliases for react/no-unsafe rule By default this rule raises errors on usage of UNSAFE_componentWillMount, UNSAFE_componentWillReceiveProps and UNSAFE_componentWillUpdate. Enabling checkAliases will also raise an error on usage of their unprefixed versions too (componentWillMount, componentWillReceiveProps, componentWillUpdate). --- lib/config/rules/react.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/config/rules/react.js b/lib/config/rules/react.js index 70e753e2..9fdf982c 100644 --- a/lib/config/rules/react.js +++ b/lib/config/rules/react.js @@ -64,7 +64,7 @@ module.exports = { // Prevent usage of unknown DOM property 'react/no-unknown-property': 'off', // Prevent usage of UNSAFE_ methods - 'react/no-unsafe': 'error', + 'react/no-unsafe': ['error', {checkAliases: true}], // Prevent definitions of unused prop types 'react/no-unused-prop-types': 'error', // Attempts to discover all state fields in a React component and warn if any of them are never read.