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') {