Skip to content
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

tools: add JSDoc ESLint plugin #38279

Closed
wants to merge 2 commits into from
Closed

Conversation

targos
Copy link
Member

@targos targos commented Apr 18, 2021

  • tools: install eslint-plugin-jsdoc
  • tools: enable JSDoc ESLint plugin

Start with a single rule (check-tag-names) and configure it to limit
the number of required fixes.
@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Apr 18, 2021
@targos
Copy link
Member Author

targos commented Apr 18, 2021

/cc @bmeck

@nodejs-github-bot
Copy link
Collaborator

@targos
Copy link
Member Author

targos commented Apr 18, 2021

@nodejs/testing

@benjamingr
Copy link
Member

I wonder how far we are from actually running (fairly permissive) tsc to check these instead :D

@targos
Copy link
Member Author

targos commented Apr 18, 2021

I wonder how far we are from actually running (fairly permissive) tsc to check these instead :D

We are very far from that I think :D
But anyway, TSC won't validate the format of the JSDoc comments like an ESLint plugin can do.

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

Rubber-stamp LTGM although that's a lot of files....

@targos
Copy link
Member Author

targos commented Apr 18, 2021

Rubber-stamp LTGM although that's a lot of files....

Almost all the files come from the lodash package. I don't know if we can do something about that.

@benjamingr
Copy link
Member

@ljharb opinions ^ ?

@ljharb
Copy link
Member

ljharb commented Apr 18, 2021

I mean, my personal opinion is that vendoring dev deps in general is a waste, and i don’t like jsdoc at all :-) so I’m not sure how helpful I’ll be here.

if that eslint plugin could be made to drop lodash tho, that’d address this concern (and also avoid a ton of others, like overly broad CVEs alerting unnecessarily for node). most of lodash is effectively built into the language now.

@aduh95
Copy link
Contributor

aduh95 commented Apr 18, 2021

I wonder if we could delete unused files… Looking at the code source, it's only using a dozen of lodash functions:

  • _.has
  • _.filter
  • _.flatten
  • _.flatMap
  • _.mapKeys
  • _.some
  • _.kebabCase
  • _.zipObject
  • _.escapeRegExp
  • _.trimStart
  • _.compact

@ljharb
Copy link
Member

ljharb commented Apr 18, 2021

The trick is that it’s quite difficult to programmatically determine and remove unused files, and you wouldn’t want to have to do the manual work multiple times.

@jasnell
Copy link
Member

jasnell commented Apr 18, 2021

I'd be -1 on this for now. I'd like to see the vendored dep made smaller or made explicitly opt in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants