连续运行流量检查(flowtype)

时间:2016-03-03 08:58:11

标签: facebook flowtype

我想知道是否有人知道继续进行"流量检查的好方法"在给定的repo中命令,以便在文件更新时它会重新运行?

谢谢! 托马斯

3 个答案:

答案 0 :(得分:10)

使用https://github.com/emcrisostomo/fswatch

fswatch -o ./ | xargs -n1 -I{} sh -c 'clear; printf "\033[3J" && flow'将为您提供一个很好的颜色编码体验,每次都能正确清除

如果你想把它放在你的NPM脚本中,这里是转义版本:

"flow-watch": "fswatch -o ./ | xargs -n1 -I{} sh -c 'clear; printf \"\\033[3J\" && flow'"

答案 1 :(得分:6)

I like to use the watch command while dev-ing a Flpw codebase: watch -t npm run flow

It's available on most Linux distress by default, and you can brew install watch on Mac. I'm sure there's a Windows equivalent too?

答案 2 :(得分:1)

使用gulp-flowtypegulp任务应该执行此操作:

var gulp = require('gulp')
var flow = require('gulp-flowtype')

gulp.task('watch', function() {

    // set up a watcher
  gulp.watch('*.js', function (file) {
      return gulp.src(file.path)
        .pipe(flow())
    })
})