facebook / facebook/flow

Question: conventions for vendor libs

Open
#3,671 1 comment 0 reactions 0 assignees View on GitHub
declarations question
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

There is something which I don't understand as I'm new at Flow.

The AVA test runner project has the index.flow.js file in the repo and there is no typing for this project in the flow-typed repository. I saw an ongoing discussion about this topic at flowtype/flow-typed#286 but I didn't find any answer. My question is, is it an existing convention that a package author has to place an `index.flow.js` file in the module to be recognized by Flow if someone installs it as a dependency? Or is the files section of package.json is important?

```
"files": [
"lib",
"*.js",
"*.js.flow", // <---- ?
"types/generated.d.ts"
],
```

Or Flow just simply processes every file in my dependency with the comment `@flow`? This also means if I ignore the node modules folder in my .flowconfig, I won't have any typings for libs like AVA? If that's the case, what can you do? It seems copy-pasting the file from the node_modules/ava folder to the flow-typed/npm subfolder is not a proper fix because it seems the Flow file "index.flow.js" and the so-called "libdef file" has a different language/syntax.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.