# babel-plugin-flow-comments **Repository Path**: mirrors_gaearon/babel-plugin-flow-comments ## Basic Information - **Project Name**: babel-plugin-flow-comments - **Description**: Turn flow type annotations into comments. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-05-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # babel-plugin-flow-comments Turn flow type annotations into comments. http://flowtype.org/blog/2015/02/20/Flow-Comments.html ## Example **In** ```javascript function foo(bar?) {} function foo2(bar?: string) {} function foo(x: number): string {} type B = { name: string; }; ``` **Out** ```javascript "use strict"; function foo(bar /*:: ?*/) {} function foo2(bar /*:: ?: string*/) {} function foo(x /*: number*/) /*: string*/ {} /*:: type B = { name: string; };*/ ``` ## Installation ```sh $ npm install babel-plugin-flow-comments ``` ## Usage ### Via `.babelrc` (Recommended) **.babelrc** ```json { "plugins": ["flow-comments"] } ``` ### Via CLI ```sh $ babel --plugins flow-comments script.js ``` ### Via Node API ```javascript require("babel-core").transform("code", { plugins: ["flow-comments"] }); ```