Babel preset for all Flow plugins
This is an extension of the official flow that is supposly is a:
Babel preset for all Flow plugins.
But there are certain features like class properties syntax that flow
supports out of the box while babel requires transform-class-properties
plugin in order to be able to parse it.
Babel preset that supports full flow syntax.
This preset includes the following plugins & presets:
In
function foo(one: any, two: number, three?): string {}
Out
function foo(one, two, three) {}
npm install --save-dev babel-preset-flow-syntax
.babelrc
(Recommended).babelrc
{
"presets": ["flow-sytax"]
}
babel --presets flow-syntax script.js
require("babel-core").transform("code", {
presets: ["flow-syntax"]
});