@@ -43,15 +43,15 @@ function hasValidHierarchy(node: AST.TSESTreeFunction, context: RuleContext, hin
4343 T . ClassBody ,
4444 ] ) ,
4545 ) ;
46- return ! boundaryNode || boundaryNode . type !== T . JSXExpressionContainer ;
46+ return boundaryNode == null || boundaryNode . type !== T . JSXExpressionContainer ;
4747}
4848
4949function getComponentFlag ( initPath : ERFunctionComponent [ "initPath" ] ) {
5050 let flag = ERFunctionComponentFlag . None ;
51- if ( initPath && AST . hasCallInFunctionInitPath ( "memo" ) ( initPath ) ) {
51+ if ( initPath != null && AST . hasCallInFunctionInitPath ( "memo" ) ( initPath ) ) {
5252 flag |= ERFunctionComponentFlag . Memo ;
5353 }
54- if ( initPath && AST . hasCallInFunctionInitPath ( "forwardRef" ) ( initPath ) ) {
54+ if ( initPath != null && AST . hasCallInFunctionInitPath ( "forwardRef" ) ( initPath ) ) {
5555 flag |= ERFunctionComponentFlag . ForwardRef ;
5656 }
5757 return flag ;
@@ -76,7 +76,7 @@ export function useComponentCollector(
7676 } ;
7777 const onFunctionExit = ( ) => {
7878 const entry = functionEntries . at ( - 1 ) ;
79- if ( ! entry ) return ;
79+ if ( entry == null ) return ;
8080 if ( ! entry . isComponent ) {
8181 return functionEntries . pop ( ) ;
8282 }
@@ -85,7 +85,7 @@ export function useComponentCollector(
8585 . reverse ( )
8686 . some ( ( r ) => {
8787 return context . sourceCode . getScope ( r ) . block === entry . node
88- && ! ! r . argument
88+ && r . argument != null
8989 && ! JSX . isJSXValue ( r . argument , jsxCtx , hint ) ;
9090 } ) ;
9191 if ( shouldDrop ) {
@@ -110,7 +110,7 @@ export function useComponentCollector(
110110 ":function[type]:exit" : onFunctionExit ,
111111 "ArrowFunctionExpression[type][body.type!='BlockStatement']" ( ) {
112112 const entry = getCurrentEntry ( ) ;
113- if ( ! entry ) {
113+ if ( entry == null ) {
114114 return ;
115115 }
116116 const { body } = entry . node ;
@@ -122,7 +122,7 @@ export function useComponentCollector(
122122 }
123123 const initPath = AST . getFunctionInitPath ( entry . node ) ;
124124 const id = getFunctionComponentIdentifier ( entry . node , context ) ;
125- const name = id && getComponentNameFromIdentifier ( id ) ;
125+ const name = getComponentNameFromIdentifier ( id ) ;
126126 const key = getId ( ) ;
127127 components . set ( key , {
128128 _ : key ,
@@ -146,7 +146,7 @@ export function useComponentCollector(
146146 : _ ;
147147 const component = [ ...components . values ( ) ]
148148 . findLast ( ( { name } ) => name != null && name === componentName ) ;
149- if ( ! component ) {
149+ if ( component == null ) {
150150 return ;
151151 }
152152 components . set ( component . _ , {
@@ -159,15 +159,15 @@ export function useComponentCollector(
159159 return ;
160160 }
161161 const entry = getCurrentEntry ( ) ;
162- if ( ! entry ) {
162+ if ( entry == null ) {
163163 return ;
164164 }
165165 functionEntries . pop ( ) ;
166166 functionEntries . push ( { ...entry , hookCalls : [ ...entry . hookCalls , node ] } ) ;
167167 } ,
168168 "ReturnStatement[type]" ( node : TSESTree . ReturnStatement ) {
169169 const entry = getCurrentEntry ( ) ;
170- if ( ! entry ) {
170+ if ( entry == null ) {
171171 return ;
172172 }
173173 const isComponent = hasNoneOrValidComponentName ( entry . node , context )
@@ -180,7 +180,7 @@ export function useComponentCollector(
180180 functionEntries . push ( { ...entry , isComponent } ) ;
181181 const initPath = AST . getFunctionInitPath ( entry . node ) ;
182182 const id = getFunctionComponentIdentifier ( entry . node , context ) ;
183- const name = id && getComponentNameFromIdentifier ( id ) ;
183+ const name = getComponentNameFromIdentifier ( id ) ;
184184 components . set ( entry . key , {
185185 _ : entry . key ,
186186 id,
0 commit comments