Static Type Checking
Probably you have noticed it’s a lot easier to develop new projects than support old ones. That’s because of complexity that tends to grow fast as we add new features to the program.
So, you might start breaking up your code into smaller modules, then add testingand maybe add some linting. But what about the way those modules interact with each other? Wouldn’t be great if we can define a contract that sets clear boundaries of what to except and enforce it? And that’s where static type checking comes in.
Also, Meteor has some plans to move on with TypeScript and is encouraging developers to help out with the conversion to TypeScript. But we’ll be using FlowType which is supported by the ecmascript package. Flow is much easier to pick up and can be incrementally adopted. Don’t worry if you can use one you won’t face much trouble using the other.
meteor npm i --save-dev flow-bin eslint-plugin-flowtype
This is an opionated configuration.
.flowconfig file inside your project root:
If you’re using vscode there’re few adjustments to be made. And that’s it, enjoy!