Run Facebook's Flow in your gulp pipeline
$ npm install --save-dev gulp-flowtype
var react = require('gulp-react');
var flow = require('gulp-flowtype');
gulp.task('typecheck', function() {
return gulp.src('./*.js')
.pipe(flow({
all: false,
weak: false,
declarations: './declarations',
killFlow: false,
beep: true,
abort: false
}))
.pipe(react({ stripTypes: true })) // Strip Flow type annotations before compiling
.pipe(gulp.dest('./out'));
});
Type: Boolean
Default: false
Typecheck all files, not just @flow.
Type: Boolean
Default: false
Typecheck with weak inference, assuming dynamic types by default.
Type: String
Default: empty
The path to declared files (interfaces) to third-party libraries
Type: Boolean
Default: false
Kills the Flow server after Typecheck is finished.
Type: Boolean
Default: true
Notify your command prompt of a Typecheck error with a beep
Type: Boolean
Default: false
Abort the gulp task after the first Typecheck error
Type: function
Default: charliedowler/flow-reporter
Optionally specify a custom reporter.
v0.4.0
/* @flow */
before running flow and added optionsnpm run lint
and make amendments if neededMIT © Charlie Dowler