@@ -59,12 +59,8 @@ export function isFromReactMember(
5959 const settings = unsafeDecodeSettings ( context . settings ) ;
6060 // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
6161 if ( ! settings . strictImportCheck ) {
62- if ( node . property . type !== T . Identifier || node . property . name !== name ) {
63- return false ;
64- }
65- if ( node . object . type === T . Identifier && node . object . name === memberName ) {
66- return true ;
67- }
62+ if ( node . property . type !== T . Identifier || node . property . name !== name ) return false ;
63+ if ( node . object . type === T . Identifier && node . object . name === memberName ) return true ;
6864 if (
6965 node . object . type === T . MemberExpression
7066 && node . object . object . type === T . Identifier
@@ -103,12 +99,8 @@ export declare namespace isCallFromReact {
10399
104100export function isCallFromReact ( name : string ) : isCallFromReact . ReturnType {
105101 return dual ( 2 , ( node : TSESTree . Node , context : RuleContext ) : node is TSESTree . CallExpression => {
106- if ( node . type !== T . CallExpression ) {
107- return false ;
108- }
109- if ( ! AST . isOneOf ( [ T . Identifier , T . MemberExpression ] ) ( node . callee ) ) {
110- return false ;
111- }
102+ if ( node . type !== T . CallExpression ) return false ;
103+ if ( ! AST . isOneOf ( [ T . Identifier , T . MemberExpression ] ) ( node . callee ) ) return false ;
112104 return isFromReact ( name ) ( node . callee , context ) ;
113105 } ) ;
114106}
@@ -118,10 +110,7 @@ export declare namespace isCallFromReactMember {
118110 ( context : RuleContext ) : ( node : TSESTree . Node ) => node is
119111 & TSESTree . CallExpression
120112 & { callee : TSESTree . MemberExpression } ;
121- (
122- node : TSESTree . Node ,
123- context : RuleContext ,
124- ) : node is
113+ ( node : TSESTree . Node , context : RuleContext ) : node is
125114 & TSESTree . CallExpression
126115 & { callee : TSESTree . MemberExpression } ;
127116 } ;
@@ -131,19 +120,12 @@ export function isCallFromReactMember(
131120 pragmaMemberName : string ,
132121 name : string ,
133122) : isCallFromReactMember . ReturnType {
134- return dual ( 2 , (
135- node : TSESTree . Node ,
136- context : RuleContext ,
137- ) : node is
123+ return dual ( 2 , ( node : TSESTree . Node , context : RuleContext ) : node is
138124 & TSESTree . CallExpression
139125 & { callee : TSESTree . MemberExpression } =>
140126 {
141- if ( node . type !== T . CallExpression ) {
142- return false ;
143- }
144- if ( ! AST . is ( T . MemberExpression ) ( node . callee ) ) {
145- return false ;
146- }
127+ if ( node . type !== T . CallExpression ) return false ;
128+ if ( ! AST . is ( T . MemberExpression ) ( node . callee ) ) return false ;
147129 return isFromReactMember ( pragmaMemberName , name ) ( node . callee , context ) ;
148130 } ) ;
149131}
0 commit comments