bug(date-adapter): Misleading JSDoc for createDate returns type
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 78/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- angular, typescript
- Ambito
- documentation
Direzione di ricerca
Inizia da components/src/material/core/datetime/date-adapter.ts intorno alla riga 110 e controlla lo JSDoc del metodo createDate insieme al tipo restituito dichiarato. Verifica il comportamento documentato per gli input non validi rispetto alla descrizione del metodo e alle implementazioni menzionate nell’issue. Il lavoro è completato quando lo JSDoc descrive accuratamente il tipo restituito e cosa accade quando l’input non è valido.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
(I don't know if it sould be a bug or docs-bug, because it's about JSDoc that not available in the material doc
website, so I couldn't join a link to the doc and create a docs-bug issue).
In the JSDoc of the DateAdapter createDate method, the returns tag indicates that :
@returns The new date, or null if invalid.
But the method returns type is just D, not D | null so it can't be null.
And in the different implementations of the date adapter, when the params are invalid, an error is throws, not a null return.
Reproduction
This bug is more a docs-bug, but date-adapter JSDoc is not directly available from the doc website, so I couldn't join a link to create a docs-bug.
The components/src/material/core/datetime/date-adapter.ts, line 110
Expected Behavior
the returns tag indicates that an error is throws when invalid
Actual Behavior
the returns tag indicates that null is returned when invalid
Environment
no specific env
- Lingua principale
- TypeScript
- Stelle
- 25k
- Fork
- 6.8k
- Merge medio
- 1g 2h
- PR unite (30g)
- 80
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.
Altre issue di angular/components
-
area: material/tree docs gemini-triaged needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
angular/components#33832 ·
-
area: material/datepicker gemini-triaged P4
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
angular/components#33763 · 2 commenti · 3 reazioni ·
-
area: material/table gemini-triaged P4
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
angular/components#33709 · 1 commento ·
-
area: material/table docs gemini-triaged P4
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
angular/components#33455 ·
-
area: material/dialog P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
angular/components#30536 · 3 reazioni ·
Tutte le issue di angular/components
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
bug v2
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
modelcontextprotocol/inspector#2458 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
carbon-design-system/ibm-products#9907 ·