Skip to content

meta: enable eslint jsdoc rules #58521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented May 31, 2025

I propose enabling jsdoc eslint rules. This would help a lot for maintainance, and help create a more consistent code base. Currently, we have jsdoc in some areas but not in all places. Additionally, this would help folks maintaining @types/node package a lot.

@nodejs-github-bot nodejs-github-bot added the tools Issues and PRs related to the tools directory. label May 31, 2025
@anonrig anonrig force-pushed the yagiz/enable-eslint-jsdoc branch from 273c1fb to 1706d82 Compare May 31, 2025 00:31
@anonrig anonrig force-pushed the yagiz/enable-eslint-jsdoc branch 4 times, most recently from 7c5384a to cb6ed80 Compare May 31, 2025 15:36
@anonrig anonrig force-pushed the yagiz/enable-eslint-jsdoc branch from cb6ed80 to 4165c4f Compare May 31, 2025 15:47
@anonrig anonrig added the commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. label May 31, 2025
Copy link

codecov bot commented May 31, 2025

Codecov Report

Attention: Patch coverage is 99.72145% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.08%. Comparing base (9524908) to head (9dbe731).
Report is 168 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/http2/util.js 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #58521      +/-   ##
==========================================
- Coverage   90.25%   90.08%   -0.17%     
==========================================
  Files         635      640       +5     
  Lines      187635   188576     +941     
  Branches    36861    36944      +83     
==========================================
+ Hits       169347   169885     +538     
- Misses      11055    11419     +364     
- Partials     7233     7272      +39     
Files with missing lines Coverage Δ
lib/_http_common.js 100.00% <100.00%> (ø)
lib/buffer.js 100.00% <100.00%> (ø)
lib/events.js 99.58% <100.00%> (-0.17%) ⬇️
lib/https.js 99.30% <100.00%> (ø)
lib/internal/abort_controller.js 98.27% <100.00%> (+<0.01%) ⬆️
lib/internal/async_hooks.js 99.36% <100.00%> (ø)
lib/internal/blob.js 99.80% <100.00%> (ø)
lib/internal/crypto/random.js 96.09% <100.00%> (ø)
lib/internal/data_url.js 100.00% <100.00%> (+8.23%) ⬆️
lib/internal/dns/promises.js 98.29% <100.00%> (-0.01%) ⬇️
... and 46 more

... and 128 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@anonrig anonrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels May 31, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label May 31, 2025

This comment was marked as outdated.

@github-actions github-actions bot added the request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. label May 31, 2025
@LiviaMedeiros LiviaMedeiros added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. labels Jun 1, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 1, 2025
@nodejs-github-bot

This comment was marked as outdated.

@anonrig anonrig requested a review from LiviaMedeiros June 1, 2025 16:05
@anonrig
Copy link
Member Author

anonrig commented Jun 1, 2025

cc @LiviaMedeiros @jasnell can you re-review?

@nodejs-github-bot
Copy link
Collaborator

Comment on lines +376 to 379
/**
* @class
*/
class CustomEvent extends Event {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed? What's the point of it?

Suggested change
/**
* @class
*/
class CustomEvent extends Event {
class CustomEvent extends Event {

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure. One of the rules probably asked me to add it.

Copy link
Contributor

@aduh95 aduh95 Jun 2, 2025

Choose a reason for hiding this comment

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

Well let's remove it 😅 I've checked, the linter doesn't complain without it

@@ -1,5 +1,5 @@
/**
* @fileoverview Check that common.skipIfEslintMissing is used if
* @file Check that common.skipIfEslintMissing is used if
* the eslint module is required.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* the eslint module is required.
* the eslint module is required.

Copy link
Member Author

Choose a reason for hiding this comment

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

I 100% agree but it's against our CONTRIBUTING.md, since it's allowed in our formatter and linter right now. This should be handled through a formatter. There is a particular sentence in the document about: "Anything that can be automated should be automated"

Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't jsdoc/check-line-alignment enforce that?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the first time I hear about it. Perfect. Thanks! I'll enable it now. Hopefully it will fix it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I enabled it but it didn't fix this.

anonrig and others added 2 commits June 25, 2025 21:48
Co-authored-by: Antoine du Hamel <[email protected]>
Co-authored-by: Antoine du Hamel <[email protected]>
@anonrig anonrig added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-rebase Add this label to allow the Commit Queue to land a PR in several commits. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants