Some functions are erroneously listed as returning `undefined`
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
- Domínio
- documentation, tooling
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
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
- Linguagem predominante
- JavaScript
- Estrelas
- 69
- Forks
- 74
- Merge médio
- 4d 2h
- PRs com merge (30d)
- 52
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de nodejs/doc-kit
-
Dificuldade 2/5 Meio dia Facilidade para iniciantes 68/100
nodejs/doc-kit#1085 · 6 comentários ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
nodejs/doc-kit#1054 · 1 comentário ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 45/100
nodejs/doc-kit#1167 · 2 reações ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
nodejs/doc-kit#1119 · 3 comentários ·
Mantenedores costumam responder em até 3 dias
-
Can the links to previews in the comments generated by a PR include `doc-kit`?Talvez livre de novo @avivkeller assumiu há 32 dias e não há nenhum pull request aberto. Aberta
nodejs/doc-kit#1098 · 2 comentários · 1 responsável ·
Mantenedores costumam responder em até 3 dias
Todas as issues de nodejs/doc-kit
Issues semelhantes
-
release:v5.34
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
Jason-Vaughan/TangleClaw#2469 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
hacktoberfest help wanted skip-changelog
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
wassim-azi/agy-powerline#74 ·
Mantenedores costumam responder em até 1 dia
-
tests
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
smonn/validator-fns#741 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Mantenedores costumam responder em até 2 dias