umbralOptimatum
**Describe the bug** I have a large TypeScript project and have set up DPDM in my test process to detect circular dependencies imported by `index.ts`. The project has several circular type dependencies so I'd like to use `dpdm -T src/modules/index.ts`. However, this fails to detect several actual cycles: the one that prompted this test throws a `ReferenceError: can't access lexical declaration before initialization` when run. In addition the tree for `index.ts` doesn't show 97% of its direct dependencies (none of which are types) and 40% of them are missing from the tree entirely! Most of them are referenced after being imported (being `Object.assign`ed to `window`) For the moment I'm using `dpdm --no-tree -T src/modules/**/*.ts` instead as this does seem to detect all the actual cycles, but resolving them is much harder without reliable trees. This approach also scans a handful of files that aren't accessible from `index.ts`, though that's not a big deal. <!-- A clear and concise description of what the bug is. --> **To Reproduce** I can reproduce it with this simplification of the circular dependency I first noticed the issue with. index.ts: ```ts import A from './A'; import B from './B'; import C from './C'; ``` A.ts: ```ts import C from './C'; export default class A { static list = [{ text: 'Example A', class: new C(0) }]; } ``` B.ts: ```ts import A from './A'; export default class B { static list = [{ text: 'Example B' }]; static getText(i) { return `${B.list[i]} ${A.list[i]}`; } } ``` C.ts: ```ts import B from './B'; export default class C { constructor(public i: number) { }; public getText() { return B.list[this.i].text; } } ``` `dpdm index.ts` correctly detects the cycle. `dpdm -T index.ts` does not detect the cycle and shows no dependencies for `index.ts` in its tree. `dpdm -T A.ts` detects the cycle and shows the correct tree, as does `dpdm -T B.ts` and `dpdm -T C.ts`. Referencing any of the imports in `index.ts` causes it to detect the cycle again, but it isn't consistent in ways I don't understand. Adding `Object.assign(<any>window, { A, B });` works in this example but doesn't in my project, and even with that line `C` is still missing from `index.ts`'s direct dependencies. **Expected behavior** Using the transform flag should ignore type dependencies without other changes to the dependency tree. **Additional context** Thanks for making DPDM! Even with the current weirdness, it's been extremely helpful for tracking down a couple evasive bugs.