facebook / facebook/flow

Question: conventions for vendor libs

Offen
#3,671 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
declarations question
Vorherrschende Sprache
Rust
Sterne
22.3k
Forks
1.9k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.