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
Set up ESLint for JSDoc comments #1605
Conversation
import jsdoc from "eslint-plugin-jsdoc"; | ||
|
||
export default [ | ||
jsdoc.configs["flat/recommended"], |
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.
while you're in there, can you maybe also enable eslint's recommended rule set? im surprised we didn't already have eslint
if it ends up with too big of a change, you could do a PR to add eslint + recommended, then a separate one for jsdoc on top or vice versa
@@ -2116,6 +2110,13 @@ function assertOwnPropertyDescriptor (name, descriptor, msg) { | |||
Assertion.addMethod('ownPropertyDescriptor', assertOwnPropertyDescriptor); | |||
Assertion.addMethod('haveOwnPropertyDescriptor', assertOwnPropertyDescriptor); | |||
|
|||
/** | |||
* |
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.
maybe add a description? "Flags that the length
property should be asserted in this chain"
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 good, though it may be worth marking optional params as such or just wait for my typescript conversion to land
e.g. @param {string=} iAmAnOptionalParam
lol, maybe I shouldn't have had it on auto-merge :D I'll make a follow up PR to apply some of your suggestions @43081j |
I really want to explore both better typing and possible automatic generation of API docs since the JSDoc comments that exist in the codebase are of such high quality.
This PR introduces ESLint and
eslint-plugin-jsdoc
to start linting JSDoc comment in effort to make sure that all of the comments stay high quality as we refactor the codeThis PR can be followed up by more changes to the rules we apply as well as some explorations into API documentation and stricter type-checking.