Skip to content

Commit

Permalink
avoid traversing subgraphs outside of my scc
Browse files Browse the repository at this point in the history
  • Loading branch information
soryy708 committed Aug 23, 2024
1 parent 06d8ec3 commit 70ea2c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/rules/no-cycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ module.exports = {
traversed.add(m.path);

for (const [path, { getter, declarations }] of m.imports) {
// If we're in different SCCs, we can't have a circular dependency
if (scc[myPath] !== scc[path]) { continue; }

if (traversed.has(path)) { continue; }
const toTraverse = [...declarations].filter(({ source, isOnlyImportingTypes }) => !ignoreModule(source.value)
// Ignore only type imports
Expand Down

0 comments on commit 70ea2c6

Please sign in to comment.