Skip to content

[named] flow-typed definitions are not used unless node_modules are ignored #931

@IanVS

Description

@IanVS

eslint-plugin-import: 7.2.0

I was having the same issue as #708, where modules whose types are defined in a flow-typed definition were throwing false positive import/named errors about not being found.

I realized that adding the following to my .eslintrc solves the problem:

settings:
    import/ignore:
      - node_modules

So, it seems that if node_modules are not ignored, this plugin will look into the node_module for the type definition, and if it doesn't find it, it throws an error. Ideally, it would also look in flow-typed (using whatever method it's currently using when node_modules are ignored) before reporting the error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions