cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Enable eslint-jsdoc

Open ggetz opened this issue 1 year ago • 2 comments

Description

This PR enables eslint-plugin-jsdoc. I figured we'd go ahead and enable the defaults, and we'll turn off rules for now that will require a lot of manual fixes. We can systematically enable rules and fix them one-by-one where time allows or need arises. For example, type checking may be particularly helpful.

  • Uses the recommended ruleset. In the future, we may want to turn on TS mode, but for now we'll default to the recommend for JS-only.
  • Disable rules that are against our coding consistencies, at least for the time being and added comments why
  • Disabled quite a few rules which require manual fixes, like filling in types and descriptions, until we can manually fix.
  • Autofix with npm run eslint -- --fix

Issue number and link

Fixes https://github.com/CesiumGS/cesium/issues/10815

Testing plan

  1. Run eslint and ensure there are no failures
  2. Run build-docs and ensure the built documentation is not broken
  3. Run build-ts and ensure there are no errors (there will still be warnings)

Author checklist

  • [x] I have submitted a Contributor License Agreement
  • [x] I have added my name to CONTRIBUTORS.md
  • [ ] ~I have updated CHANGES.md with a short summary of my change~
  • [ ] ~I have added or updated unit tests to ensure consistent code coverage~
  • [x] I have update the inline documentation, and included code examples where relevant
  • [x] I have performed a self-review of my code

ggetz avatar Jun 04 '24 19:06 ggetz

Thank you for the pull request, @ggetz!

:white_check_mark: We can confirm we have a CLA on file for you.

github-actions[bot] avatar Jun 04 '24 19:06 github-actions[bot]

If I could summarize the changes I'm seeing

  1. rename properties that are synonyms to the "true" one, this is good imo :+1:
    • constructor to class
    • return to returns
    • exception to throws
  2. remove empty lines as outlined in my comment above :neutral_face:
    • I agree with some of these that were excessive (double lines, ones between some tags)
    • I disagree with many of them that created valuable visual separation between chunks of tags and between the description and all tags. again, mentioned above
  3. adding @params for those that didn't exist before, again see above :shrug:

I've reviewed about 100 of the 800+ files and these seem to be the only changes. I'm going to stop here for now in case we change how the rules above are handled so I don't waste time reviewing files that may not actually have any changes.

Overall I'm definitely a fan of including this to automate more of this consistency and look forward to reviewing and turning on more rules in the future

jjspace avatar Jun 07 '24 17:06 jjspace

This needs a merge. I'm closing until I get the chance.

ggetz avatar May 13 '25 16:05 ggetz