-
Notifications
You must be signed in to change notification settings - Fork 308
Flow errors #781
Comments
You should ignore node_modules in your .flowconfig, and consider using the flow-typed definitions for Radium: https://github.com/flowtype/flow-typed/blob/master/definitions/npm/radium_v0.17.x/flow_%3E%3Dv0.23.x/radium_v0.17.x.js |
No, ignoring the entire |
No, it is a very good idea, because there is no guarantee they are using the same version of flow as you, or, as you are seeing, the same flowconfig as you. You should be using flow-typed or create declaration files to get coverage. If you want, you can also just ignore node_modules/radium, as in facebook/flow#869 |
I'll clarify a couple points: Putting The workaround is to ignore However, what I don't understand is why
This would fix it: export default class StyleSheet extends Component {
static contextTypes = {
_radiumStyleKeeper: React.PropTypes.instanceOf(StyleKeeper)
};
state: {
css: string
}; Again, I don't know why the Radium repo passes all Flow checks. I'm not experienced enough with Flow to know what's going on, and why my project is being pickier. There's nothing too different in Radium's |
@alexlande was looking at upgrading Radium to the latest flow version which might help. Anyway, I can tell you for certain (I work at Facebook and talk frequently with the Flow team) that ignoring node_modules is the recommended route, for exactly the reason you are running into. |
Oh! Well I appreciate the insight :) Not to go off-topic, but how do I prevent all these errors from popping up when I ignore the
|
You need to either create declaration files for the modules or import them from flow-typed. Basically you add type files that are completely separate from the actual modules. |
Ok, looks like I have some reading up to do. Thanks for the info. |
what i'm thinking why not to update flowtype to mind order of include/ignore. for example we have around 200 node modules, where only about ~10 - 15 of them so this would work perfectly fine: [ignore]
.*/node_modules/.*
[include]
.*/node_modules/react
.*/node_modules/redux-react
... possible ? |
I tried the following but seems that it doesn't work: [ignore] [include] I'm still receiving |
I think you need to add flow file to lib.
|
I see that Flow annotations were added (recently?). Unfortunately, they don't pass. Here's the output I'm getting when I run
npm run flow
in my project which uses Radium:The text was updated successfully, but these errors were encountered: