File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,12 @@ const tests = {
94
94
};
95
95
` ,
96
96
} ,
97
+ {
98
+ code : `
99
+ import * as React from 'react'
100
+ (props) => null;
101
+ ` ,
102
+ } ,
97
103
] ) ,
98
104
invalid : parsers . all ( [
99
105
{
@@ -129,6 +135,39 @@ const tests = {
129
135
} ,
130
136
] ,
131
137
} ,
138
+ {
139
+ code : `
140
+ import { forwardRef } from 'react'
141
+ forwardRef(props => {
142
+ return null;
143
+ });
144
+ ` ,
145
+ errors : [
146
+ {
147
+ message : 'forwardRef is used with this component but no ref parameter is set' ,
148
+ suggestions : [
149
+ {
150
+ messageId : 'addRefParameter' ,
151
+ output : `
152
+ import { forwardRef } from 'react'
153
+ forwardRef((props, ref) => {
154
+ return null;
155
+ });
156
+ ` ,
157
+ } ,
158
+ {
159
+ messageId : 'removeForwardRef' ,
160
+ output : `
161
+ import { forwardRef } from 'react'
162
+ props => {
163
+ return null;
164
+ };
165
+ ` ,
166
+ } ,
167
+ ] ,
168
+ } ,
169
+ ] ,
170
+ } ,
132
171
{
133
172
code : `
134
173
import * as React from 'react'
You can’t perform that action at this time.
0 commit comments