// 项目中安装flow
yarn run flow init // 初始化,生成 .flowconfig 文件
yanr run flow // 运行flow
运行flow之后检测的结果为
Spawned flow server(pid=26042)
Logs will go to /private/tmp/flow/zSUserszSsataniyazSDesktopzSdemo.log
Monitor logs will go to /private/tmp/flow/zSUserszSsataniyazSDesktopzSdemo.monitor_log
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ demo.js:3:16
Cannot perform arithmetic operation because string [1] is not a number.[unsafe-addition]1│ // @flow2│ functionHello(num){3│ return2* num
4│ }5│
[1]6│ Hello("ok")
Found 1 error
可以看见 demo.js:3:16出现了错误,主要是because string [1] is not a number,也就是说输入的参数不是一个数字(number类型)