Table of Contents

Flow-type layer

Table of ContentsClose

1 Description

This layer adds support for static type checking in javascript based on the flow project to spacemacs.

1.1 Features:

  • Syntax highlighting
  • Linting
  • Code-completion
  • Eldoc integration for flow-types
  • Compilation

2 Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add flow-type to the existing dotspacemacs-configuration-layers list.

In addition you also need to flow binary installed best with npm like shown below.

$ npm install -g flow-bin

The type under the cursor is shown automatically using eldoc. You may find this a little sluggish, depending on your setup - if so, you can disable it by setting flow-type-enable-eldoc-type-info to nil.

(flow-type :variables flow-type-enable-eldoc-type-info nil)

You can always show types manually using flow-minor-type-at-pos, bound to SPC m f t by default.

3 Key bindings

Key binding Description
SPC m f b jump back from definition
SPC m f c run `flow status' as a compiler
SPC m f d jump to the definition of the variable under the cursor
SPC m f f show flow suggestions
SPC m f o print coverage information

Author: root

Created: 2020-01-25 Sat 15:22

Validate