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 = {
9494 };
9595 ` ,
9696 } ,
97+ {
98+ code : `
99+ import * as React from 'react'
100+ (props) => null;
101+ ` ,
102+ } ,
97103 ] ) ,
98104 invalid : parsers . all ( [
99105 {
@@ -129,6 +135,39 @@ const tests = {
129135 } ,
130136 ] ,
131137 } ,
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+ } ,
132171 {
133172 code : `
134173 import * as React from 'react'
You can’t perform that action at this time.
0 commit comments