commit 0a9a458465bab11be728333f99b5aa9b56793c0d
parent e2034ede22a2f71c6ad45e1321822dd6c22c2ee7
Author: Mark Banner <standard8@mozilla.com>
Date: Thu, 16 Oct 2025 10:55:58 +0000
Bug 1994217 - Fix various JSDoc issues that prevent ESLint running correctly. r=frontend-codestyle-reviewers,credential-management-reviewers,devtools-reviewers,sessionstore-reviewers,omc-reviewers,toolkit-telemetry-reviewers,nsharpley,jdescottes,Gijs,mtigley,nchevobbe,emcminn,janerik
These seem to cause an issues with automatically fixing JSDoc where it hits a circular cycle of fixes.
Differential Revision: https://phabricator.services.mozilla.com/D268568
Diffstat:
8 files changed, 38 insertions(+), 34 deletions(-)
diff --git a/browser/actors/AboutProtectionsParent.sys.mjs b/browser/actors/AboutProtectionsParent.sys.mjs
@@ -161,10 +161,7 @@ export class AboutProtectionsParent extends JSWindowActorParent {
/**
* Retrieves login data for the user.
*
- * @return {{
- * numLogins: Number,
- * potentiallyBreachedLogins: Number,
- * mobileDeviceConnected: Boolean }}
+ * @return {{numLogins: number, potentiallyBreachedLogins: number, mobileDeviceConnected: boolean }}
*/
async getLoginData() {
if (gTestOverride && "getLoginData" in gTestOverride) {
@@ -212,14 +209,18 @@ export class AboutProtectionsParent extends JSWindowActorParent {
}
/**
+ * @typedef {object} ProtectionsMonitorData
+ * @property {number} monitoredEmails
+ * @property {number} numBreaches
+ * @property {number} passwords
+ * @property {?string} userEmail
+ * @property {boolean} error
+ */
+
+ /**
* Retrieves monitor data for the user.
*
- * @return {{ monitoredEmails: Number,
- * numBreaches: Number,
- * passwords: Number,
- * userEmail: String|null,
- * error: Boolean }}
- * Monitor data.
+ * @return {ProtectionsMonitorData}
*/
async getMonitorData() {
if (gTestOverride && "getMonitorData" in gTestOverride) {
diff --git a/browser/components/asrouter/modules/ASRouterTargeting.sys.mjs b/browser/components/asrouter/modules/ASRouterTargeting.sys.mjs
@@ -524,11 +524,7 @@ export function getSortedMessages(messages, options = {}) {
* its type (web extenstion or custom url) and the parsed url(s)
*
* @param {string} url - A URL string for home page or newtab page
- * @returns {Object} {
- * isWebExt: boolean,
- * isCustomUrl: boolean,
- * urls: Array<{url: string, host: string}>
- * }
+ * @returns {{isWebExt: boolean, isCustomUrl: boolean, urls: {url: string, host: string}[]}}
*/
function parseAboutPageURL(url) {
let ret = {
@@ -1114,7 +1110,8 @@ const TargetingGetters = {
.getCharPref("distribution.id", "");
},
- /** Where the Firefox View button is shown, if at all.
+ /**
+ * Where the Firefox View button is shown, if at all.
* @return {string} container of the button if it is shown in the toolbar/overflow menu
* @return {string} `null` if the button has been removed
*/
diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs
@@ -5691,7 +5691,8 @@ var SessionStoreInternal = {
return Promise.all(windowOpenedPromises);
},
- /** reset closedId's from previous sessions to ensure these IDs are unique
+ /**
+ * Reset closedId's from previous sessions to ensure these IDs are unique
* @param tabData
* an array of data to be restored
* @param {String} windowId
diff --git a/devtools/client/inspector/rules/test/browser_rules_edit-size-property-dragging.js b/devtools/client/inspector/rules/test/browser_rules_edit-size-property-dragging.js
@@ -297,12 +297,8 @@ async function testDraggingClassIsAddedOnValueUpdate(view) {
/**
* Runs each test and check whether or not the property is draggable
*
- * @param {CSSRuleView} view
- * @param {Array.<{
- * name: String,
- * value: String,
- * shouldBeDraggable: Boolean,
- * }>} tests
+ * @param {CSSRuleView} view
+ * @param {{name: string, value: string, shouldBeDraggable: boolean}[]} tests
*/
function runIsDraggableTest(view, tests) {
for (const test of tests) {
diff --git a/services/fxaccounts/FxAccounts.sys.mjs b/services/fxaccounts/FxAccounts.sys.mjs
@@ -1150,9 +1150,12 @@ FxAccountsInternal.prototype = {
return this.startPollEmailStatus(state, data.sessionToken, "push");
},
- /** Destroyes an OAuth Token by sending a request to the FxA server
- * @param { Object } tokenData: The token's data, with `tokenData.token` being the token itself
- **/
+ /**
+ * Destroyes an OAuth Token by sending a request to the FxA server
+ *
+ * @param {object} tokenData
+ * The token's data, with `tokenData.token` being the token itself
+ */
destroyOAuthToken(tokenData) {
return this.fxAccountsClient.oauthDestroy(OAUTH_CLIENT_ID, tokenData.token);
},
diff --git a/services/fxaccounts/FxAccountsOAuth.sys.mjs b/services/fxaccounts/FxAccountsOAuth.sys.mjs
@@ -172,7 +172,8 @@ export class FxAccountsOAuth {
return queryParams;
}
- /** Completes an OAuth flow and invalidates any other ongoing flows
+ /**
+ * Completes an OAuth flow and invalidates any other ongoing flows
* @param { string } sessionTokenHex: The session token encoded in hexadecimal
* @param { string } code: OAuth authorization code provided by running an OAuth flow
* @param { string } state: The state first provided by `beginOAuthFlow`, then roundtripped through the server
@@ -182,7 +183,7 @@ export class FxAccountsOAuth {
* - 'scopedKeys': The encryption keys provided by the server, already decrypted
* - 'refreshToken': The refresh token provided by the server
* - 'accessToken': The access token provided by the server
- * */
+ */
async completeOAuthFlow(sessionTokenHex, code, state) {
const flow = this.getFlow(state);
if (!flow) {
diff --git a/toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js b/toolkit/components/passwordmgr/test/mochitest/pwmgr_common.js
@@ -834,8 +834,9 @@ function runInParent(aFunctionOrURL) {
return chromeScript;
}
-/** Manage logins in parent chrome process.
- * */
+/**
+ * Manage logins in parent chrome process.
+ */
function manageLoginsInParent() {
return runInParent(function addLoginsInParentInner() {
/* eslint-env mozilla/chrome-script */
@@ -885,7 +886,8 @@ function manageLoginsInParent() {
});
}
-/** Initialize with a list of logins. The logins are added within the parent chrome process.
+/**
+ * Initialize with a list of logins. The logins are added within the parent chrome process.
* @param {array} aLogins - a list of logins to add. Each login is an array of the arguments
* that would be passed to nsLoginInfo.init().
*/
@@ -895,7 +897,8 @@ async function addLoginsInParent(...aLogins) {
return script;
}
-/** Initialize with a list of logins, after removing all user facing logins.
+/**
+ * Initialize with a list of logins, after removing all user facing logins.
* The logins are added within the parent chrome process.
* @param {array} aLogins - a list of logins to add. Each login is an array of the arguments
* that would be passed to nsLoginInfo.init().
@@ -942,7 +945,8 @@ async function setStoredLoginsDuringTask(...logins) {
});
}
-/** Returns a promise which resolves to a list of logins
+/**
+ * Returns a promise which resolves to a list of logins
*/
function getLogins() {
const script = manageLoginsInParent();
diff --git a/toolkit/components/telemetry/pings/TelemetrySession.sys.mjs b/toolkit/components/telemetry/pings/TelemetrySession.sys.mjs
@@ -1291,7 +1291,8 @@ var Impl = {
return promise;
},
- /** Loads session data from the session data file.
+ /**
+ * Loads session data from the session data file.
* @return {Promise<object>} A promise which is resolved with an object when
* loading has completed, with null otherwise.
*/