Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Some functions are erroneously listed as returning `undefined`

Aberta
#953 11 comentários 2 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 3 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
javascript

Direção de pesquisa

Comece comparando os tipos de retorno exibidos nas páginas de documentação vinculadas de net, buffer, fs, http, sqlite e url com suas descrições de origem. Rastreie como o doc-kit normaliza as informações de retorno, especialmente construtores, sobrecargas, métodos de descarte assíncronos e descrições não padrão. Considera-se concluído quando os exemplos listados mostram tipos precisos ou os omitem quando a origem é ambígua.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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
Linguagem predominante
JavaScript
Estrelas
69
Forks
74
Merge médio
4d 2h
PRs com merge (30d)
52

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de nodejs/doc-kit

Todas as issues de nodejs/doc-kit

Issues semelhantes

Mais issues de JavaScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.