function foo(val /* : boolean */) /* : string */ {}
Using really powerful inference you can also write much fewer types. If you have well types libraries [you sometimes don't need types in your code at all](https://medium.com/@thejameskyle/flow-mapping-an-object-373d...). function bar(x) /* : string */ {
No compiling necessary $ npm install --save-dev babel-plugin-transform-flow-strip-types
Then update your `.babelrc`: { plugins: ["transform-flow-strip-types"] }
2. Setting up with ESLint $ npm install --save-dev eslint-plugin-flowtype-errors
Then update your `.eslintrc`: { plugins: ["flowtype-errors"] }
Then just install `flow-bin` and create an empty `.flowconfig` file in the root of your repo and you're done. Now you have Babel compiling your code the same as always and you can use the Flow type syntax, and with ESLint you probably already have your editor all setup to show you warnings. $ npm install babel-cli
$ babel src -d lib
To this: $ npm install babel-cli babel-preset-es2015
$ echo '{ presets: ["es2015"] }' >> .babelrc
$ babel src -d lib
It really wasn't that big of a change.
This means that you have the language designers themselves maintaining some of the most important crates in the ecosystem, and baking it into their process to iterate on the language itself. The result is really high quality crates and the community is better for it.
I'm not trying to dunk on JavaScript/npm packages though, or anyone involved in developing the language. Clearly the JS community has found success and is meeting a lot of people's needs. We can accept that Rome's requirements are different than most people using JavaScript.