Skip to content

chore: lint JSDoc with eslint-plugin-jsdoc#124

Merged
sergioramos merged 4 commits into
mainfrom
jsdoc-eslint
Jun 9, 2023
Merged

chore: lint JSDoc with eslint-plugin-jsdoc#124
sergioramos merged 4 commits into
mainfrom
jsdoc-eslint

Conversation

@danvk

@danvk danvk commented Jun 8, 2023

Copy link
Copy Markdown
Collaborator

This is helpful for enforcing some norms around JSDoc comments. See https://github.com/refstudio/refstudio/pull/105/files#discussion_r1223202950

In particular:

/**
 * short comment
 */

gets auto-fixed to the one-line form:

/** short comment */

Comment thread .eslintrc.cjs
@@ -1,3 +1,4 @@
/* eslint-disable no-undef */

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I got a warning about this file not being included in tsconfig.json, so I fixed that. That resulted in prettier and eslint running over this, which standardized the quotes and formatting.

Comment thread .eslintrc.cjs
/**
* INTERNAL ATOMS
*/
/** INTERNAL ATOMS */

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

These got shortened to the one-line form. But really they shouldn't be JSDoc comments at all (they could just be inline comments, or /* ... */ comments -- not jsdoc).


/**
* Returns a callback that will only call the passed function when it has not been called for the specified time
*

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is jsdoc/tag-lines. I'd like to enforce something like PEP 257: a summary line followed by a blank line, followed by a longer description. eslint-plugin-jsdoc used to have a rule that did that but they recently deleted it gajus/eslint-plugin-jsdoc#1031 (comment)

@danvk danvk requested review from cguedes and sergioramos June 8, 2023 18:59
@danvk danvk marked this pull request as ready for review June 8, 2023 18:59
sehyod
sehyod previously approved these changes Jun 9, 2023
cguedes
cguedes previously approved these changes Jun 9, 2023
@cguedes cguedes dismissed stale reviews from sehyod and themself via 3420d66 June 9, 2023 11:19
@sergioramos sergioramos changed the title Set up eslint-plugin-jsdoc chore: lint JSDoc with eslint-plugin-jsdoc Jun 9, 2023
@sergioramos sergioramos merged commit 508564e into main Jun 9, 2023
@sergioramos sergioramos deleted the jsdoc-eslint branch June 9, 2023 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants