Skip to content

Resolve index.js.flow files in npm modules (matching flow-cli behavior) #927

Open
@SpainTrain

Description

@SpainTrain

It is appears not possible to import types that are exported by an npm module in a natural way. For example, this works with flow but results in named error from eslint-plugin-import

import type {FormProps} from 'redux-form'

but this works and results in no eslint error

import type {FormProps} from 'redux-form/es/index.js.flow'

additionally

import type {FormProps} from 'redux-form/lib/index.js.flow'

I am happy to dig into root cause more (opening this now for tracking), but my guess is that the package.json module/main entries aren't being followed to find index.js.flow files. E.g., these fields in redux-form are

  "main": "./lib/index.js",
  "module": "./es/index.js",
  "jsnext:main": "./es/index.js",

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