4 ms·
Circular imports in JS are fine and not a code smell, for instance in typescript you may have two classes that reference each other's types - obviously this is
by zarzavat 5y ago
Circular imports in JS are fine and not a code smell, for instance in typescript you may have two classes that reference each other's types - obviously this is not a real import from JS's perspective but the point is that you should not have to care whether it is real or not. That's a world we don't want to live in.
Circular imports are only ever a problem when you have code running when the module loads. Then you run into module load ordering issues. So avoid any side effects on module load and make all
setup explicit.