Skip to content

Commit 900ef1c

Browse files
committed
Update tests to avoid syntax error
1 parent c14ef47 commit 900ef1c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/lib/rules/forward-ref-uses-ref.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -198,19 +198,20 @@ const tests = {
198198
{
199199
code: `
200200
import { forwardRef } from 'react'
201-
forwardRef(function (props) {
201+
const Component = forwardRef(function (props) {
202202
return null;
203203
});
204204
`,
205205
errors: [
206206
{
207-
message: 'forwardRef is used with this component but no ref parameter is set',
207+
message:
208+
'forwardRef is used with this component but no ref parameter is set',
208209
suggestions: [
209210
{
210211
messageId: 'addRefParameter',
211212
output: `
212213
import { forwardRef } from 'react'
213-
forwardRef(function (props, ref) {
214+
const Component = forwardRef(function (props, ref) {
214215
return null;
215216
});
216217
`,
@@ -219,7 +220,7 @@ const tests = {
219220
messageId: 'removeForwardRef',
220221
output: `
221222
import { forwardRef } from 'react'
222-
function (props) {
223+
const Component = function (props) {
223224
return null;
224225
};
225226
`,

0 commit comments

Comments
 (0)