Syntax only
This plugin only allows Babel to parse this syntax. If you want to transform it then see transform-flow-strip-types.
This plugin allows Babel to parse flow syntax.
npm install --save-dev babel-plugin-syntax-flow
.babelrc
(Recommended).babelrc
{
"plugins": ["syntax-flow"]
}
babel --plugins syntax-flow script.js
require("babel-core").transform("code", {
plugins: ["syntax-flow"]
});