@@ -123,24 +123,21 @@ export default createRule({
123
123
) : Array < VirtualReference > {
124
124
node = ignoreTransparentWrappers ( node , "up" ) ;
125
125
const parsedPathOuter = path != null ? parsePath ( path ) : null ;
126
- const eqCount = parsedPathOuter ?. reduce ( ( c , segment ) => c + + ( segment === '=' ) , 0 ) ?? 0 ;
126
+ const eqCount = parsedPathOuter ?. reduce ( ( c , segment ) => c + + ( segment === "=" ) , 0 ) ?? 0 ;
127
127
if ( eqCount > 1 ) {
128
- throw new Error ( `'${ path } ' must have 0 or 1 '=' characters, has ${ eqCount } ` )
128
+ throw new Error ( `'${ path } ' must have 0 or 1 '=' characters, has ${ eqCount } ` ) ;
129
129
}
130
130
const hasEq = eqCount === 1 ;
131
131
132
- let declarationScope = hasEq ? null : context . getScope ( ) ;
132
+ const declarationScope = hasEq ? null : context . getScope ( ) ;
133
133
134
134
function * recursiveGenerator ( node : T . Node , parsedPath : Array < string > | null ) {
135
-
136
-
137
- if ( ! parsedPath ) {
138
- yield VirtualReference ( node ) ;
139
- } else if ( node . parent ?. type === "VariableDeclarator" && node . parent . init === node ) {
140
- yield getReferences ( node . parent . id ) ;
141
- } else if ( node . type === "Identifier" ) {
142
-
143
- }
135
+ if ( ! parsedPath ) {
136
+ yield VirtualReference ( node ) ;
137
+ } else if ( node . parent ?. type === "VariableDeclarator" && node . parent . init === node ) {
138
+ yield getReferences ( node . parent . id ) ;
139
+ } else if ( node . type === "Identifier" ) {
140
+ }
144
141
const { id } = node . parent ;
145
142
if ( id . type === "Identifier" ) {
146
143
const variable = findVariable ( context . getScope ( ) , id ) ;
@@ -173,9 +170,9 @@ export default createRule({
173
170
} else {
174
171
}
175
172
}
176
-
177
-
178
- return Array . from ( recursiveGenerator ( node , parsePath ( path ) ) ) ;
173
+
174
+ return Array . from ( recursiveGenerator ( node , parsePath ( path ) ) ) ;
175
+ }
179
176
}
180
177
181
178
function distributeReferences ( root : ReactivityScope , references : Array < VirtualReference > ) {
0 commit comments