Skip to content

Commit c4dda51

Browse files
Update lib/rules/no-unused-refs.js
Co-authored-by: Flo Edelmann <[email protected]>
1 parent 9730315 commit c4dda51

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/rules/no-unused-refs.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,12 @@ module.exports = {
234234
}
235235
extractUsedForPattern(refsNode)
236236
},
237-
CallExpression(exp) {
238-
if (exp.callee.name !== 'useTemplateRef') {
237+
CallExpression(callExpression) {
238+
const firstArgument = callExpression.arguments[0]
239+
if (callExpression.callee.name !== 'useTemplateRef' || !firstArgument) {
239240
return
240241
}
241-
const arg0 = exp.arguments[0]
242-
if (!arg0) {
243-
return
244-
}
245-
const name = utils.getStringLiteralValue(arg0)
242+
const name = utils.getStringLiteralValue(firstArgument)
246243
if (name !== null) {
247244
usedRefs.add(name)
248245
}

0 commit comments

Comments
 (0)