Skip to content

Commit b356076

Browse files
committed
Extract argument into a variable
1 parent 490f90c commit b356076

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
@@ -262,10 +262,11 @@ module.exports = {
262262
return;
263263
}
264264

265-
if (node.arguments[0].properties) {
266-
checkSorted(node.arguments[0].properties);
267-
} else if (node.arguments[0].type === 'Identifier') {
268-
const variable = variableUtil.findVariableByName(context, node.arguments[0].name);
265+
const firstArg = node.arguments[0];
266+
if (firstArg.properties) {
267+
checkSorted(firstArg.properties);
268+
} else if (firstArg.type === 'Identifier') {
269+
const variable = variableUtil.findVariableByName(context, firstArg.name);
269270
if (variable && variable.properties) {
270271
checkSorted(variable.properties);
271272
}

0 commit comments

Comments
 (0)