speedskater / babel-plugin-rewire

A babel plugin adding the ability to rewire module dependencies. This enables to mock modules for testing purposes.
843 stars 90 forks source link

Flow complains about missing export called __RewireAPI__ #205

Open FezVrasta opened 6 years ago

FezVrasta commented 6 years ago

Whenever I import or use RewireAPI or any of the methods exposed by this plugin, Flow will complain about them because they aren't actually defined/exported by the module I'm using.

Is there any way to suppress these warnings?

AndrewSouthpaw commented 6 years ago

You can use // $FlowFixMe above the offending line.

AndrewSouthpaw commented 6 years ago

You can also just add an export on the implementation file. It kinda breaks encapsulation, but... whatever.

export const __RewireAPI__ = {}