GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lib: fix JSDoc issues by Trott · Pull Request #45243 · nodejs/node

Conversation

@Trott

@Trott Trott commented Oct 30, 2022

Copy link
Copy Markdown
Member

Updating ESLint and dependencies will start flagging a few additional
JSDoc issues. One or two of these are simple fixes. The ESM stuff
requires throwing explicitly in JSDoc'ed functions rather than calling
another function to throw. I think this makes the code easier to
understand--you don't need to know that a particular function that
starts with throwsIf might throw but something that starts with
throwsAnythingElse will always throw. Instead, it's right there in the
code. This also might make it easier to improve stack traces if that's
something we'd like to do at some point.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot

nodejs-github-bot commented Oct 30, 2022

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/http
  • @nodejs/modules
  • @nodejs/net
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Oct 30, 2022

Copy link
Copy Markdown
Member Author

For easier review, look at just the first commit.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run. labels Oct 30, 2022
@Trott Trott mentioned this pull request Oct 30, 2022
tools: update eslint to 8.26.0 #45239
Closed
MoLow
MoLow approved these changes Oct 30, 2022
View reviewed changes
tniessen
tniessen approved these changes Oct 30, 2022
View reviewed changes
hybrist
hybrist approved these changes Oct 30, 2022
View reviewed changes
juanarbol
juanarbol approved these changes Oct 30, 2022
View reviewed changes
aduh95
aduh95 approved these changes Oct 30, 2022
View reviewed changes
@aduh95 aduh95 added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Oct 30, 2022
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Oct 30, 2022
@nodejs-github-bot

This comment was marked as outdated.

Sign in to view
@github-actions github-actions Bot mentioned this pull request Oct 31, 2022
CI Reliability 2022-10-31 nodejs/reliability#416
Open
19 tasks
@nodejs-github-bot

nodejs-github-bot commented Oct 31, 2022

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/47584/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

RaisinTen
RaisinTen approved these changes Oct 31, 2022
View reviewed changes
targos
targos approved these changes Oct 31, 2022
View reviewed changes
JakobJingleheimer
JakobJingleheimer reviewed Oct 31, 2022
View reviewed changes

@JakobJingleheimer JakobJingleheimer left a comment •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR doesn't update all the functions/utilities needed to achieve its goal around "throwIf" might throw. For example, validation utilities throw on fail—a specific example that is kinda broken in this PR is validateAssertions():

https://github.com/nodejs/node/blob/58470432cd7f944e4d7b231b3d987dbb1ecfd9c2/lib/internal/modules/esm/assert.js#L82
https://github.com/nodejs/node/blob/58470432cd7f944e4d7b231b3d987dbb1ecfd9c2/lib/internal/modules/esm/assert.js#L84

It would now sometimes throw and sometimes return an error.

Prior to this PR, I think we have a fairly well established convention, which this breaks.

I'm not necessarily opposed to changing the convention, but if we do, we should fully change it (caveat though: there are heaps of validation utilities etc that would need updating).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread lib/internal/modules/esm/assert.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Oct 31, 2022

Copy link
Copy Markdown
Member Author

I think this PR doesn't update all the functions/utilities needed to achieve its goal around "throwIf" might throw.

That's correct. I only went as far as I needed to go to get JSDoc linting to stop complaining.

I'm not necessarily opposed to changing the convention, but if we do, we should fully change it (caveat though: there are heaps of validation utilities etc that would need updating).

OK, I'll try to make that happen with a subsequent commit to this branch. (Or if someone wants to do it before I get to it, please push the changes here!)

