This preset includes the following plugins:
In
function foo(one: any, two: number, three?): string {}
Out
function foo(one, two, three) {}
npm install --save-dev babel-preset-flow
.babelrc
(Recommended).babelrc
{
"presets": ["flow"]
}
babel --presets flow script.js
require("babel-core").transform("code", {
presets: ["flow"]
});