-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
False positives when importing from flow-typed module declarations #708
Comments
Seeing the same error. Not sure exactly how to solve it. |
I guess there are two main different ways to solve this problem:
I'm leaning towards option 2. If the user is already using Flow, there's a good chance Flow itself will catch any invalid imports like this. In most cases, there should be no need for two different tools reporting the same problem, one would be enough. Often even preferred. If you want, you can apply a temporary local hack for the second solution by editing if (node.importKind === 'type') return; to the start of |
I feel as though option 2 would be a good solution to this problem. @mjomble you are right that flow will catch any invalid imports. Is anyone working on this? Otherwise I might see if I can add this as a rule to the plugin. |
Experiencing the same thing. Anyone working on a PR for this? I may be able to help. |
I'm not working on a PR |
This fixes import-js#708 without ignoring all type imports.
From our experience and comments/reactions in #881, it seems like this issue may still be open. Possible to reopen, or should I open a new issue? Thanks! |
Please open a new issue; it's been many months, so it's possible your problem is different. |
Explicit imports from flow-typed module declarations seem to yield false positives.
Example:
The error should not appear because flow can attach declared types to named modules via flow-typed or other library files, even if the modules themselves do not export those types. In the example above, redux does not export any types. Instead, a flow-typed library handles the type declarations.
The text was updated successfully, but these errors were encountered: