From ff212472714b8819184bfb96abb17bd3ed078997 Mon Sep 17 00:00:00 2001 From: vaclavbohac Date: Thu, 9 Nov 2023 14:11:55 +0100 Subject: [PATCH] Fix issue with reporting the @productboard/relay/unused-fields is unused --- src/rule-unused-fields.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rule-unused-fields.js b/src/rule-unused-fields.js index ed39375..02fcef7 100644 --- a/src/rule-unused-fields.js +++ b/src/rule-unused-fields.js @@ -197,7 +197,7 @@ function rule(context) { foundMemberAccesses = {}; templateLiterals = []; }, - 'Program:exit'(_node) { + 'Program:exit'(node) { const edgesAndNodesWhiteListFunctionCallArguments = getEdgesAndNodesWhiteListFunctionCallArguments( edgesAndNodesWhiteListFunctionCalls @@ -231,7 +231,7 @@ function rule(context) { ) ) { context.report({ - node: templateLiteral, + node, loc: getLoc(context, templateLiteral, queriedFields[field]), message: `This queries for the field \`${field}\` but this file does ` +