JakobJingleheimer reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Nov 1, 2022
CI Reliability 2022-11-01 nodejs/reliability#417
Open
17 tasks
lpinca
lpinca approved these changes Nov 1, 2022
View reviewed changes
@github-actions github-actions Bot mentioned this pull request Nov 2, 2022
CI Reliability 2022-11-02 nodejs/reliability#418
Open
15 tasks
@Trott
Trott force-pushed the jsdoc-fixes branch 3 times, most recently from 1ec421e to a42be1a Compare November 2, 2022 21:18
Trott and others added 2 commits November 2, 2022 14:55
@Trott
lib: fix JSDoc issues
057430f
Updating ESLint and dependencies will start flagging a few additional
JSDoc issues. One or two of these are simple fixes. The ESM stuff
requires throwing explicitly in JSDoc'ed functions rather than calling
another function to throw. I think this makes the code easier to
understand--you don't need to know that a particular function that
starts with `throwsIf` *might* throw but something that starts with
`throwsAnythingElse` will always throw. Instead, it's right there in the
code. This also might make it easier to improve stack traces if that's
something we'd like to do at some point.
@nodejs-github-bot @Trott
tools: update eslint to 8.26.0
d109e09
@Trott
Trott force-pushed the jsdoc-fixes branch from a42be1a to d109e09 Compare November 2, 2022 21:56
@Trott

Trott commented Nov 2, 2022

Copy link
Copy Markdown
Member Author

It would now sometimes throw and sometimes return an error.

validateAssertions() always throws still. The return is there to signal to the linter and to someone reading the code that you can't get any further in the function. Unfortunately, it also signals that a value is being returned, which...it isn't. Short of going through every single validation function and their call-sites and changing them to return errors rather than throw themselves, I'm not sure how to "fix" that or if it needs "fixing". Maybe disabling the lint rule for that function is the better option after all. (I personally prefer adding the return but I think this is very subjective.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Nov 7, 2022

Copy link
Copy Markdown
Collaborator

Landed in 73a5112...b13738a

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot closed this Nov 7, 2022
nodejs-github-bot pushed a commit that referenced this pull request Nov 7, 2022
@Trott @nodejs-github-bot
lib: fix JSDoc issues
c370ec1
Updating ESLint and dependencies will start flagging a few additional
JSDoc issues. One or two of these are simple fixes. The ESM stuff
requires throwing explicitly in JSDoc'ed functions rather than calling
another function to throw. I think this makes the code easier to
understand--you don't need to know that a particular function that
starts with `throwsIf` *might* throw but something that starts with
`throwsAnythingElse` will always throw. Instead, it's right there in the
code. This also might make it easier to improve stack traces if that's
something we'd like to do at some point.

PR-URL: #45243
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
nodejs-github-bot added a commit that referenced this pull request Nov 7, 2022
@nodejs-github-bot
tools: update eslint to 8.26.0
b13738a
PR-URL: #45243
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
@Trott
Trott deleted the jsdoc-fixes branch November 7, 2022 15:22
This was referenced Nov 8, 2022
CI Reliability 2022-11-08 nodejs/reliability#422
Open
CI Reliability 2022-11-09 nodejs/reliability#423
Open
@github-actions github-actions Bot mentioned this pull request Nov 10, 2022
CI Reliability 2022-11-10 nodejs/reliability#424
Open
20 tasks
RafaelGSS pushed a commit that referenced this pull request Nov 10, 2022
@Trott @RafaelGSS
lib: fix JSDoc issues
a8e9015
Updating ESLint and dependencies will start flagging a few additional
JSDoc issues. One or two of these are simple fixes. The ESM stuff
requires throwing explicitly in JSDoc'ed functions rather than calling
another function to throw. I think this makes the code easier to
understand--you don't need to know that a particular function that
starts with `throwsIf` *might* throw but something that starts with
`throwsAnythingElse` will always throw. Instead, it's right there in the
code. This also might make it easier to improve stack traces if that's
something we'd like to do at some point.

