About Flow Formatter
Format and beautify your Flow type-annotated JavaScript code with this free online tool.
Apply consistent formatting to JavaScript that uses Flow type annotations, declarations, imports, and component syntax.
Key features
- Formatting purpose Apply consistent formatting to JavaScript that uses Flow type annotations, declarations, imports, and component syntax.
- Supported source Paste Flow source code, including type aliases, interfaces, generics, exact object types, or ordinary JavaScript.
- Style controls Select indentation and formatting preferences supported by the underlying formatter.
- Formatted result The result keeps Flow syntax while normalizing whitespace, line breaks, punctuation, and code layout.
How to use Flow Formatter
Follow this workflow to work with Flow-typed JavaScript safely and accurately.
- Paste or enter the source Paste Flow source code, including type aliases, interfaces, generics, exact object types, or ordinary JavaScript.
- Choose formatting rules Select indentation and formatting preferences supported by the underlying formatter.
- Format the source Run the formatter after the source parses successfully. It will apply presentation rules without intentionally changing the parsed structure.
- Review and copy The result keeps Flow syntax while normalizing whitespace, line breaks, punctuation, and code layout.
Usage tips
- Confirm the parser is set for Flow when the file contains syntax that standard JavaScript cannot parse.
- Formatting does not replace flow check; run the Flow type checker to find type errors.
- Review Flow comments such as /* @flow */ and suppression comments after transformation.