222
schangxiang@126.com
2025-06-13 6a8393408d8cefcea02b7a598967de8dc1e565c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# babel-plugin-transform-flow-strip-types
 
> Strip all [flow](http://flowtype.org) type annotations and declarations from your output code.
 
## Example
 
**In**
 
```javascript
function foo(one: any, two: number, three?): string {}
```
 
**Out**
 
```javascript
function foo(one, two, three) {}
```
 
[Try in REPL](http://babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=false&presets=react&code=function%20foo(one%3A%20any%2C%20two%3A%20number%2C%20three%3F)%3A%20string%20%7B%7D&experimental=false&loose=false&spec=false&playground=false&stage=0
)
 
## Installation
 
```sh
npm install --save-dev babel-plugin-transform-flow-strip-types
```
 
## Usage
 
### Via `.babelrc` (Recommended)
 
**.babelrc**
 
```json
{
  "plugins": ["transform-flow-strip-types"]
}
```
 
### Via CLI
 
```sh
babel --plugins transform-flow-strip-types script.js
```
 
### Via Node API
 
```javascript
require("babel-core").transform("code", {
  plugins: ["transform-flow-strip-types"]
});
```