Skip to content

Commit b7e5f1d

Browse files
authored
Make condition more consistent and easy to read
1 parent c0db9b7 commit b7e5f1d

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/rules/no-unused-refs.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,10 @@ module.exports = {
237237
CallExpression(callExpression) {
238238
const firstArgument = callExpression.arguments[0]
239239
if (
240-
('name' in callExpression.callee &&
241-
callExpression.callee.name !== 'useTemplateRef') ||
240+
callExpression.callee.type !== 'Identifier' ||
241+
callExpression.callee.name !== 'useTemplateRef' ||
242242
!firstArgument ||
243-
(firstArgument.type !== 'Literal' &&
244-
firstArgument.type !== 'TemplateLiteral')
243+
!utils.isStringLiteral(firstArgument)
245244
) {
246245
return
247246
}

0 commit comments

Comments
 (0)