diff --git a/lib/rules/jsx-sort-props.js b/lib/rules/jsx-sort-props.js index 79bde569db..e52c2b028f 100644 --- a/lib/rules/jsx-sort-props.js +++ b/lib/rules/jsx-sort-props.js @@ -233,6 +233,7 @@ function validateReservedFirstConfig(context, reservedFirst) { } } +const reportedNodeAttributes = new WeakMap(); /** * Check if the current node attribute has already been reported with the same error type * if that's the case then we don't report a new error @@ -243,7 +244,6 @@ function validateReservedFirstConfig(context, reservedFirst) { * @param {Object} context The context of the rule * @param {Array} reservedList The list of reserved props */ -const reportedNodeAttributes = new WeakMap(); function reportNodeAttribute(nodeAttribute, errorType, node, context, reservedList) { const errors = reportedNodeAttributes.get(nodeAttribute) || [];