File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -112,16 +112,15 @@ export default util.createRule({
112112 case AST_NODE_TYPES . FunctionExpression :
113113 return true ;
114114
115- case AST_NODE_TYPES . MemberExpression :
116- case AST_NODE_TYPES . Identifier :
117- case AST_NODE_TYPES . ConditionalExpression :
118- return isFunctionType ( node ) ;
115+ case AST_NODE_TYPES . Literal :
116+ case AST_NODE_TYPES . TemplateLiteral :
117+ return false ;
119118
120119 case AST_NODE_TYPES . CallExpression :
121120 return isBind ( node . callee ) || isFunctionType ( node ) ;
122121
123122 default :
124- return false ;
123+ return isFunctionType ( node ) ;
125124 }
126125 }
127126
Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ const foo = () => {};
256256const bar = () => {};
257257
258258setTimeout(Math.radom() > 0.5 ? foo : bar, 0);
259+ setTimeout(foo || bar, 500);
259260 ` ,
260261 `
261262class Foo {
@@ -816,6 +817,21 @@ globalThis['execScript'](\`\`);
816817 } ,
817818 ] ,
818819 } ,
820+ {
821+ code : `
822+ const foo: string | undefined = 'hello';
823+ const bar = () => {};
824+
825+ setTimeout(foo || bar, 500);
826+ ` ,
827+ errors : [
828+ {
829+ messageId : 'noImpliedEvalError' ,
830+ line : 5 ,
831+ column : 12 ,
832+ } ,
833+ ] ,
834+ } ,
819835 {
820836 code : 'const fn = Function();' ,
821837 errors : [
You can’t perform that action at this time.
0 commit comments