Skip to content

Adding new definitions with flow typed

Lorenzo Pichilli edited this page Jan 1, 2018 · 1 revision

For example I have an Express project, but i don't have the Flow definitions about express self, so I get these errors:

So, to add a new definition with flow-type into your JavaScript project go to Tools > Flow > Add Flow definition:

Then search for express with search-bar at the bottom of Sublime Text:

At the end of the search done with the flow-typed CLI (flow-typed is a central repository for Flow library definitions, more info here), if it didn't find anything then Sublime Text will inform you with this message No definitions found, sorry! at the bottom of the view, instead if it gets some results then you will see this:

In this case I select the second option, then it will start with the installation process with this message at the bottom of the view Installing definition package_name@version.... If the installation isn't successful then you will see Can't install package_name@version definition! Something went wrong, sorry! message, instead if it is successful you will see this message at the bottom of the view:

The new definition is installed in the standard directory of flow-typed CLI, so in your project you will see a new folder named flow-typed. After that, you won't get the errors previously seen anymore: