@@ -8,7 +8,7 @@ import type { TSESTree } from "@typescript-eslint/utils";
8
8
import { AST_NODE_TYPES as T } from "@typescript-eslint/utils" ;
9
9
import { isMatching , match , P } from "ts-pattern" ;
10
10
11
- import { createRule , getInstanceID , getPhaseKindOfFunction , isInstanceIDEqual } from "../utils" ;
11
+ import { createRule , getPhaseKindOfFunction , isInstanceIdEqual } from "../utils" ;
12
12
import type { ObserverEntry , ObserverMethod } from "./../models" ;
13
13
14
14
// #region Rule Metadata
@@ -185,7 +185,7 @@ export default createRule<[], MessageID>({
185
185
if ( ! isNewResizeObserver ( node ) ) {
186
186
return ;
187
187
}
188
- const id = getInstanceID ( node ) ;
188
+ const id = VAR . getVariableId ( node ) ;
189
189
if ( id == null ) {
190
190
context . report ( {
191
191
messageId : "unexpectedFloatingInstance" ,
@@ -202,11 +202,11 @@ export default createRule<[], MessageID>({
202
202
} ,
203
203
[ "Program:exit" ] ( ) {
204
204
for ( const { id, node, phaseNode } of observers ) {
205
- if ( dEntries . some ( ( e ) => isInstanceIDEqual ( e . observer , id , context ) ) ) {
205
+ if ( dEntries . some ( ( e ) => isInstanceIdEqual ( e . observer , id , context ) ) ) {
206
206
continue ;
207
207
}
208
- const oentries = oEntries . filter ( ( e ) => isInstanceIDEqual ( e . observer , id , context ) ) ;
209
- const uentries = uEntries . filter ( ( e ) => isInstanceIDEqual ( e . observer , id , context ) ) ;
208
+ const oentries = oEntries . filter ( ( e ) => isInstanceIdEqual ( e . observer , id , context ) ) ;
209
+ const uentries = uEntries . filter ( ( e ) => isInstanceIdEqual ( e . observer , id , context ) ) ;
210
210
const isDynamic = ( node : TSESTree . Node | _ ) => node ?. type === T . CallExpression || AST . isConditional ( node ) ;
211
211
const isPhaseNode = ( node : TSESTree . Node | _ ) => node === phaseNode ;
212
212
const hasDynamicallyAdded = oentries
@@ -216,7 +216,7 @@ export default createRule<[], MessageID>({
216
216
continue ;
217
217
}
218
218
for ( const oEntry of oentries ) {
219
- if ( uentries . some ( ( uEntry ) => isInstanceIDEqual ( uEntry . element , oEntry . element , context ) ) ) {
219
+ if ( uentries . some ( ( uEntry ) => isInstanceIdEqual ( uEntry . element , oEntry . element , context ) ) ) {
220
220
continue ;
221
221
}
222
222
context . report ( { messageId : "expectedDisconnectOrUnobserveInCleanup" , node : oEntry . node } ) ;
0 commit comments