reactjs / reactjs/react-docgen
@defaultValue is not parsed from interface
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 3.8k
- Fork
- 316
- Merge medio
- 5h 7m
- PR unite (30g)
- 4
Descrizione
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
}
}
}
}
]
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci l’esempio di interfaccia TypeScript nel playground di react-docgen e verifica come vengono analizzati i relativi tag JSDoc. Conferma che @defaultValue venga rimosso dalla descrizione e prodotto come defaultValue non calcolato con il valore previsto; usa l’output mostrato come verifica del completamento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 48/100