From 0091ac8bb91ce37da9375cbec9065594d5068b44 Mon Sep 17 00:00:00 2001 From: akulsr0 Date: Tue, 18 Jun 2024 19:13:50 +0530 Subject: [PATCH] fix: correct report node --- lib/rules/jsx-key.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/rules/jsx-key.js b/lib/rules/jsx-key.js index a864fc8381..825d21f4bb 100644 --- a/lib/rules/jsx-key.js +++ b/lib/rules/jsx-key.js @@ -90,16 +90,12 @@ module.exports = { function checkIteratorElement(node) { if (node.type === 'JSXElement') { if (!hasProp(node.openingElement.attributes, 'key')) { - report(context, messages.missingIterKey, 'missingIterKey', { - node, - }); + report(context, messages.missingIterKey, 'missingIterKey', { node }); } else { const attrs = node.openingElement.attributes; if (checkKeyMustBeforeSpread && isKeyAfterSpread(attrs)) { - report(context, messages.keyBeforeSpread, 'keyBeforeSpread', { - node: node.type === 'ArrayExpression' ? node : node.parent, - }); + report(context, messages.keyBeforeSpread, 'keyBeforeSpread', { node }); } } } else if (checkFragmentShorthand && node.type === 'JSXFragment') {