Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

bug(date-adapter): Misleading JSDoc for createDate returns type

Aperta Adatta ai principianti
#33,059 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

area: material/core gemini-triaged P3
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

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di angular/components

Tutte le issue di angular/components

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.