I have global types defined in /flow-typed/redux.flow.js
:
declare type Action = {|
+type: string,
+payload: any,
|}
declare type State = {|
+ui: UI,
+user: User,
+team: Team,
+projects: Project[],
+profile: Profile,
|}
declare type UI = {|
+isSliderOpen: boolean,
+isModalVisible: boolean,
+modalAction: string,
+modalPayload: Object,
|}
...
I have added airbnb eslint configuration to my project and now I get:
type Props = {
logout: () => Action, //error ESLint 'Action' is not defined.(no-undef)
user: UserDetails, //error ESLint 'UserDetails' is not defined.(no-undef)
}
Its purelly eslint fault. Everything is configured properly and flow by itself is happy.
How to tell eslint that these types are indeed declared as global? or should I add them to some ignore list?
It turned out (like I thought) the way is not to add global types to eslint ignore list. Actually it's is all handled by eslint-plugin-flowtype which I already had installed but I didn't extend it like:
.eslintrc
"extends": ["airbnb", "plugin:flowtype/recommended"],
"plugins": [
"flowtype"
],
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With