gulp-flowtype
gulp-flowtype copied to clipboard
all=true .flowconfig option is ignored
Hi, all=true option from .flowconfig is ignored
//gulpfile.js
const gulp = require('gulp');
const flow = require('gulp-flowtype');
const babel = require('gulp-babel');
const sourcemaps = require('gulp-sourcemaps');
const debug = require('gulp-debug');
const src = 'src/**/*.js';
const typecheck = (src) => gulp.src(src).pipe(flow());
gulp.task('typecheck', () => typecheck(src));
gulp.task('type-monitor', () => {gulp.watch(src, ({path}) => typecheck(path))});
const compile = (src) =>
gulp.src(src)
.pipe(sourcemaps.init())
.pipe(babel({
plugins: ['transform-flow-strip-types']
}))
.pipe(debug({title: 'babel:'}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'));
gulp.task('compile', () => compile(src));
gulp.task('compile-monitor', () => {gulp.watch(src, ({path}) => compile(path))});
gulp.task('monitors', () => {gulp.start(['type-monitor', 'compile-monitor']);});
gulp.task('build', () => {gulp.start(['typecheck', 'compile']);});
gulp.task('watch', () => {gulp.start(['build', 'monitors']);});
//.flowconfig
[ignore]
<PROJECT_ROOT>/node_modules
[include]
./src
[libs]
./flow-typed
[options]
all=true
//index.js
const debug = require('debug');
const log = debug();
const error = debug(1);
log('hey!');
error('oh!');
index.js doesn't have /* @flow */
because I expect all=true
option to take care of the issue. For now I can set all using options, but I think it would be better to delegate that to .flowconfig, when possible.
If I run gulp, I don't get any errors in console, it says Flow has found 0 errors
. If I run flow directly, I get errors. Thank you.
I can see a big difference in performance when using /* @flow */
comment and no params vs. no comments and all:true
option. That makes me think that [ignore]
section is not respected when all: true
param is passed to gulp-flowtype (I ignore node_modules folder). Thanks.