File tree 12 files changed +2200
-3
lines changed
ts-script-setup-with-use-global-var
integrations/script-setup-with-typescript-eslint/no-obj-calls
12 files changed +2200
-3
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,9 @@ function scopeToJSON(scopeManager) {
131
131
reference . resolved . defs [ 0 ] . name ,
132
132
) ,
133
133
init : reference . init || null ,
134
+ vueUsedInTemplate : reference . vueUsedInTemplate
135
+ ? reference . vueUsedInTemplate
136
+ : undefined ,
134
137
}
135
138
}
136
139
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ function analyzeUsedInTemplateVariables(
171
171
172
172
function markVariableAsUsed ( name : string ) {
173
173
const variable = scriptVariables . get ( name )
174
- if ( ! variable ) {
174
+ if ( ! variable || variable . identifiers . length === 0 ) {
175
175
return
176
176
}
177
177
if ( markedVariables . has ( name ) ) {
Original file line number Diff line number Diff line change 138
138
}
139
139
},
140
140
"init" : true
141
+ },
142
+ {
143
+ "identifier" : {
144
+ "type" : " Identifier" ,
145
+ "name" : " count" ,
146
+ "loc" : {
147
+ "start" : {
148
+ "line" : 2 ,
149
+ "column" : 11
150
+ },
151
+ "end" : {
152
+ "line" : 2 ,
153
+ "column" : 16
154
+ }
155
+ }
156
+ },
157
+ "from" : " module" ,
158
+ "resolved" : {
159
+ "type" : " Identifier" ,
160
+ "name" : " count" ,
161
+ "loc" : {
162
+ "start" : {
163
+ "line" : 2 ,
164
+ "column" : 11
165
+ },
166
+ "end" : {
167
+ "line" : 2 ,
168
+ "column" : 16
169
+ }
170
+ }
171
+ },
172
+ "init" : null ,
173
+ "vueUsedInTemplate" : true
141
174
}
142
175
]
143
176
},
178
211
"name" : " MyComponent1"
179
212
}
180
213
],
181
- "references" : []
214
+ "references" : [
215
+ {
216
+ "identifier" : {
217
+ "type" : " Identifier" ,
218
+ "name" : " MyComponent1" ,
219
+ "loc" : {
220
+ "start" : {
221
+ "line" : 6 ,
222
+ "column" : 7
223
+ },
224
+ "end" : {
225
+ "line" : 6 ,
226
+ "column" : 19
227
+ }
228
+ }
229
+ },
230
+ "from" : " module" ,
231
+ "resolved" : {
232
+ "type" : " Identifier" ,
233
+ "name" : " MyComponent1" ,
234
+ "loc" : {
235
+ "start" : {
236
+ "line" : 6 ,
237
+ "column" : 7
238
+ },
239
+ "end" : {
240
+ "line" : 6 ,
241
+ "column" : 19
242
+ }
243
+ }
244
+ },
245
+ "init" : null ,
246
+ "vueUsedInTemplate" : true
247
+ }
248
+ ]
182
249
},
183
250
{
184
251
"name" : " MyComponent2" ,
217
284
"name" : " MyComponent2"
218
285
}
219
286
],
220
- "references" : []
287
+ "references" : [
288
+ {
289
+ "identifier" : {
290
+ "type" : " Identifier" ,
291
+ "name" : " MyComponent2" ,
292
+ "loc" : {
293
+ "start" : {
294
+ "line" : 8 ,
295
+ "column" : 7
296
+ },
297
+ "end" : {
298
+ "line" : 8 ,
299
+ "column" : 19
300
+ }
301
+ }
302
+ },
303
+ "from" : " module" ,
304
+ "resolved" : {
305
+ "type" : " Identifier" ,
306
+ "name" : " MyComponent2" ,
307
+ "loc" : {
308
+ "start" : {
309
+ "line" : 8 ,
310
+ "column" : 7
311
+ },
312
+ "end" : {
313
+ "line" : 8 ,
314
+ "column" : 19
315
+ }
316
+ }
317
+ },
318
+ "init" : null ,
319
+ "vueUsedInTemplate" : true
320
+ }
321
+ ]
221
322
},
222
323
{
223
324
"name" : " a" ,
You can’t perform that action at this time.
0 commit comments