Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SpainTrain opened this issue Sep 14, 2017 · 1 comment

Comments

@SpainTrain
Copy link

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",
@danrot
Copy link

danrot commented Dec 5, 2017

Is it possible that this is only happening for interfaces?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants