From ad8d26e40e2aa6c4235d3920de4114df95c147d3 Mon Sep 17 00:00:00 2001 From: Tiger Oakes Date: Sat, 20 Jul 2024 10:43:34 -0700 Subject: [PATCH] Update tests to avoid syntax error --- tests/lib/rules/forward-ref-uses-ref.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/lib/rules/forward-ref-uses-ref.js b/tests/lib/rules/forward-ref-uses-ref.js index 435bfe9a3a..2d357896d2 100644 --- a/tests/lib/rules/forward-ref-uses-ref.js +++ b/tests/lib/rules/forward-ref-uses-ref.js @@ -198,19 +198,20 @@ const tests = { { code: ` import { forwardRef } from 'react' - forwardRef(function (props) { + const Component = forwardRef(function (props) { return null; }); `, errors: [ { - message: 'forwardRef is used with this component but no ref parameter is set', + message: + 'forwardRef is used with this component but no ref parameter is set', suggestions: [ { messageId: 'addRefParameter', output: ` import { forwardRef } from 'react' - forwardRef(function (props, ref) { + const Component = forwardRef(function (props, ref) { return null; }); `, @@ -219,7 +220,7 @@ const tests = { messageId: 'removeForwardRef', output: ` import { forwardRef } from 'react' - function (props) { + const Component = function (props) { return null; }; `,