fbl

flow-bin-loader

webpack loader for Flow

Showing:

Popularity

Downloads/wk

58

Maintenance

No Maintenance Data Available

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Deprecated!
unsupported

Readme

flow-bin-loader

npm version

A webpack loader built around flow-bin to enforce type checking with Flow.

Installation

$ npm install --save-dev flow-bin flow-bin-loader

Usage

Add the plugin to your webpack config as follows:

module: {
  rules: [
    {
      test: /\.jsx?$/,
      loader: 'flow-bin-loader',
      exclude: /node_modules/,
      enforce: 'pre',
    }
  ]
},

Don't forget to add // @flow to the top of the files you want to be checked.

Configuration

By default, modules are resolved with respect to the directory where .flowconfig lives, so you might need to tell Flow how to map paths to the correct directory.

In order to do that, create a file named .flowconfig in the root directory of your project and add a module mapper rule such as the one below.

[options]
module.name_mapper='^\(.*\)$' -> '<PROJECT_ROOT>/src/\1'

For the complete list of options, visit https://flowtype.org/docs/advanced-configuration.html

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial