Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

babel-preset-flow-syntax

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-preset-flow-syntax

Babel preset for all Flow plugins.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

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

.babelrc

{
  "presets": ["flow-sytax"]
}

Via CLI

babel --presets flow-syntax script.js

Via Node API

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

Keywords

babel-preset

FAQs

Package last updated on 23 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts