File tree 2 files changed +22
-0
lines changed
2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ export default util.createRule({
108
108
109
109
case AST_NODE_TYPES . MemberExpression :
110
110
case AST_NODE_TYPES . Identifier :
111
+ case AST_NODE_TYPES . ConditionalExpression :
111
112
return isFunctionType ( node ) ;
112
113
113
114
case AST_NODE_TYPES . CallExpression :
Original file line number Diff line number Diff line change @@ -251,6 +251,12 @@ const foo = (callback: Function) => {
251
251
setTimeout(callback, 0);
252
252
};
253
253
` ,
254
+ `
255
+ const foo = () => {};
256
+ const bar = () => {};
257
+
258
+ setTimeout(Math.radom() > 0.5 ? foo : bar, 0);
259
+ ` ,
254
260
] ,
255
261
256
262
invalid : [
@@ -606,6 +612,21 @@ const fn = (foo: string | any) => {
606
612
} ,
607
613
{
608
614
code : `
615
+ const foo = 'foo';
616
+ const bar = () => {};
617
+
618
+ setTimeout(Math.radom() > 0.5 ? foo : bar, 0);
619
+ ` ,
620
+ errors : [
621
+ {
622
+ messageId : 'noImpliedEvalError' ,
623
+ line : 5 ,
624
+ column : 12 ,
625
+ } ,
626
+ ] ,
627
+ } ,
628
+ {
629
+ code : `
609
630
window.setTimeout(\`\`, 0);
610
631
window['setTimeout'](\`\`, 0);
611
632
You can’t perform that action at this time.
0 commit comments