@@ -204,7 +204,7 @@ export const noMisusedObservablesRule = ruleCreator({
204204 for ( const element of node . body . body ) {
205205 const tsElement = esTreeNodeToTSNodeMap . get ( element ) ;
206206 const memberName = tsElement ?. name ?. getText ( ) ;
207- if ( memberName === undefined ) {
207+ if ( memberName == null ) {
208208 // See comment in typescript-eslint no-misused-promises for why.
209209 continue ;
210210 }
@@ -219,7 +219,7 @@ export const noMisusedObservablesRule = ruleCreator({
219219
220220 for ( const heritageType of heritageTypes ) {
221221 const heritageMember = getMemberIfExists ( heritageType , memberName ) ;
222- if ( heritageMember === undefined ) {
222+ if ( heritageMember == null ) {
223223 continue ;
224224 }
225225 const memberType = checker . getTypeOfSymbolAtLocation ( heritageMember , tsElement ) ;
@@ -240,7 +240,7 @@ export const noMisusedObservablesRule = ruleCreator({
240240 const tsNode = esTreeNodeToTSNodeMap . get ( node ) ;
241241
242242 const contextualType = getPropertyContextualType ( checker , tsNode ) ;
243- if ( contextualType === undefined ) {
243+ if ( contextualType == null ) {
244244 return ;
245245 }
246246
@@ -259,7 +259,7 @@ export const noMisusedObservablesRule = ruleCreator({
259259
260260 function checkReturnStatement ( node : es . ReturnStatement ) : void {
261261 const tsNode = esTreeNodeToTSNodeMap . get ( node ) ;
262- if ( tsNode . expression === undefined || ! node . argument ) {
262+ if ( tsNode . expression == null || ! node . argument ) {
263263 return ;
264264 }
265265
@@ -285,7 +285,7 @@ export const noMisusedObservablesRule = ruleCreator({
285285 }
286286
287287 const contextualType = checker . getContextualType ( tsNode . expression ) ;
288- if ( contextualType === undefined ) {
288+ if ( contextualType == null ) {
289289 return ;
290290 }
291291 if ( ! isVoidReturningFunctionType ( contextualType ) ) {
@@ -318,7 +318,7 @@ export const noMisusedObservablesRule = ruleCreator({
318318 function checkVariableDeclaration ( node : es . VariableDeclarator ) : void {
319319 const tsNode = esTreeNodeToTSNodeMap . get ( node ) ;
320320 if (
321- tsNode . initializer === undefined
321+ tsNode . initializer == null
322322 || ! node . init
323323 || ! node . id . typeAnnotation
324324 ) {
@@ -440,11 +440,11 @@ function getPropertyContextualType(
440440 return ;
441441 }
442442 const objType = checker . getContextualType ( obj ) ;
443- if ( objType === undefined ) {
443+ if ( objType == null ) {
444444 return ;
445445 }
446446 const propertySymbol = checker . getPropertyOfType ( objType , tsNode . name . text ) ;
447- if ( propertySymbol === undefined ) {
447+ if ( propertySymbol == null ) {
448448 return ;
449449 }
450450 return checker . getTypeOfSymbolAtLocation ( propertySymbol , tsNode . name ) ;
0 commit comments