babel/packages/babel-preset-flow
Logan Smyth 5cd1276a27
Expose the Flow 'all' option on the preset too. (#8016)
| Q                        | A <!--(Can use an emoji 👍) -->
| ------------------------ | ---
| Fixed Issues?            | 
| Patch: Bug Fix?          | 
| Major: Breaking Change?  |
| Minor: New Feature?      |
| Tests Added + Pass?      | Yes
| Documentation PR         | <!-- If so, add `[skip ci]` to your commit message to skip CI -->
| Any Dependency Changes?  |
| License                  | MIT

The `all` option landed in https://github.com/babel/babel/pull/7934/files#diff-3a8233bcd2766d2c7d87f23f944f7726R3 but it is only exposed from the plugin, not the preset, so this exposes it there too since the flow preset is what we want people to use.
2018-05-23 13:40:22 -07:00
..
2017-03-25 21:46:16 -04:00
2018-05-14 17:15:44 -07:00

@babel/preset-flow

Babel preset for all Flow plugins.

This preset includes the following plugins:

Example

In

function foo(one: any, two: number, three?): string {}

Out

function foo(one, two, three) {}

Installation

npm install --save-dev @babel/preset-flow

Usage

.babelrc

{
  "presets": ["@babel/preset-flow"]
}

Via CLI

babel --presets @babel/preset-flow script.js

Via Node API

require("@babel/core").transform("code", {
  presets: ["@babel/preset-flow"]
});