| 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.
@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
Via .babelrc (Recommended)
.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"]
});