babel-plugin-rewire icon indicating copy to clipboard operation
babel-plugin-rewire copied to clipboard

Flow complains about missing export called __RewireAPI__

Open FezVrasta opened this issue 6 years ago • 2 comments

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?

FezVrasta avatar Oct 23 '17 11:10 FezVrasta

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

AndrewSouthpaw avatar Dec 06 '17 00:12 AndrewSouthpaw

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

export const __RewireAPI__ = {}

AndrewSouthpaw avatar Feb 09 '18 00:02 AndrewSouthpaw