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

Set up ESLint for JSDoc comments #1605

Merged
merged 2 commits into from Feb 19, 2024
Merged

Conversation

koddsson
Copy link
Member

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 code

This 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.

@koddsson koddsson requested a review from a team as a code owner February 19, 2024 20:04
@koddsson koddsson enabled auto-merge (squash) February 19, 2024 20:04
import jsdoc from "eslint-plugin-jsdoc";

export default [
jsdoc.configs["flat/recommended"],
Copy link
Contributor

@43081j 43081j Feb 19, 2024

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);

/**
*
Copy link
Contributor

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"

Copy link
Contributor

@43081j 43081j left a 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

@koddsson koddsson merged commit 8475d2a into chaijs:main Feb 19, 2024
5 checks passed
@koddsson
Copy link
Member Author

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

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.

None yet

2 participants