esformatter-flow
esformatter plugin to format Flow type annotations
IMPORTANT: This plugin requires a parser that is able to handle Flow types
(eg. Babylon); So it will only work
with esformatter@0.9.0
and up.
usage
Install the plugin:
npm install esformatter-flow
Add to your esformatter config file:
Or you can manually register the plugin if not using the esformatter
command
directly:
// register pluginesformatter;
Or even pass it as a command line argument:
esformatter --plugins=esformatter-flow,some-other-plugin 'foo.js'
example
Given this input program:
/* @flow */ : void { return a + b;} y : string ; : string return a + ;
It will output:
/* @flow */: void { return a + b;} y: string; : string return a + ;
See files inside the test/compare
folder for more examples of the supported
features.
license
Released under the MIT License