question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Install flow type definitions from Jest by default or suggest it

See original GitHub issue

I think the suggested flow config should also include the following line:

[libs]
/flow-typed/

So that flow will recognize the definitions if you run:

flow-typed install jest -f 0.30

It would be helpful to add some info in the README about this process of adding type definitions to the project. Maybe the type definition of Jest could actually be added by default?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
jeffmocommented, Aug 16, 2016

There’s no need for config here (I’ve never felt so proud!) – <PROJECT_ROOT>/flow-typed is already a default [libs] dir in Flow.

So as long as that directory exists, any .js files in it are considered libdefs even without a [libs] section in the .flowconfig.

3reactions
jamiebuildscommented, Aug 16, 2016

The Flow team has plans for a flow-typed install command that will automatically install libdefs for all of your dependencies and stub the ones that do not have libdefs. So this workflow will be improved in the future not just for Jest but for everything.

In the meantime it might make sense for create-react-app to ship with a [lib] directory with all of the dependencies that create-react-app adds by default. Then can be added to a .flowconfig fairly easily.

cc @jeffmo

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running Jest tests with Flow typed Javascript files
This will be a simple tutorial about running Jest tests with Flow typed Javascript files in NodeJS project.
Read more >
What's the right way to write Jest tests verified with Flow?
1.Install flow to your project. If you use create-reat-app, here is a guide for this step. yarn add -D flow-bin yarn run flow...
Read more >
Library Definitions | Flow
We recommend checking out the flow-typed tool and repository , which helps you quickly find and install pre-existing libdefs for your third-party dependencies....
Read more >
Configuring Jest
Configuring Jest. The Jest philosophy is to work great by default, but sometimes you just need more configuration power.
Read more >
TypeScript | WebStorm Documentation - JetBrains
In the TypeScript field, specify the version of the TypeScript to use (WebStorm displays the currently chosen version). By default, the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found