documentationjs / documentationjs/documentation

Support for ".js.flow” style workflow?

Open
#686 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
5.8k
Forks
481
PR merge metrics
No merged PRs in 30d

Description

Curious.
Is there currently a way to get proper documentation from a ".js.flow" based project workflow, as documented [here](https://flowtype.org/docs/declarations.html#declaration-files)?

My personal library project is organised in the following manner:

- Per function/class module files (``puts.js`` in this specific case) with the following syntax:

```js
/**
* This is a function
*/
function puts(str) {
// do some stuff
}

module.exports = puts;
```

- A ``main.js`` cumulating all the existing modules, exposing them as one

```js
module.exports = {
puts: require("./src/puts")
}
```

- A ``main.js.flow`` declaring all the typings.

```js
declare export function puts(str: string): void;
```

What I expect to see is something akin to

> puts(str: string)
**Parameters**
str (string)

What ``documentation build main.js -f html -o docs`` actually produces is:

> puts(str: any)
**Parameters**
str (any)

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.