Some functions are erroneously listed as returning `undefined`
Maintainer antworten meist innerhalb von 3 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- javascript
- Bereich
- documentation, tooling
Rechercherichtung
Beginne damit, die auf den verlinkten net-, buffer-, fs-, http-, sqlite- und url-Dokumentationsseiten angezeigten Rückgabetypen mit ihren Quelldeskriptionen zu vergleichen. Verfolge, wie doc-kit Rückgabeinformationen normalisiert, insbesondere Konstruktoren, Überladungen, asynchrone Bereinigungsmethoden und nicht standardisierte Beschreibungen. Erledigt ist die Aufgabe, wenn die aufgeführten Beispiele genaue Typen anzeigen oder sie weglassen, wenn die Quelle mehrdeutig ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
URL:
https://beta.docs.nodejs.org/net.html#blocklistisblocklistvalue
Browser Name:
Firefox, Chrome
Browser Version:
153.0
Operating System:
macOS 15.7.8
How to reproduce the issue:
The new return type annotations are incorrect if a function has a non-standard description of its return value. An illustrative example is BlockList.isBlockList, which incorrectly shows undefined:
A non-exhaustive list of other examples I've found:
- https://beta.docs.nodejs.org/net.html#new-netsocketaddressoptions shows a return type of
voidfrom the constructor - https://beta.docs.nodejs.org/net.html#blocklisttojson
- https://beta.docs.nodejs.org/net.html#socketaddressparseinput (does not list
undefinedas a possible return) - https://beta.docs.nodejs.org/net.html#new-netboundsocketoptions shows a return type of
voidfrom the constructor - https://beta.docs.nodejs.org/buffer.html#new-bufferblobsources-options shows a return type of
voidfrom the constructor - https://beta.docs.nodejs.org/buffer.html#blobbytes
- https://beta.docs.nodejs.org/buffer.html#blobslicestart-end-type
- https://beta.docs.nodejs.org/buffer.html#new-bufferarray (and related constructors)
- https://beta.docs.nodejs.org/buffer.html#new-bufferfilesources-filename-options
- https://beta.docs.nodejs.org/buffer.html#bufferatobdata
- https://beta.docs.nodejs.org/buffer.html#bufferbtoadata
- https://beta.docs.nodejs.org/fs.html#filehandlesymbolasyncdispose should return a
Promise, notvoid - https://beta.docs.nodejs.org/fs.html#dirsymbolasyncdispose also should return a
Promise - https://beta.docs.nodejs.org/fs.html#new-fsutf8streamoptions
- https://beta.docs.nodejs.org/http.html#new-agentoptions
- https://beta.docs.nodejs.org/http.html#httpgetoptions-callback this should return the same type as the alternative overload beneath it (i.e.
http.ClientRequest) - https://beta.docs.nodejs.org/http.html#httprequestoptions-callback also should return
http.ClientRequest - https://beta.docs.nodejs.org/sqlite.html#new-databasesyncpath-options
- https://beta.docs.nodejs.org/url.html#new-urlinput-base
- https://beta.docs.nodejs.org/url.html#new-urlpattern (and variants)
- https://beta.docs.nodejs.org/url.html#urlpatterntestinput-baseurl should return
boolean - https://beta.docs.nodejs.org/url.html#new-urlsearchparams (and variants)
- https://beta.docs.nodejs.org/url.html#urlformaturlobject (should return a
string)
Brian edit: converted these to list items for tracking
Presumably these are issues with the source data, which should be made consistent. But previously the documentation "got away" with it because it didn't try to show this normalised value. In the new documentation, it is probably better to err towards not showing the type in cases where it is not clear, to avoid confusion from mismatches.
Common themes are:
- constructors shown as returning
void - async dispose methods shown as returning
voidinstead ofPromise, as required by the interface - functions with non-standard return text shown as returning
undefined - occasionally functions with multiple possible return types only showing the first option
- some functions which have annotated their return type in the comments instead of in a structured way
- overloaded functions only setting a return type on the last overload
- Vorherrschende Sprache
- JavaScript
- Sterne
- 68
- Forks
- 74
- Ø Merge
- 3 T. 23 Std.
- Gemergte PRs (30 T.)
- 43
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus nodejs/doc-kit
-
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 68/100
nodejs/doc-kit#1085 · 6 Kommentare ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
nodejs/doc-kit#1054 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
nodejs/doc-kit#1119 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 3 Tagen
-
Can the links to previews in the comments generated by a PR include `doc-kit`?Evtl. vergeben @avivkeller hat das vor 25 Tagen übernommen. Offen
nodejs/doc-kit#1098 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 3 Tagen
-
index page's ToC mark "stability index" as legacyEvtl. vergeben @avivkeller hat das vor 25 Tagen übernommen. Offen
nodejs/doc-kit#1053 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 3 Tagen
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
documentation good first issue help wanted
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 85/100
zmo2s/agent-toolbox#23 ·
-
[Bug]: [MCP/CLI] Bare loopback IP addresses (127.0.0.1:port) and hosts with ports fail to navigate due to erroneous scheme inferenceEvtl. vergeben @alok-108 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
microsoft/playwright#43263 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug traffic
Schwierigkeit 2/5 Unter einer Stunde Anfängerfreundlichkeit 74/100