reactjs / reactjs/react-docgen
@defaultValue is not parsed from interface
オープン
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 3.8k
- フォーク
- 316
- 平均マージ
- 5時間 7分
- マージ済み PR(30日)
- 4
説明
The following code tested in the playgroud https://react-docgen.dev/playground
interface Props {
/**
* The name to greet
*
* @defaultValue 'something'
*/
name: string;
}
/**
* Hello world component
*/
const MyComponent = (props: Props) => {
return <div />;
}
returns:
[
{
"description": "Hello world component",
"displayName": "MyComponent",
"methods": [],
"props": {
"name": {
"required": true,
"tsType": {
"name": "string"
},
"description": "The name to greet\n\n@defaultValue 'something'"
}
}
}
]
I think the defaultValue property is missing and should appear in the result, and part of the description "@defaultValue 'something'" should be removed.
[
{
"description": "Hello world component",
"displayName": "MyComponent",
"methods": [],
"props": {
"name": {
"required": true,
"tsType": {
"name": "string"
},
"description": "The name to greet",
"defaultValue": {
"value": "'something'",
"computed": false
}
}
}
}
]
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
react-docgen playground で TypeScript のインターフェース例を再現し、その JSDoc タグがどのように解析されるかを確認します。@defaultValue が説明から削除され、期待される値を持つ非計算の defaultValue として出力されることを確認します。完了確認には、示されている出力を使用します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 48/100