Skip to content

Commit

Permalink
Revert "fix unexpected grouping of type imports with pathGroup"
Browse files Browse the repository at this point in the history
This reverts commit 6949297.
  • Loading branch information
bz-stripe committed Jul 19, 2021
1 parent d5f86f7 commit 3e63bf0
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/rules/order.js
Expand Up @@ -308,11 +308,6 @@ function computePathRank(ranks, pathGroups, path, maxPosition) {
}
}

function shouldSeparateType(omittedTypes, impType) {
console.log('%c shouldSeparateType', 'color: #b0b', { omittedTypes, impType });
return impType === 'type' && !('type' in omittedTypes);
}

function computeRank(context, ranks, importEntry, excludedImportTypes) {
let impType;
let rank;
Expand All @@ -323,9 +318,8 @@ function computeRank(context, ranks, importEntry, excludedImportTypes) {
} else {
impType = importType(importEntry.value, context);
}
console.log('%c computeRank', 'color: #b0b', { file: importEntry.value, impType });
if (!excludedImportTypes.has(impType) && !shouldSeparateType(ranks.omittedTypes, impType)) {
rank = computePathRank(ranks.groups, ranks.pathGroups, importEntry.value, ranks.maxPosition, impType);
if (!excludedImportTypes.has(impType)) {
rank = computePathRank(ranks.groups, ranks.pathGroups, importEntry.value, ranks.maxPosition);
}
if (typeof rank === 'undefined') {
rank = ranks.groups[impType];
Expand Down

0 comments on commit 3e63bf0

Please sign in to comment.