Skip to content

Commit 9a43a2d

Browse files
committed
[Refactor] improve performance of the code
1 parent 1d5241d commit 9a43a2d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/rules/order.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ module.exports = {
966966
pathGroupsExcludedImportTypes,
967967
);
968968
},
969-
...named.require ? {
969+
...named.require && {
970970
VariableDeclarator: function orderRequireNames(node) {
971971
if (node.id.type === 'ObjectPattern' && isRequireExpression(node.init)) {
972972
for (let i = 0; i < node.id.properties.length; i++) {
@@ -989,8 +989,8 @@ module.exports = {
989989
);
990990
}
991991
},
992-
} : {},
993-
...named.export ? {
992+
},
993+
...named.export && {
994994
ExportNamedDeclaration: function orderExportNames(node) {
995995
makeNamedOrderReport(
996996
context,
@@ -1005,7 +1005,7 @@ module.exports = {
10051005
},
10061006
})));
10071007
},
1008-
} : {},
1008+
},
10091009
...named.cjsExports && {
10101010
AssignmentExpression: function orderModuleExportNames(node) {
10111011
if (node.parent.type === 'ExpressionStatement') {

0 commit comments

Comments
 (0)