documentationjs / documentationjs/documentation
Flow type imports syntax is not enough to have module documented
- 主要言語
- JavaScript
- スター
- 5.8k
- フォーク
- 481
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Hi,
I'm trying to use `documentation.js` 4.0.0-beta.18 with `Flow` and it's working pretty well for infering types. However, my code is spread across several modules and I would like to use the [Flow type imports syntax](https://flowtype.org/docs/modules.html#type-imports--exports) like this:
```javascript
// index.js
// @flow
import type {MyNumber} from './types';
/**
* My number
*/
const myNumber: MyNumber = 1;
```
```javascript
// types.js
// @flow
/**
* My number type
*/
type MyNumber = number;
export type {
MyNumber
};
```
Here is the page generated by `documentation.js`:

But instead I would expect:

Where `MyNumber` type is added to the documentation.
If I change `index.js` like this:
```diff
// @flow
+import './types';
import type {MyNumber} from './types';
```
Then I'll have the result of the second image.
So to me, it seems like an `import type` statement is not enough to have `documentation.js` look up the content of the imported module.
Can we add support for this `import type` syntax into `documentation.js` ? If yes, do you have an idea of where should I start if I wanted to change the actual behaviour and submit a PR ?
Thanks!
コントリビューションガイド
調査の方向性
示されている index.js と types.js の例を documentation.js で使用して問題を再現し、その後、インポートされたモジュールと Flow の型インポートがどのように扱われるかを調査してください。生成されたドキュメントに MyNumber 型が含まれ、別個の値のインポートを追加する必要がないことを確認して、動作の変更を確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- documentation
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100