@@ -204,7 +204,7 @@ export const noMisusedObservablesRule = ruleCreator({
204
204
for ( const element of node . body . body ) {
205
205
const tsElement = esTreeNodeToTSNodeMap . get ( element ) ;
206
206
const memberName = tsElement ?. name ?. getText ( ) ;
207
- if ( memberName === undefined ) {
207
+ if ( memberName == null ) {
208
208
// See comment in typescript-eslint no-misused-promises for why.
209
209
continue ;
210
210
}
@@ -219,7 +219,7 @@ export const noMisusedObservablesRule = ruleCreator({
219
219
220
220
for ( const heritageType of heritageTypes ) {
221
221
const heritageMember = getMemberIfExists ( heritageType , memberName ) ;
222
- if ( heritageMember === undefined ) {
222
+ if ( heritageMember == null ) {
223
223
continue ;
224
224
}
225
225
const memberType = checker . getTypeOfSymbolAtLocation ( heritageMember , tsElement ) ;
@@ -240,7 +240,7 @@ export const noMisusedObservablesRule = ruleCreator({
240
240
const tsNode = esTreeNodeToTSNodeMap . get ( node ) ;
241
241
242
242
const contextualType = getPropertyContextualType ( checker , tsNode ) ;
243
- if ( contextualType === undefined ) {
243
+ if ( contextualType == null ) {
244
244
return ;
245
245
}
246
246
@@ -259,7 +259,7 @@ export const noMisusedObservablesRule = ruleCreator({
259
259
260
260
function checkReturnStatement ( node : es . ReturnStatement ) : void {
261
261
const tsNode = esTreeNodeToTSNodeMap . get ( node ) ;
262
- if ( tsNode . expression === undefined || ! node . argument ) {
262
+ if ( tsNode . expression == null || ! node . argument ) {
263
263
return ;
264
264
}
265
265
@@ -285,7 +285,7 @@ export const noMisusedObservablesRule = ruleCreator({
285
285
}
286
286
287
287
const contextualType = checker . getContextualType ( tsNode . expression ) ;
288
- if ( contextualType === undefined ) {
288
+ if ( contextualType == null ) {
289
289
return ;
290
290
}
291
291
if ( ! isVoidReturningFunctionType ( contextualType ) ) {
@@ -318,7 +318,7 @@ export const noMisusedObservablesRule = ruleCreator({
318
318
function checkVariableDeclaration ( node : es . VariableDeclarator ) : void {
319
319
const tsNode = esTreeNodeToTSNodeMap . get ( node ) ;
320
320
if (
321
- tsNode . initializer === undefined
321
+ tsNode . initializer == null
322
322
|| ! node . init
323
323
|| ! node . id . typeAnnotation
324
324
) {
@@ -440,11 +440,11 @@ function getPropertyContextualType(
440
440
return ;
441
441
}
442
442
const objType = checker . getContextualType ( obj ) ;
443
- if ( objType === undefined ) {
443
+ if ( objType == null ) {
444
444
return ;
445
445
}
446
446
const propertySymbol = checker . getPropertyOfType ( objType , tsNode . name . text ) ;
447
- if ( propertySymbol === undefined ) {
447
+ if ( propertySymbol == null ) {
448
448
return ;
449
449
}
450
450
return checker . getTypeOfSymbolAtLocation ( propertySymbol , tsNode . name ) ;
0 commit comments