Skip to main content


Flow 是 JavaScript 代码的静态类型检查器。它做了很多工作来提高你的工作效率。让你更快、更智能、更自信、更大规模地编码。

¥Flow is a static type checker for your JavaScript code. It does a lot of work to make you more productive. Making you code faster, smarter, more confidently, and to a bigger scale.

Flow 通过静态类型注释检查代码中的错误。这些类型允许你告诉 Flow 你希望代码如何工作,Flow 将确保它确实按照这种方式工作。

¥Flow checks your code for errors through static type annotations. These types allow you to tell Flow how you want your code to work, and Flow will make sure it does work that way.

1function square(n: number): number {2  return n * n;3}4
5square("2"); // Error!

第一步:安装 Flow

¥First step: install Flow.