Loading...

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.

  1. Paste or enter the source Paste Flow source code, including type aliases, interfaces, generics, exact object types, or ordinary JavaScript.
  2. Choose formatting rules Select indentation and formatting preferences supported by the underlying formatter.
  3. Format the source Run the formatter after the source parses successfully. It will apply presentation rules without intentionally changing the parsed structure.
  4. 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.

Frequently asked questions

Apply consistent formatting to JavaScript that uses Flow type annotations, declarations, imports, and component syntax.
Paste Flow source code, including type aliases, interfaces, generics, exact object types, or ordinary JavaScript.
Select indentation and formatting preferences supported by the underlying formatter.
Experimental or version-specific Flow syntax may require a matching parser version and can fail even when the code works in a configured project.