Page MenuHomePhabricator

Bug 1802358 - Enable require-jsdoc / valid-jsdoc for browser/components/migration. r?kpatenio!
ClosedPublic

Authored by mconley on Nov 25 2022, 6:15 PM.
Referenced Files
Unknown Object (File)
Thu, May 1, 7:15 PM
Unknown Object (File)
Tue, Apr 29, 10:45 PM
Unknown Object (File)
Mon, Apr 28, 9:52 PM
Unknown Object (File)
Thu, Apr 24, 8:53 AM
Unknown Object (File)
Jan 8 2025, 11:18 PM
Unknown Object (File)
Jan 8 2025, 11:17 AM
Unknown Object (File)
Jan 8 2025, 7:48 AM
Unknown Object (File)
Jan 6 2025, 8:25 PM
Subscribers

Details

Summary

This doesn't do a thorough job of actually documenting things, it just makes sure that
the existing documentation abides by the JSDoc formatting rules. I did flesh out some
documentation here and there, but writing new / updating / clarifying documentation is
left as later work.

Diff Detail

Repository
rMOZILLACENTRAL mozilla-central
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.

Thanks @mconley for the ping. I only knew of the basics when it came to JS documentation, but I learned more today about JSDocs formatting. Just left some nitpicks and a question + pointed out a potential typo.

browser/components/migration/EdgeProfileMigrator.sys.mjs
59

question because Im curious: Do you think using the callback tag for function parameters would be suitable?

browser/components/migration/IEProfileMigrator.sys.mjs
258

Is this meant to be object? I'm also having trouble understanding the difference between the lowercase and uppercase uses for jsdocs (in general). For example in the params doc page, we use uppercase Object rather than lowercase. But I'm seeing both existing in searchfox: https://searchfox.org/mozilla-central/search?q=%7Bobject&path=&case=false&regexp=false.

browser/components/migration/MigrationUtils.sys.mjs
534–543

nitpick: We could also add a private tag.

542

nitpick: This means an array of MigrationResources right? Just wanted to make sure since we seem to be using both [] and Array<...> to indicate arrays. We could make them consistent if we wanted to.

mconley added inline comments.
browser/components/migration/EdgeProfileMigrator.sys.mjs
59

Yep! But I'll file this as a follow-up. I mainly wanted to write this patch to get the minimum changes in the tree to enable these rules. We can start to improve the documentation afterwards (and ensure we're following the JSDoc requirements while we do it! :) )

Filed follow-up as: https://bugzilla.mozilla.org/show_bug.cgi?id=1802979

browser/components/migration/IEProfileMigrator.sys.mjs
258

Ooof, yep, that's supposed to be object. Good eye, thanks!

Looks like casing is governed by this ESLint rule: https://github.com/gajus/eslint-plugin-jsdoc/blob/master/.README/rules/check-types.md

browser/components/migration/MigrationUtils.sys.mjs
542

I think we use [] when we want to indicate a homogeneous collection - ie, an array that only contains MigrationResource's in this case.

For * @returns {Promise<Array<Array>>} for the promiseMigration helper, it's a little tricker, because that's an array of arrays. I'm not sure how to represent that with the [] syntax. Maybe this?

* @returns {Promise<Array<string[]>>}

I've filed bug 1802978 to update the existing documentation to use more consistent array types.

mconley edited the summary of this revision. (Show Details)
mconley marked 2 inline comments as done.

Thanks for filing those separate follow-up tickets Mike. I'll accept this patch so that we can get the rules enabled sooner.

This revision is now accepted and ready to land.Nov 28 2022, 9:19 PM

This revision requires a Testing Policy Project Tag to be set before landing. Please apply one of testing-approved, testing-exception-unchanged, testing-exception-ui, testing-exception-elsewhere, testing-exception-other. Tip: this Firefox add-on makes it easy!

Forgot to add a tag here.

Tag reason: this patch adds jsdoc rules and modifies some comments. It should not change behaviour for users.

Rebase, minor tweak to Storybook stories in bug 1801314 patch

Fix access to migrator key list via MigratorUtils needed by MigrationWizardParent

Remove ?* suffix after about:preferences for MigrationWizard actor registration

Rebase, accommodate new Opera GX migrator

Rebase and address mstriemer's review feedback

This revision is now accepted and ready to land.Dec 6 2022, 4:37 PM

Fix documentation build issues