Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all=true .flowconfig option is ignored #46

Open
webuniverseio opened this issue Sep 21, 2016 · 1 comment
Open

all=true .flowconfig option is ignored #46

webuniverseio opened this issue Sep 21, 2016 · 1 comment

Comments

@webuniverseio
Copy link

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.

@webuniverseio
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant