1.0.1 • Published 8 years ago

babel-preset-flow-syntax v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

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"]
});