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.
Details
Diff Detail
- Repository
- rMOZILLACENTRAL mozilla-central
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
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 | 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®exp=false. | |
browser/components/migration/MigrationUtils.sys.mjs | ||
534–543 | We could also add a private tag. | |
542 | 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. |
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. |
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 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.