commit 86e3736350a9c984f29acbe70e7d6bede87ddf38 parent d8abd37c3849693cbac603a2256bf3cd2bcc5ff6 Author: Mark Banner <standard8@mozilla.com> Date: Fri, 21 Nov 2025 16:13:48 +0000 Bug 1999554 - Manually fix remaining ESLint rule jsdoc/check-types issues and enable everywhere. r=frontend-codestyle-reviewers,devtools-reviewers,sessionstore-reviewers,omc-reviewers,toolkit-telemetry-reviewers,hjones,home-newtab-reviewers,nchevobbe,emcminn,nsharpley,mossop,thecount These all fix instances of "Use object shorthand or index signatures instead of 'Object'". Differential Revision: https://phabricator.services.mozilla.com/D272175 Diffstat:
12 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/browser/components/asrouter/modules/FeatureCallout.sys.mjs b/browser/components/asrouter/modules/FeatureCallout.sys.mjs @@ -2279,7 +2279,7 @@ export class FeatureCallout { "dismiss-button-background-active", ]; - /** @type {Object<string, FeatureCalloutTheme>} */ + /** @type {{[key: string]: FeatureCalloutTheme}} */ static themePresets = { // For themed system pages like New Tab and Firefox View. Themed content // colors inherit from the user's theme through contentTheme.js. diff --git a/browser/components/preferences/privacy.js b/browser/components/preferences/privacy.js @@ -791,7 +791,7 @@ class WarningSettingConfig { /** * * @param {string} id - The unique setting ID for the setting created by this config - * @param {Object.<string,string>} prefMapping - A map from member name (to be used in the + * @param {{[key: string]: string}} prefMapping - A map from member name (to be used in the * `problematic` arg's arg) to pref string, containing all of the preferences this Setting * relies upon. On setup, this object will create properties for each entry here, where the * value is the result of Preferences.get(key). diff --git a/browser/components/sessionstore/SessionStore.sys.mjs b/browser/components/sessionstore/SessionStore.sys.mjs @@ -1088,7 +1088,7 @@ var SessionStoreInternal = { /** * states for all currently opened windows * - * @type {object.<WindowID, WindowStateData>} + * @type {{[key: WindowID]: WindowStateData}} */ _windows: {}, diff --git a/browser/extensions/newtab/lib/InferredModel/FeatureModel.sys.mjs b/browser/extensions/newtab/lib/InferredModel/FeatureModel.sys.mjs @@ -20,9 +20,9 @@ const MAX_INT_32 = 2 ** 32; * Divides numerator fields by the denominator. Value is set to 0 if denominator is missing or 0. * Adds 0 value for all situations where there is a denominator but no numerator value. * - * @param {Object.<string, number>} numerator - * @param {Object.<string, number>} denominator - * returns {Object.<string, number>} + * @param {{[key: string]: number}} numerator + * @param {{[key: string]: number}} denominator + * @returns {{[key: string]: number}} */ export function divideDict(numerator, denominator) { const result = {}; @@ -323,7 +323,7 @@ export class FeatureModel { * * @param {object} config * @param {Array.<Array.<string|number>>} config.dataForIntervals Raw aggregate output from SQL query. Could be clicks or impressions - * @param {Object.<string, number>} config.indexSchema Map of keys to indices in each sub-array in dataForIntervals + * @param {{[key: string]: number}} config.indexSchema Map of keys to indices in each sub-array in dataForIntervals * @param {boolean} [config.applyThresholding=false] Whether to apply thresholds * @param {boolean} [config.applyDifferntialPrivacy=false] Whether to apply differential privacy. This will be used for sending to telemetry. * @returns @@ -472,8 +472,8 @@ export class FeatureModel { * In all cases model_id is returned. * * @param {object} params - Function parameters. - * @param {Object<string, number>} params.clickDict - A dictionary of interest keys to click counts. - * @param {Object<string, number>} params.impressionDict - A dictionary of interest keys to impression counts. + * @param {{[key: string]: number}} params.clickDict - A dictionary of interest keys to click counts. + * @param {{[key: string]: number}} params.impressionDict - A dictionary of interest keys to impression counts. * @param {string} [params.model_id="unknown"] - Identifier for the model used in generating the vectors. * @param {boolean} [params.condensePrivateValues=true] - If true, condenses coarse private interest values into an array format. * diff --git a/browser/extensions/newtab/lib/SmartShortcutsRanker/RankShortcutsWorkerClass.mjs b/browser/extensions/newtab/lib/SmartShortcutsRanker/RankShortcutsWorkerClass.mjs @@ -132,8 +132,8 @@ export function normUpdate(vals, input_normobj) { * Normalize a dictionary of {key: hist[]} using squared values and column-wise normalization. * Returns {key: normedHist[]} where each hist[j] is divided by sum_k hist_k[j]^2. * - * @param {Object<string, number[]>} dict - A dictionary mapping keys to arrays of P(t|s) values. - * @returns {Object<string, number[]>} New dictionary with normalized histograms (P(s|t)). + * @param {{[key: string]: number}} dict - A dictionary mapping keys to arrays of P(t|s) values. + * @returns {{[key: string]: number}} New dictionary with normalized histograms (P(s|t)). */ export function normHistDict(dict) { const keys = Object.keys(dict); diff --git a/devtools/shared/heapsnapshot/CensusUtils.js b/devtools/shared/heapsnapshot/CensusUtils.js @@ -385,9 +385,9 @@ exports.diff = diff; * Creates a hash map mapping node IDs to its parent node. * * @param {CensusTreeNode} node - * @param {Object<number, TreeNode>} aggregator + * @param {{[key: number]: TreeNode}} aggregator * - * @return {Object<number, TreeNode>} + * @return {{[key: number]: TreeNode}} */ const createParentMap = function (node, getId = n => n.id, aggregator = {}) { if (node.children) { diff --git a/eslint-rollouts.config.mjs b/eslint-rollouts.config.mjs @@ -309,7 +309,6 @@ export default [ "jsdoc/check-param-names": "off", "jsdoc/check-property-names": "off", "jsdoc/check-tag-names": "off", - "jsdoc/check-types": "off", "jsdoc/require-param-type": "off", "jsdoc/require-returns-type": "off", "jsdoc/valid-types": "off", diff --git a/services/fxaccounts/FxAccountsConfig.sys.mjs b/services/fxaccounts/FxAccountsConfig.sys.mjs @@ -134,7 +134,7 @@ export var FxAccountsConfig = { /** * @param path should be parsable by the URL constructor first parameter. * @param {bool} [options.includeDefaultParams] If true include the default search params. - * @param {Object.<string, string>} [options.extraParams] Additionnal search params. + * @param {{[key: string]: string}} [options.extraParams] Additionnal search params. * @param {bool} [options.addAccountIdentifiers] if true we add the current logged-in user uid and email to the search params. */ async _buildURL( diff --git a/toolkit/components/messaging-system/targeting/Targeting.sys.mjs b/toolkit/components/messaging-system/targeting/Targeting.sys.mjs @@ -101,7 +101,7 @@ export class TargetingContext { * Wrap each property of context[key] with a Proxy that captures errors and * timeouts * - * @param {Object.<string, TargetingGetters> | TargetingGetters} context + * @param {{[key: string]: TargetingGetters} | TargetingGetters} context * @param {string} key Namespace value found in `context` param * @returns {TargetingGetters} Wrapped context where getter report errors and timeouts */ @@ -146,8 +146,8 @@ export class TargetingContext { /** * Merge all evaluation contexts and wrap the getters with timeouts * - * @param {Object.<string, TargetingGetters>[]} contexts - * @returns {Object.<string, TargetingGetters>} Object that follows the pattern of `namespace: getters` + * @param {{[key: string]: TargetingGetters}[]} contexts + * @returns {{[key: string]: TargetingGetters}} Object that follows the pattern of `namespace: getters` */ mergeEvaluationContexts(contexts) { let context = {}; @@ -195,7 +195,7 @@ export class TargetingContext { * ); // true * * @param {string} expression JEXL expression - * @param {Object.<string, TargetingGetters>[]} ...contexts Additional custom context + * @param {{[key: string]: TargetingGetters}[]} ...contexts Additional custom context * objects where the keys act as namespaces for the different getters * * @returns {promise} Evaluation result diff --git a/toolkit/components/telemetry/app/TelemetrySend.sys.mjs b/toolkit/components/telemetry/app/TelemetrySend.sys.mjs @@ -1641,7 +1641,7 @@ export var TelemetrySendImpl = { /** * Return a promise that allows to wait on pending pings. * - * @return {Object<Promise>} A promise resolved when all the pending pings promises + * @return {Promise} A promise resolved when all the pending pings promises * are resolved. */ promisePendingPingActivity() { diff --git a/toolkit/components/telemetry/app/TelemetryStorage.sys.mjs b/toolkit/components/telemetry/app/TelemetryStorage.sys.mjs @@ -1558,7 +1558,7 @@ var TelemetryStorageImpl = { * Track any pending ping save tasks through the promise passed here. * This is needed to block on any outstanding ping save activity. * - * @param {Object<Promise>} The save promise to track. + * @param {Promise} The save promise to track. */ _trackPendingPingSaveTask(promise) { let clear = () => this._activePendingPingSaves.delete(promise); @@ -1569,7 +1569,7 @@ var TelemetryStorageImpl = { /** * Return a promise that allows to wait on pending pings being saved. * - * @return {Object<Promise>} A promise resolved when all the pending pings save promises + * @return {Promise} A promise resolved when all the pending pings save promises * are resolved. */ promisePendingPingSaves() { diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.sys.mjs b/toolkit/mozapps/extensions/internal/XPIProvider.sys.mjs @@ -2654,7 +2654,7 @@ export var XPIProvider = { * Unregisters the dictionaries in the given object, and re-registers * any built-in dictionaries in their place, when they exist. * - * @param {Object<nsIURI>} aDicts + * @param {{[key: string]: nsIURI}} aDicts * An object containing a property with a dictionary language * code and a nsIURI value for each dictionary to be * unregistered.