commit dafc2e0f866c52f408bec298ac45cb53c7194779 parent 4c6c6735429ea9ed3acdb8acb217a7a4a13a7f3d Author: Mark Banner <standard8@mozilla.com> Date: Fri, 3 Oct 2025 14:09:08 +0000 Bug 1991124 - Fix ESLint require-jsdoc issues in urlbar and search code. r=urlbar-reviewers,search-reviewers,scunnane,dao Differential Revision: https://phabricator.services.mozilla.com/D266628 Diffstat:
10 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/browser/components/search/content/autocomplete-popup.js b/browser/components/search/content/autocomplete-popup.js @@ -279,6 +279,15 @@ /** * This is called when a one-off is clicked and when "search in new tab" * is selected from a one-off context menu. + * + * @param {Event} event + * The event that triggered the search. + * @param {nsISearchEngine} engine + * The search engine being used for the search. + * @param {string} where + * Where the search should be opened (current tab, new tab, window etc). + * @param {object} params + * The parameters associated with opening the search. */ handleOneOffSearch(event, engine, where, params) { this.searchbar.handleSearchCommandWhere(event, engine, where, params); diff --git a/browser/components/urlbar/SearchModeSwitcher.sys.mjs b/browser/components/urlbar/SearchModeSwitcher.sys.mjs @@ -400,6 +400,8 @@ export class SearchModeSwitcher { /** * Adds local options to the popup. + * + * @param {Element} separator */ async #buildLocalSearchModeList(separator) { if (!this.#input.isAddressbar) { diff --git a/browser/components/urlbar/UrlbarProviderAutofill.sys.mjs b/browser/components/urlbar/UrlbarProviderAutofill.sys.mjs @@ -296,7 +296,9 @@ const QUERY_URL_PREFIX_BOOKMARK = urlQuery( * @typedef AutofillData * * @property {UrlbarResult} result + * The result entry. * @property {Query} instance + * The query instance. */ /** diff --git a/browser/components/urlbar/UrlbarResult.sys.mjs b/browser/components/urlbar/UrlbarResult.sys.mjs @@ -39,6 +39,7 @@ export class UrlbarResult { /** * @typedef {object} Payload * @property {string} [qsSuggestion] + * The suggestion text from quick suggest. */ /** diff --git a/browser/components/urlbar/UrlbarSearchTermsPersistence.sys.mjs b/browser/components/urlbar/UrlbarSearchTermsPersistence.sys.mjs @@ -17,9 +17,13 @@ ChromeUtils.defineESModuleGetters(lazy, { /** * @typedef {object} PersistedTermsProviderInfo * @property {string} providerId + * The search engine provider id associated with the persisted terms. * @property {RegExp} [searchPageRegexp] + * The regular expression for determining if the search page URL matches. * @property {{key: string, values: string[], canBeMissing: boolean}[]} includeParams + * The parameters that should be included in determining if the search page URL matches. * @property {{key: string, values: string[]}[]} excludeParams + * The parameters that should be excluded in determining if the search page URL matches. */ ChromeUtils.defineLazyGetter(lazy, "logger", () => diff --git a/browser/components/urlbar/private/MLSuggest.sys.mjs b/browser/components/urlbar/private/MLSuggest.sys.mjs @@ -70,10 +70,12 @@ class _MLSuggest { /** * Helper to wrap createEngine for testing purposes. * + * @param {object} options + * Configuration options for the ML engine. * @returns {MLEngine} */ - createEngine(args) { - return lazy.createEngine(args); + createEngine(options) { + return lazy.createEngine(options); } /** diff --git a/browser/components/urlbar/private/YelpSuggestions.sys.mjs b/browser/components/urlbar/private/YelpSuggestions.sys.mjs @@ -236,7 +236,9 @@ export class YelpSuggestions extends SuggestProvider { /** * @typedef {object} L10nItem * @property {Values<RESULT_MENU_COMMAND>} [name] + * The name of the command. * @property {{id: string}} [l10n] + * The id of the l10n string to use for the translation. */ /** diff --git a/browser/components/urlbar/tests/engagementTelemetry/browser/head.js b/browser/components/urlbar/tests/engagementTelemetry/browser/head.js @@ -513,6 +513,9 @@ async function expectNoConsoleErrors(task) { * @param {number} [embeddingSize] size of embeddings */ async function doTestWithSemantic(results, task, embeddingSize = 16) { + /** + * A mock object that pretends to be an MLEngine. + */ class MockMLEngine { async run(request) { const texts = request.args[0]; diff --git a/eslint-rollouts.config.mjs b/eslint-rollouts.config.mjs @@ -475,18 +475,9 @@ export default [ "browser/components/genai/content/smart-assist.mjs", "browser/components/genai/tests/browser/browser_page_assist_actors.js", "browser/components/mozcachedohttp/MozCachedOHTTPProtocolHandler.sys.mjs", - "browser/components/search/content/autocomplete-popup.js", "browser/components/security/unexpectedScriptLoad.js", - "browser/components/urlbar/SearchModeSwitcher.sys.mjs", - "browser/components/urlbar/UrlbarProviderAutofill.sys.mjs", - "browser/components/urlbar/UrlbarResult.sys.mjs", - "browser/components/urlbar/UrlbarSearchTermsPersistence.sys.mjs", - "browser/components/urlbar/private/MLSuggest.sys.mjs", - "browser/components/urlbar/private/YelpSuggestions.sys.mjs", - "browser/components/urlbar/tests/engagementTelemetry/browser/head.js", "browser/components/webrtc/content/webrtc-preview/webrtc-preview.mjs", "toolkit/components/promiseworker/PromiseWorker.sys.mjs", - "toolkit/components/search/SearchSuggestionController.sys.mjs", "toolkit/modules/AppServicesTracing.sys.mjs", ], rules: mozilla.turnOff(mozilla.configs["flat/require-jsdoc"].rules), diff --git a/toolkit/components/search/SearchSuggestionController.sys.mjs b/toolkit/components/search/SearchSuggestionController.sys.mjs @@ -307,7 +307,9 @@ export class SearchSuggestionController { /** * @typedef {object} FetchResult * @property {string} term + * The search term used for obtaining the suggestions. * @property {FormHistoryResultType} [formHistoryResults] + * The results in a form history result object, used for `SearchSuggestions`. * @property {Array<SearchSuggestionEntry>} local * Contains local search suggestions. * @property {Array<SearchSuggestionEntry>} remote