Skip to content

Commit

Permalink
[Refactor] improve performance of the code
Browse files Browse the repository at this point in the history
  • Loading branch information
manuth committed Sep 3, 2024
1 parent 1d5241d commit 9a43a2d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rules/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ module.exports = {
pathGroupsExcludedImportTypes,
);
},
...named.require ? {
...named.require && {
VariableDeclarator: function orderRequireNames(node) {
if (node.id.type === 'ObjectPattern' && isRequireExpression(node.init)) {
for (let i = 0; i < node.id.properties.length; i++) {
Expand All @@ -989,8 +989,8 @@ module.exports = {
);
}
},
} : {},
...named.export ? {
},
...named.export && {
ExportNamedDeclaration: function orderExportNames(node) {
makeNamedOrderReport(
context,
Expand All @@ -1005,7 +1005,7 @@ module.exports = {
},
})));
},
} : {},
},
...named.cjsExports && {
AssignmentExpression: function orderModuleExportNames(node) {
if (node.parent.type === 'ExpressionStatement') {
Expand Down

0 comments on commit 9a43a2d

Please sign in to comment.