Open richard-ejem opened 5 years ago
I run into the same problem if I upgrade to any version greater than ^0.4.0
, so this might also fix that regression.
With ^0.4.0
, the lint rule runs smooth without any problems. After updating it (tested with 0.5.0, 0.6.2 and 0.7.0), it always fails with the same message as mention in https://github.com/bcherny/tslint-no-circular-imports/issues/33#issuecomment-472392988 (reproducible).
Today I stumbled upon a problem when adding this rule to a quite large project with many circular imports. As number of possible cycles in a full graph grows exponentially, it is not difficult to get millions of cycles even on a graph with tens of nodes.
This PR adds a limit of analyzed cycles after which the linter stops and adds another failure message that there are too many potential cycles and some might've been omitted.
It shouldn't be a concern of usability, as if you get a bunch of lint errors, you fix some of them and then run the linter again, without that complex circular structure.