From 03c0417870a23051b0e13fa3f346755596463103 Mon Sep 17 00:00:00 2001 From: XTY Date: Sun, 23 Apr 2023 08:13:52 +0800 Subject: [PATCH] Disable outdated rules from `eslint-plugin-react` --- .changeset/wet-meals-retire.md | 5 +++++ packages/eslint-plugin/lib/config/react.js | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/wet-meals-retire.md diff --git a/.changeset/wet-meals-retire.md b/.changeset/wet-meals-retire.md new file mode 100644 index 00000000..97594db6 --- /dev/null +++ b/.changeset/wet-meals-retire.md @@ -0,0 +1,5 @@ +--- +'@shopify/eslint-plugin': patch +--- + +Disable outdated rules (react/{react-in-jsx-scope,jsx-uses-react}) diff --git a/packages/eslint-plugin/lib/config/react.js b/packages/eslint-plugin/lib/config/react.js index 013872d5..b76d8f7c 100644 --- a/packages/eslint-plugin/lib/config/react.js +++ b/packages/eslint-plugin/lib/config/react.js @@ -99,7 +99,7 @@ module.exports = { // Prevent missing props validation in a React component definition 'react/prop-types': 'error', // Prevent missing React when using JSX - 'react/react-in-jsx-scope': 'error', + 'react/react-in-jsx-scope': 'off', // Enforce a defaultProps definition for every prop that is not a required prop 'react/require-default-props': 'off', // Enforce React components to have a shouldComponentUpdate method @@ -193,7 +193,7 @@ module.exports = { // Validate whitespace in and around the JSX opening and closing brackets 'react/jsx-tag-spacing': 'error', // Prevent React to be incorrectly marked as unused - 'react/jsx-uses-react': 'error', + 'react/jsx-uses-react': 'off', // Prevent variables used in JSX to be incorrectly marked as unused 'react/jsx-uses-vars': 'error', // Prevent missing parentheses around multilines JSX