Skip to content

Commit 70ea2c6

Browse files
committed
avoid traversing subgraphs outside of my scc
1 parent 06d8ec3 commit 70ea2c6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/rules/no-cycle.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ module.exports = {
119119
traversed.add(m.path);
120120

121121
for (const [path, { getter, declarations }] of m.imports) {
122+
// If we're in different SCCs, we can't have a circular dependency
123+
if (scc[myPath] !== scc[path]) { continue; }
124+
122125
if (traversed.has(path)) { continue; }
123126
const toTraverse = [...declarations].filter(({ source, isOnlyImportingTypes }) => !ignoreModule(source.value)
124127
// Ignore only type imports

0 commit comments

Comments
 (0)