Skip to content

Commit ce74be1

Browse files
committed
Extract argument into a variable
1 parent 44f6c9f commit ce74be1

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
@@ -265,10 +265,11 @@ module.exports = {
265265
return;
266266
}
267267

268-
if (node.arguments[0].properties) {
269-
checkSorted(node.arguments[0].properties);
270-
} else if (node.arguments[0].type === 'Identifier') {
271-
const variable = variableUtil.findVariableByName(context, node.arguments[0].name);
268+
const firstArg = node.arguments[0];
269+
if (firstArg.properties) {
270+
checkSorted(firstArg.properties);
271+
} else if (firstArg.type === 'Identifier') {
272+
const variable = variableUtil.findVariableByName(context, firstArg.name);
272273
if (variable && variable.properties) {
273274
checkSorted(variable.properties);
274275
}

0 commit comments

Comments
 (0)