Skip to content

Commit 1580a6b

Browse files
committed
Extract argument into a variable
1 parent 336ff2f commit 1580a6b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/rules/sort-prop-types.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,11 @@ module.exports = {
257257
return;
258258
}
259259

260-
if (node.arguments[0].properties) {
261-
checkSorted(node.arguments[0].properties);
262-
} else if (node.arguments[0].type === 'Identifier') {
263-
const variable = variableUtil.findVariableByName(context, node.arguments[0].name);
260+
const firstArg = node.arguments[0];
261+
if (firstArg.properties) {
262+
checkSorted(firstArg.properties);
263+
} else if (firstArg.type === 'Identifier') {
264+
const variable = variableUtil.findVariableByName(context, firstArg.name);
264265
if (variable && variable.properties) {
265266
checkSorted(variable.properties);
266267
}

0 commit comments

Comments
 (0)