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

Some functions are erroneously listed as returning `undefined`

Aperta
#953 11 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript

Direzione di ricerca

Inizia confrontando i tipi restituiti mostrati nelle pagine di documentazione collegate di net, buffer, fs, http, sqlite e url con le relative descrizioni sorgente. Traccia il modo in cui doc-kit normalizza le informazioni sui valori restituiti, in particolare costruttori, overload, metodi di smaltimento asincroni e descrizioni non standard. Il lavoro è completato quando gli esempi elencati mostrano tipi accurati oppure li omettono quando la fonte è ambigua.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

downstream help wanted Web Generator
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:

Method with inconsistent return values

A non-exhaustive list of other examples I've found:

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 void instead of Promise, 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
Lingua principale
JavaScript
Stelle
65
Fork
71
Merge medio
4g 3h
PR unite (30g)
31

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 nodejs/doc-kit

Tutte le issue di nodejs/doc-kit

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.