ESLint reports no-undef error on flow-typed global types

Viewed 3921

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?

2 Answers
Related