bug(date-adapter): Misleading JSDoc for createDate returns type
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 78/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- angular, typescript
- Domain
- documentation
Research direction
Start at components/src/material/core/datetime/date-adapter.ts around line 110 and inspect the createDate method's JSDoc alongside its declared return type. Confirm the documented invalid-input behavior against the method description and implementations mentioned in the issue. Done means the JSDoc accurately describes the return type and what happens when the input is invalid.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 80
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from angular/components
-
area: material/tree docs gemini-triaged needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
angular/components#33832 ·
-
area: material/datepicker gemini-triaged P4
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
angular/components#33763 · 2 comments · 3 reactions ·
-
area: material/table gemini-triaged P4
Difficulty 1/5 Under an hour Newbie friendliness 88/100
angular/components#33709 · 1 comment ·
-
area: material/table docs gemini-triaged P4
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
angular/components#33455 ·
-
area: material/dialog P2
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
angular/components#30536 · 3 reactions ·
All issues in angular/components
Similar issues
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supermomonga/zcode-acp#24 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100