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

[Question]: How to clean all empty stubs after flow-typed install ? #4572

Open
bacloud23 opened this issue May 12, 2024 · 2 comments
Open

[Question]: How to clean all empty stubs after flow-typed install ? #4572

bacloud23 opened this issue May 12, 2024 · 2 comments
Assignees
Labels

Comments

@bacloud23
Copy link

bacloud23 commented May 12, 2024

What do you want to know?

Hi,
I've started using flow and little by little I'm really liking the power of it.

Now I generated stubs for all dependencies, but knowing that there are mostly empty definitions, I understand that the purpose is to type them all. but this is unpractical for most projects. I think it is more normal to expect users of this tool to only use already defined libdefs rather than to expect everyone using flow-typed to provide more definitions.

The major problem because of it, I'm asking, is that I'm using webstorm which supports // @flow fine, but after generating stubs, I lost all auto completion, so instead of indexing definitions from node_module it is looking in flow-typed folder, which is expected.

To sum up, it would be better to have only provided libdefs when you run flow-typed install, or to

Kindly <3

@bacloud23
Copy link
Author

bacloud23 commented May 12, 2024

ok my bad, I missed flow-install -s

but I'm facing another problem, It successfully generated some stubs for some dependencies. but it didn't for some others.

For instance, it didn't install ioredis until I explicitly run flow-typed install ioredis@4.

@bacloud23 bacloud23 reopened this May 12, 2024
@Brianzchen
Copy link
Member

Hi, I'm glad you're enjoying flow, it's an extremely powerful tool to add to your javascript projects. To start I want to make a very strong suggestion that you give VSCode instead of webstorm a go because iirc features like https://flow.org/en/docs/types/mapped-types/ can't be parsed correctly and you'll get lots of errors on your text editor, at least not with IntelliJ which a colleague of mine was using prior.

Anyways back to your question, can you please provide

  1. What version of flow-typed are you on, flow-typed --version
  2. Can you please send us your output when you run flow-typed install? It should print out every dependency you are using and whether it was able to find real definition and install it.

In thinking about this, is ioredis specified in your package.json dependencies? Or are you depending on it as a transitive dependency in which case flow-typed does not download these libdefs for you intentionally.

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

No branches or pull requests

2 participants