babel-preset-flow-syntax

1.0.1 • Public • Published

babel-preset-flow-syntax

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:

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": ["flow-sytax"]
}

Via CLI

babel --presets flow-syntax script.js

Via Node API

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

Package Sidebar

Install

npm i babel-preset-flow-syntax

Weekly Downloads

42

Version

1.0.1

License

MIT

Last publish

Collaborators

  • gozala