From 57cc211c654a42e7756aaaaea05540ac37efe605 Mon Sep 17 00:00:00 2001 From: Gerrit Alex Date: Wed, 2 Sep 2020 01:42:32 +0200 Subject: [PATCH] fix: react/function-component-definition - degraded from error to warn, autofixable --- .../overrides/__snapshots__/react.test.js.snap | 18 +++++++++--------- src/overrides/react.js | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/__tests__/overrides/__snapshots__/react.test.js.snap b/src/__tests__/overrides/__snapshots__/react.test.js.snap index 8c45986c..7f5c2649 100644 --- a/src/__tests__/overrides/__snapshots__/react.test.js.snap +++ b/src/__tests__/overrides/__snapshots__/react.test.js.snap @@ -91,7 +91,7 @@ Object { ], "react/forbid-prop-types": "off", "react/function-component-definition": Array [ - "error", + "warn", Object { "namedComponents": "function-declaration", "unnamedComponents": "arrow-function", @@ -301,7 +301,7 @@ Object { ], "react/forbid-prop-types": "off", "react/function-component-definition": Array [ - "error", + "warn", Object { "namedComponents": "function-declaration", "unnamedComponents": "arrow-function", @@ -510,7 +510,7 @@ Object { ], "react/forbid-prop-types": "off", "react/function-component-definition": Array [ - "error", + "warn", Object { "namedComponents": "function-declaration", "unnamedComponents": "arrow-function", @@ -722,7 +722,7 @@ Object { ], "react/forbid-prop-types": "off", "react/function-component-definition": Array [ - "error", + "warn", Object { "namedComponents": "function-declaration", "unnamedComponents": "arrow-function", @@ -929,7 +929,7 @@ Object { ], "react/forbid-prop-types": "off", "react/function-component-definition": Array [ - "error", + "warn", Object { "namedComponents": "function-declaration", "unnamedComponents": "arrow-function", @@ -1139,7 +1139,7 @@ Object { ], "react/forbid-prop-types": "off", "react/function-component-definition": Array [ - "error", + "warn", Object { "namedComponents": "function-declaration", "unnamedComponents": "arrow-function", @@ -1348,7 +1348,7 @@ Object { ], "react/forbid-prop-types": "off", "react/function-component-definition": Array [ - "error", + "warn", Object { "namedComponents": "function-declaration", "unnamedComponents": "arrow-function", @@ -1560,7 +1560,7 @@ Object { ], "react/forbid-prop-types": "off", "react/function-component-definition": Array [ - "error", + "warn", Object { "namedComponents": "function-declaration", "unnamedComponents": "arrow-function", @@ -1767,7 +1767,7 @@ Object { ], "react/forbid-prop-types": "off", "react/function-component-definition": Array [ - "error", + "warn", Object { "namedComponents": "function-declaration", "unnamedComponents": "arrow-function", diff --git a/src/overrides/react.js b/src/overrides/react.js index 8a3f0127..05d48f0d 100644 --- a/src/overrides/react.js +++ b/src/overrides/react.js @@ -153,7 +153,7 @@ const createReactRules = ({ isNext, version, hasTypeScript }) => ({ * @see https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/function-component-definition.md */ 'react/function-component-definition': [ - 'error', + 'warn', { namedComponents: 'function-declaration', unnamedComponents: 'arrow-function',