circular-dependency-plugin icon indicating copy to clipboard operation
circular-dependency-plugin copied to clipboard

Importing flow types causes circular dependency error

Open bluepnume opened this issue 7 years ago • 0 comments

First off -- amazing plugin, this has saved me from a bunch of problems. Thank you so much!

The issue I'm seeing is this:

// foo.js

import { Bar } from './bar';
// bar.js

import { type Foo } from './foo';

This will cause circular-dependency-plugin to fail. But this makes it very difficult to do things like dependency injection, when the dependency isn't declared statically, but it's passed in.

I get that some people may wish to guard against this, still -- but would it be possible to add a flag to ignore circular dependencies when it's only types which are being circularly imported?

Thanks again for your time on this!

bluepnume avatar Feb 09 '18 07:02 bluepnume