Skip to content

Commit 12067db

Browse files
author
Joachim Seminck
committed
Perform callback detection before toLowerCase()
1 parent b66268b commit 12067db

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/rules/jsx-sort-props.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ module.exports = {
150150
var currentPropName = propName(decl);
151151
var previousValue = memo.value;
152152
var currentValue = decl.value;
153+
var previousIsCallback = isCallbackPropName(previousPropName);
154+
var currentIsCallback = isCallbackPropName(currentPropName);
153155

154156
if (ignoreCase) {
155157
previousPropName = previousPropName.toLowerCase();
@@ -186,9 +188,6 @@ module.exports = {
186188
}
187189

188190
if (callbacksLast) {
189-
var previousIsCallback = isCallbackPropName(previousPropName);
190-
var currentIsCallback = isCallbackPropName(currentPropName);
191-
192191
if (!previousIsCallback && currentIsCallback) {
193192
// Entering the callback prop section
194193
return decl;

0 commit comments

Comments
 (0)