Skip to content

Commit

Permalink
ignore type only imports in scc
Browse files Browse the repository at this point in the history
  • Loading branch information
soryy708 committed Aug 23, 2024
1 parent 70ea2c6 commit 7e8006e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/scc.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export default class StronglyConnectedComponentsBuilder {
const from = exportMap.path;
const to = importedPath;

// Ignore type-only imports, because we care only about SCCs of value imports
const toTraverse = [...v.declarations].filter(({ isOnlyImportingTypes }) => !isOnlyImportingTypes);
if (toTraverse.length === 0) { return; }

if (!adjacencyList.has(from)) {
adjacencyList.set(from, new Set());
}
Expand Down

0 comments on commit 7e8006e

Please sign in to comment.