-
Notifications
You must be signed in to change notification settings - Fork 334
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
Configure ESLint to require JSDoc @params
etc
#3103
Conversation
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.
Makes all sense to me 🙌🏻 but I'm quite partial to the JSDoc work already. Might be worth getting a quick check with the team before we enforce adding JSDoc 😄
f7f7f78
to
c891491
Compare
6c2eec4
to
f73c42d
Compare
src/.eslintrc.js
Outdated
} | ||
} | ||
], | ||
'jsdoc/require-param-description': 'warn', |
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.
Looks like the 'warn' value snuck back in or maybe you yere you looking to enable require-param-type
instead, as that's what we need for typing?
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.
@romaricpascal Oh I probably misunderstood, it's been moved from .eslintrc.js
to src/.eslintrc.js
As in, JSDoc params (and descriptions) are only needed for our user-facing source code for documentation
Think we should have it optional everywhere?
Thanks
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've gone ahead and removed the warnings for @param
+ descriptions
It's something we can monitor during code reviews. Don't want to hassle ongoing spikes with linting issues
(Also set enableFixer: false
so ESLint --fix
won't keep adding placeholder @param
either)
f73c42d
to
9631ec8
Compare
9631ec8
to
4e5c275
Compare
Some of our tests files had missed the initial `--fix` to swap all “var” to let or const
Whilst optional elsewhere, for our source directory we’ve flipped the “JSDoc blocks are optional” rules at root Parameters (+ descriptions) are still optional
4e5c275
to
82d9264
Compare
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.
Given that the code already meets these settings, I think it makes sense to formalise the jsdoc requirements.
Thanks @domoscargin 👍 @romaricpascal I know you were keen on adding warnings when we've missed type declarations (plus stricter checks for missing (Need to weigh up the benefits of valid types for publishing versus quick spikes where things change quickly) So I'll go ahead and merge this one as-is and we can tighten further if wanted in future |
This PR follows up #2913 (optional JSDoc) by making
@param
tags mandatory for methods that use JSDocIt also configures ESLint excluded files correctly using
excludedFiles
Which continues work we started for v4.4.0:
To assist with code reviews I've split these changes into:
@params
etc #3103Resolves #2513