Hi there! I found some tricky behaviour with define-flow-type rule:
type A = {foo: Foo};
Foo();
no-undef with define-flow-type rules will not pay attention to Foo variable. It starts to be global. Yeah, Flow checks it, but see real code that cause of issue:
type Props = {children: React.Node};
export default React.memo(({ children }: Props) => children)
Flow and eslint were not give the error. But in runtime error was thrown "React is not defined" because it does have react import.
I suggest making the option for this rule like ignoreTypes. It will be array with all types that will not were global.
What do you think about it? Thanks!
Hi there! I found some tricky behaviour with
define-flow-typerule:no-undefwithdefine-flow-typerules will not pay attention toFoovariable. It starts to be global. Yeah, Flow checks it, but see real code that cause of issue:Flow and eslint were not give the error. But in runtime error was thrown "React is not defined" because it does have react import.
I suggest making the option for this rule like
ignoreTypes. It will be array with all types that will not were global.What do you think about it? Thanks!