-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add support for flow type imports #21
base: master
Are you sure you want to change the base?
Conversation
@ganemone The code seems has been formatted in this commit by prettier |
@wangtao0101 Ok - I updated the PR to remove the formatting changes |
if (!packageJson.hasOwnProperty('main')) | ||
return; | ||
let mainFilePath = path.join(modulePath, packageJson.main); | ||
let mainFilePath = path.join(modulePath, 'src/index.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there maybe no src/index.js
in node_modules in most of case, src
directory will ignore in npmignore .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is actually a common pattern with flow types to include the src
directory when publishing to npm. This is how flow will resolve types in node_modules.
@wangtao0101 thoughts on getting this merged? Happy to make any more updates you ask for |
@ganemone I think we should not check 'src/index' for main entry, maybe you can scan both mainfile in packagejson and 'src/index' |
@wangtao0101 I do check both |
Curious what the status is of this PR? I was hunting for a vscode plugin that does auto imports of flow types and ran into this! |
I'm also looking for auto import of flow types. This plugin is already great and having the ability to import Flow types would really help me out. |
This adds support for automatically importing flow types
Fixes #12