Skip to content

Instantly share code, notes, and snippets.

@jeffmo
Created March 16, 2016 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffmo/46781c4a830624121486 to your computer and use it in GitHub Desktop.
Save jeffmo/46781c4a830624121486 to your computer and use it in GitHub Desktop.
// @flow
import EventEmitter from 'eventemitter3';
class foo extends EventEmitter {
}
const x = new foo();
x.bar(); //Should error as bar is not a method of foo. - does not. Changing
> flow version
Flow, a static type checker for JavaScript, version 0.22.0
> flow check
main.js:9
9: x.bar(); //Should error as bar is not a method of foo. - does not. Changing
^^^ property `bar`. Property not found in
9: x.bar(); //Should error as bar is not a method of foo. - does not. Changing
^ foo
Found 1 error
declare module 'eventemitter3' {
declare class EventEmitter {}
declare var exports: Class<EventEmitter>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment