facebook / facebook/flow

Question: conventions for vendor libs

Abierto
#3,671 1 comentario 0 reacciones 0 asignados Ver en GitHub
declarations question
Lenguaje dominante
Rust
Estrellas
22.3k
Forks
1.9k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.