stcheng / gulp-flowtype

:busts_in_silhouette: Run Facebook's Flow in your gulp pipeline
MIT License
102 stars 33 forks source link

gulp-flowtype Build Status NPM version Dependency Status Gitter chat

Run Facebook's Flow in your gulp pipeline

gulp-flowtype example

Installation

$ npm install --save-dev gulp-flowtype

Usage

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'));
});

Options

options.all

Type: Boolean Default: false

Typecheck all files, not just @flow.

options.weak

Type: Boolean Default: false

Typecheck with weak inference, assuming dynamic types by default.

options.declarations

Type: String Default: empty

The path to declared files (interfaces) to third-party libraries

options.killFlow

Type: Boolean Default: false

Kills the Flow server after Typecheck is finished.

options.beep

Type: Boolean Default: true

Notify your command prompt of a Typecheck error with a beep

options.abort

Type: Boolean Default: false

Abort the gulp task after the first Typecheck error

options.reporter

Type: function Default: charliedowler/flow-reporter

Optionally specify a custom reporter.

Release History

Contributing

  1. Write test (if applicable)
  2. Write code
  3. Make tests pass
  4. Execute npm run lint and make amendments if needed
  5. Create pull request
  6. Rinse and repeat

License

MIT © Charlie Dowler