PR-URL: #45243
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Nov 10, 2022
@nodejs-github-bot @RafaelGSS
tools: update eslint to 8.26.0
4b71db1
PR-URL: #45243
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Nov 10, 2022
v19.1.0 proposal #45269
Merged
RafaelGSS added a commit to RafaelGSS/node that referenced this pull request Nov 10, 2022
@RafaelGSS
lib: fix eslint early return
8e21b8f
The nodejs#45243 upgraded eslint
and apparently, when you specific a `@returns` early returns
aren't considered valid. This PR fixes this lint issue.
@RafaelGSS RafaelGSS mentioned this pull request Nov 10, 2022
[v19.x] lib: fix eslint early return #45409
Closed
@github-actions github-actions Bot mentioned this pull request Nov 11, 2022
CI Reliability 2022-11-11 nodejs/reliability#425
Open
19 tasks
RafaelGSS added a commit that referenced this pull request Nov 11, 2022
@RafaelGSS
lib: fix eslint early return
e2181e0
The #45243 upgraded eslint
and apparently, when you specific a `@returns` early returns
aren't considered valid. This PR fixes this lint issue.

PR-URL: #45409
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruy Adorno <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
@danielleadams danielleadams mentioned this pull request Dec 30, 2022
v18.13.0 release proposal #46025
Merged
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
@Trott @danielleadams
lib: fix JSDoc issues
9513b4b
Updating ESLint and dependencies will start flagging a few additional
JSDoc issues. One or two of these are simple fixes. The ESM stuff
requires throwing explicitly in JSDoc'ed functions rather than calling
another function to throw. I think this makes the code easier to
understand--you don't need to know that a particular function that
starts with `throwsIf` *might* throw but something that starts with
`throwsAnythingElse` will always throw. Instead, it's right there in the
code. This also might make it easier to improve stack traces if that's
something we'd like to do at some point.

PR-URL: #45243
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
@nodejs-github-bot @danielleadams
tools: update eslint to 8.26.0
745f1bf
PR-URL: #45243
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
@RafaelGSS @danielleadams
lib: fix eslint early return
93eb5bd
The #45243 upgraded eslint
and apparently, when you specific a `@returns` early returns
aren't considered valid. This PR fixes this lint issue.

PR-URL: #45409
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruy Adorno <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
danielleadams pushed a commit that referenced this pull request Jan 3, 2023
@Trott @danielleadams
lib: fix JSDoc issues
4ef86b5
Updating ESLint and dependencies will start flagging a few additional
JSDoc issues. One or two of these are simple fixes. The ESM stuff
requires throwing explicitly in JSDoc'ed functions rather than calling
another function to throw. I think this makes the code easier to
understand--you don't need to know that a particular function that
starts with `throwsIf` *might* throw but something that starts with
`throwsAnythingElse` will always throw. Instead, it's right there in the
code. This also might make it easier to improve stack traces if that's
something we'd like to do at some point.

PR-URL: #45243
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
danielleadams pushed a commit that referenced this pull request Jan 3, 2023
@nodejs-github-bot @danielleadams
tools: update eslint to 8.26.0
398ca24
PR-URL: #45243
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Jan Krems <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Zeyu "Alex" Yang <[email protected]>
danielleadams pushed a commit that referenced this pull request Jan 3, 2023
@RafaelGSS @danielleadams
lib: fix eslint early return
b9d4ac2
The #45243 upgraded eslint
and apparently, when you specific a `@returns` early returns
aren't considered valid. This PR fixes this lint issue.

PR-URL: #45409
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ruy Adorno <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JakobJingleheimer JakobJingleheimer JakobJingleheimer left review comments
@hybrist hybrist hybrist approved these changes
@lpinca lpinca lpinca approved these changes
@anonrig anonrig anonrig approved these changes
@tniessen tniessen tniessen approved these changes
@MoLow MoLow MoLow approved these changes
@himself65 himself65 himself65 approved these changes
@aduh95 aduh95 aduh95 approved these changes
@juanarbol juanarbol juanarbol approved these changes
@RaisinTen RaisinTen RaisinTen approved these changes
+1 more reviewer
@targos targos targos approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-rebase PRs the Commit Queue should land as multiple self-contained commits. lib / src Issues and PRs involving general changes in the lib/ or src/ directories. needs-ci PRs that need a full CI run.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

13 participants

@Trott @nodejs-github-bot @hybrist @lpinca @anonrig @targos @JakobJingleheimer @tniessen @MoLow @himself65 @aduh95 @juanarbol @RaisinTen
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.