Babel enabled code: Flow has found 0 errors
Hi,
I am writting my JavaScript code with the help of Babel. If I run flow from the command line it finds my errors. If I run gulp-flowtype within a Gulp task it founds nothing.
mytest.js
/* @flow */
class Person {}
class Dog {}
function foo(args: Person) {}
foo(new Dog());
gulpfile.babel.js
import gulp from 'gulp';
import flow from 'gulp-flowtype';
gulp.task('flow', () => {
return gulp.src('mytest.js')
.pipe(flow());
});
flow output:
/Users/me/test/mytest.js:8:1,14: function call
Error:
/Users/me/test/mytest.js:8:9,11: Dog
This type is incompatible with
/Users/me/test/mytest.js:6:20,25: Person
gulp-flowtype output:
❯ gulp flow
[15:10:24] Requiring external module babel-core/register
[15:10:26] Requiring external module babel-core/register
[15:10:27] Using gulpfile ~/test/gulpfile.babel.js
[15:10:27] Starting 'flow'...
[15:10:27] gulp-debug: 0 items
✔ Flow has found 0 errors
[15:10:27] Finished 'flow' after 9.53 ms
Hi,
Will look into this asap.
Cheers, Charlie
@charliedowler any update on this please, need any help with that?
+1
Been strugglin' w/ this myself for the past 2 days...
+1 same issue here.
+1
In my case flowtype is ran after babel has cleared flowtype formatting. It would be awesome if example with browserify & babel6 would be added.
Hi,
Really sorry this project has been neglected, I've been super busy but am aiming to bring it up to date in the Christmas break.
Cheers, Charlie
+1
+1 :(
+1 :-(
+1
Shame that you don't have time for this - I tried to examine it and in the json report the "path" key is simply empty and no files are therefore matched. Do you use some kind of different version of flow or something? Thanks.
Hi,
I have a local branch for a potential fix, the flow JSON output changed.
I'll try and get it out
Cheers
@charliedowler thank you for your time! Flow output change? Like with a different version of Flow or by using Babel? Could you push that local branch so I could take a look and help you, if you wish...
https://github.com/charliedowler/gulp-flowtype/pull/42#issuecomment-237059000