-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
import flow type from index.js.flow file: #616
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I don't know how much we are willing to support Flow. I started using it recently (and really like it), so I'm all for supporting it, especially as we already have some rules that handle Flow differently. I don't know how @benmosher feels about this though. That said, this might be a better fit for a custom resolver (see https://github.com/tleunen/eslint-import-resolver-babel-module for instance). Either way, it would be nice to have docs on how this gets resolved. cc @thejameskyle. |
Would it not make sense to try |
That sounds good to me. Are there any other files that you attempt to resolve it to when |
@jfmengels seems not for me. And don't forget about specific '.' or '/' case for 'index.js' - 'index.js.flow' case, please. |
This could be handled by configuring the Node resolver with |
Actually, maybe this would be best handled with a Flow-based shared config, like the existing React, Electron, etc. ones, example https://github.com/benmosher/eslint-plugin-import/blob/master/config/react-native.js |
Is this issue still relevant? If not let me know and I will open a new issue for my specific problem. Related to example provided by OP, it is also 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
but this works and results in no eslint error
|
It's working, at least in 2.3.0. I mean my initial
|
Thanks for the update. I don't think that is our particular issue - we don't have redux-form in our I will open a new issue since it sounds like this one is for a different, resolved problem. EDIT: opened as #927 |
I'm closing this one due to inactivity, and looks like the problem is resolved? |
When I do
import type MyType from '.'
flow itself correctly assumes that fileindex.js.flow
should be used, but eslint plugin searches forindex.js
first and only then forindex.js.flow
. For other filenames, this works normally. For my case, I should use importtype Type from './index.js.flow'
, that is quite verbose. Otherwise, I getUnable to resolve path to module '.' import/no-unresolved
errorThe text was updated successfully, but these errors were encountered: