eslint - flowtype marks individual package import as not found -


i'm trying begin using flowtype when importing sub packages, e.g.

import isarray 'lodash/isarray'; 

my eslint complaining required module not found.

i used flow-typed install install lib defs can found.

any idea on how tackle this?

thanks!

flow treating lodash/isarray it's own module needs told exports of module are.

modify lodash libdef export lodash/isarray also.

you can (i extracted out subset of libdef , showed need change)

declare module 'lodash/isarray' {   declare function isarray(value: any): bool;    declare module.exports: typeof isarray }  declare module 'lodash' {   declare class lodash {     isarray: $exports<'lodash/isarray'>   }    declare var exports: lodash; } 

let me know if have questions.

if it's normal people load lodash modules way you're doing it, whole libdef should updated support use case.


Comments