Skip to content

Errors and linting

Lorenzo Pichilli edited this page May 13, 2018 · 13 revisions

First of all you need to create a JavaScript project (see Creating a JavaScript Project page). Also, see below to know how to enable it in non-project files.

Type checking is done by Flow. To permit Flow to type check your files in the project, you must add the // @flow comment (see how it works: Flow - Docs and .flowconfig). To see what is the error, go with the cursor over the text. It will appear a red box with the error, like this:

You could also copy to clipboard the error.

Errors will be shown also at the bottom of the editor:

Also, you will get errors about wrong .flowconfig file configuration:

If you want disable Flow type checking completely on your project, just go to the project_settings.json and set "flow_checker_enabled": false.

To be able to apply the Flow type checking also in a file that is not an element of a project, you could activate the option in Tools > JavaScript Enhancements > Use Flow checker on current view (Not used in project):

You can navigate errors in a project using:

Shortcut Description
super + alt + b Go to next JavaScript error
super + alt + v Go to previous JavaScript error

or opening the Sublime Text Command Palette and typing Flow: :