babel-plugin-s2s-func-param-init

funciton param initializing with type info

Usage no npm install needed!

<script type="module">
  import babelPluginS2sFuncParamInit from 'https://cdn.skypack.dev/babel-plugin-s2s-func-param-init';
</script>

README

babel-plugin-s2s-func-param-init

s2s plugin: initialize variable with flowtype infomation

Install

$ yarn add --dev babel-plugin-s2s-func-param-init

Example

IN:

// @flow

type A = { a: string, b: number }
function helloA(a: A) {}

OUT:

// @flow
type A = { a: string, b: number }

function helloA({ a, b }) {}

Usage

{
  ['s2s-func-param-init']
}