Strip flow types transform

Strip all flow type annotations and declarations from your output code

Syntax only

This plugin only removes flow types. It doesn't actually check if the types are valid itself. You'll need to use flow itself or a different babel plugin.

示例

输入

function foo(one: any, two: number, three?): string {}

输出

function foo(one, two, three) {}

安装

npm install --save-dev babel-plugin-transform-flow-strip-types

用法

通过 .babelrc(推荐)

.babelrc

{
  "plugins": ["transform-flow-strip-types"]
}

通过 CLI

babel --plugins transform-flow-strip-types script.js

通过 Node API

require("babel-core").transform("code", {
  plugins: ["transform-flow-strip-types"]
});