Skip to content

Commit fb2f67d

Browse files
committed
Revert "Fix crash for script setup in no-obj-calls rule"
This reverts commit 05f707e.
1 parent 05f707e commit fb2f67d

File tree

12 files changed

+3
-2200
lines changed

12 files changed

+3
-2200
lines changed

scripts/update-fixtures-ast.js

-3
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,6 @@ function scopeToJSON(scopeManager) {
131131
reference.resolved.defs[0].name,
132132
),
133133
init: reference.init || null,
134-
vueUsedInTemplate: reference.vueUsedInTemplate
135-
? reference.vueUsedInTemplate
136-
: undefined,
137134
}
138135
}
139136

src/script-setup/scope-analyzer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function analyzeUsedInTemplateVariables(
171171

172172
function markVariableAsUsed(name: string) {
173173
const variable = scriptVariables.get(name)
174-
if (!variable || variable.identifiers.length === 0) {
174+
if (!variable) {
175175
return
176176
}
177177
if (markedVariables.has(name)) {

test/fixtures/ast/multiple-scripts-7/scope.json

+2-103
Original file line numberDiff line numberDiff line change
@@ -138,39 +138,6 @@
138138
}
139139
},
140140
"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
174141
}
175142
]
176143
},
@@ -211,41 +178,7 @@
211178
"name": "MyComponent1"
212179
}
213180
],
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-
]
181+
"references": []
249182
},
250183
{
251184
"name": "MyComponent2",
@@ -284,41 +217,7 @@
284217
"name": "MyComponent2"
285218
}
286219
],
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-
]
220+
"references": []
322221
},
323222
{
324223
"name": "a",

0 commit comments

Comments
 (0)