Install:

npm i -D flow-bin
npm i -g flow-bin

Init:

flow init

Script:

"typecheck": "flow src"

Check the src folder.

Add mark to the file which you want to check:

/*@flow */

function to be checked:

function add(x: number, y: number){

    return x + y;

}

add(1, '2');

When the flow runs, it will report the error because '2' we passed in is a string not a number.


Notic: Flow only works with Mac and Linux.

See more: Link

[React Flow] Up and Running with Facebook Flow for Typed JavaScript的更多相关文章

  1. Intel® Threading Building Blocks (Intel® TBB) Developer Guide 中文 Parallelizing Data Flow and Dependence Graphs并行化data flow和依赖图

    https://www.threadingbuildingblocks.org/docs/help/index.htm Parallelizing Data Flow and Dependency G ...

  2. Bear 實驗室: 什麼是Git flow ? 如何在SourceTree使用Git flow管理開發!

      http://www.takobear.tw/12/post/2014/02/bear-git-flow-sourcetreegit-flow.html     Bear 實驗室: 什麼是Git ...

  3. [React Native] Up and Running

    We'll download the requirements for getting started with React Native, refactor our app to ES6, walk ...

  4. 关于React Native 报Export declarations are not supported by current JavaScript version错误的解决问题

    设置.js文件默认以jsx的语法打开 在没有进行设置的情况下,每次打开WebStorm的时候打开包含jsx语法的.js文件都会有以下提示: 当然我们点击转换后就可以了,但是每次都会提示,所以还是来一个 ...

  5. React Native填坑之旅--Flow篇(番外)

    flow不是React Native必会的技能,但是作为正式的产品开发优势很有必要掌握的技能之一.所以,算是RN填坑之旅系列的番外篇. Flow是一个静态的检查类型检查工具,设计之初的目的就是为了可以 ...

  6. Flow简易教程——安装篇

    .mydoc_h1{ margin: 0 0 1em; } .mydoc_h1_a{ color: #2c3e50; text-decoration: none; font-size: 2em; } ...

  7. 【JavaScript】ESlint & Prettier & Flow组合,得此三神助,混沌归太清

    Flow Flow的意义 Flow是faceBook开源的一个JavaScript静态类型检查工具,作用类似TypeScript,但是它不像TS那样是一门独立的语言,而是作为一个babel-plugi ...

  8. Flow All In One

    Flow All In One Flow is a static type checker for JavaScript https://github.com/facebook/flow https: ...

  9. Flow: JavaScript静态类型检查工具

    Flow: JavaScript静态类型检查工具 Flow是Facebook出品的,针对JavaScript的静态类型检查工具.其代码托管在github之上,并遵守BSD开源协议. 关于Flow 它可 ...

随机推荐

  1. 如何用angularjs制作一个完整的表格之五__完整的案例

    由于本人也是边学边写,因此整理的比较乱,下面放出我例子的完整代码,方便大家交流测试,如有问题欢迎评论 首先,表格采用的是BootStrap样式编辑的,主要使用的是angularjs,为了方便也有jQu ...

  2. js实现placeholder效果

    <form name="testForm" action="" method=""> <input type=" ...

  3. openerp binary filed import export

    1: user  xmlrpc 2: use csv file to export import but want to change the csv model field_size_limit

  4. 获取工程的exe文件的所在目录

    Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName; 例如结果为:           C:\Documents and ...

  5. 使用C语言获取当前系统的时间

    要想使用C语言来获取当前系统的时间,办法如下: 需要提前准备的工作: #include <stdio.h> #include <time.h> #include <std ...

  6. SharePoint 2013 更新多个用户字段(Person or Group)

    有时我们需要更新一个用户到Person or Group类型的字段, 当然这个属性允许设置多个用户, 要如何才能添加新的用户到该字段,同时还不影响原始存在的值. 这里我们需要了解 SPFieldUse ...

  7. sql的执行顺序

    sql的一般执行顺序(8)SELECT (9)DISTINCT (11)<Top Num> <select list>(1)FROM [left_table](3)<jo ...

  8. MySQL ubuntu启动

    service mysql start 启动 service mysql restart 重启 service mysql stop 停止 mysql -uroot -ppassword 登入mysq ...

  9. BZOJ 3243 向量内积

    Description 两个\(d\)维向量\(A=[a_{1},a_{2},...,a_{d}]\)与\(B=[b_{1},b_{2},...,b_{d}]\)的内积为其相对应维度的权值的乘积和,即 ...

  10. Unity3d场景合并

    Unity3d场景合并 一.Unity3d场景合并,有一次的情况是这样的,就是我们是每个人都在开发,每个人有不同的场景,那么合并的时候,有些会出问题,那么我有一个好的方案,就是首先弄一个公共的资源库, ...