Skip to content

Commit 6c63275

Browse files
committed
Bug 1861865 - Fix ESLint valid-jsdoc issues in various browser code and enable on directories where it is already passing. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D192163
1 parent de2cac3 commit 6c63275

File tree

7 files changed

+44
-36
lines changed

7 files changed

+44
-36
lines changed

.eslintrc.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,18 +240,13 @@ module.exports = {
240240
"browser/components/pocket/content/pkt*",
241241
"browser/components/preferences/**",
242242
"browser/components/privatebrowsing/**",
243-
"browser/components/prompts/PromptCollection.sys.mjs",
244-
"browser/components/protocolhandler/WebProtocolHandlerRegistrar.sys.mjs",
245243
"browser/components/safebrowsing/content/test/**",
246244
"browser/components/screenshots/**",
247245
"browser/components/sessionstore/**",
248246
"browser/components/storybook/.storybook/**",
249247
"browser/components/tests/browser/**",
250-
"browser/components/touchbar/tests/browser/browser_touchbar_searchrestrictions.js",
251248
"browser/extensions/screenshots/**",
252249
"browser/modules/**",
253-
"browser/themes/BuiltInThemes.sys.mjs",
254-
"browser/tools/mozscreenshots/**",
255250
"devtools/**",
256251
"docshell/base/URIFixup.sys.mjs",
257252
"dom/**",

browser/components/prompts/PromptCollection.sys.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
/**
66
* Implements nsIPromptCollection
7+
*
78
* @class PromptCollection
89
*/
910
export class PromptCollection {

browser/components/protocolhandler/WebProtocolHandlerRegistrar.sys.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ WebProtocolHandlerRegistrar.prototype = {
5252
/**
5353
* Determines if a web handler is already registered.
5454
*
55-
* @param aProtocol
55+
* @param {string} aProtocol
5656
* The scheme of the web handler we are checking for.
57-
* @param aURITemplate
57+
* @param {string} aURITemplate
5858
* The URI template that the handler uses to handle the protocol.
59-
* @return true if it is already registered, false otherwise.
59+
* @returns {boolean} true if it is already registered, false otherwise.
6060
*/
6161
_protocolHandlerRegistered(aProtocol, aURITemplate) {
6262
let eps = Cc[

browser/components/touchbar/tests/browser/browser_touchbar_searchrestrictions.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ XPCOMUtils.defineLazyServiceGetter(
2727
*/
2828

2929
/**
30-
* @param {string} input
30+
* @param {object} options
31+
* @param {string} options.input
3132
* The value to be inserted in the Urlbar.
32-
* @param {UrlbarTokenizer.RESTRICT} token
33+
* @param {UrlbarTokenizer.RESTRICT} options.token
3334
* A restriction token corresponding to a Touch Bar button.
3435
*/
3536
async function searchAndCheckState({ input, token }) {

browser/themes/BuiltInThemes.sys.mjs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,15 @@ class _BuiltInThemes {
116116
}
117117

118118
/**
119+
* This looks up the id in a Map rather than accessing a property on
120+
* the addon itself. That makes calls to this function O(m) where m is the
121+
* total number of built-in themes offered now or in the past. Since we
122+
* are using a Map, calls are O(1) in the average case.
123+
*
119124
* @param {string} id
120125
* A theme's ID.
121126
* @returns {boolean}
122127
* Returns true if the theme is expired. False otherwise.
123-
* @note This looks up the id in a Map rather than accessing a property on
124-
* the addon itself. That makes calls to this function O(m) where m is the
125-
* total number of built-in themes offered now or in the past. Since we
126-
* are using a Map, calls are O(1) in the average case.
127128
*/
128129
themeIsExpired(id) {
129130
let themeInfo = this.builtInThemeMap.get(id);
@@ -133,7 +134,7 @@ class _BuiltInThemes {
133134
/**
134135
* @param {string} id
135136
* The theme's id.
136-
* @return {boolean}
137+
* @returns {boolean}
137138
* True if the theme with id `id` is both expired and retained. That is,
138139
* the user has the ability to use it after its expiry date.
139140
*/
@@ -144,7 +145,7 @@ class _BuiltInThemes {
144145
/**
145146
* @param {string} id
146147
* The theme's id.
147-
* @return {boolean}
148+
* @returns {boolean}
148149
* True if the theme with id `id` is from the currently active theme.
149150
*/
150151
isActiveTheme(id) {
@@ -216,6 +217,7 @@ class _BuiltInThemes {
216217
/**
217218
* Set a pref to ensure that the user can continue to use a specified theme
218219
* past its expiry date.
220+
*
219221
* @param {string} id
220222
* The ID of the theme to retain.
221223
*/
@@ -233,6 +235,7 @@ class _BuiltInThemes {
233235
* Removes from the retained expired theme list colorways themes that have been
234236
* migrated from the one installed in the built-in XPIProvider location
235237
* to an AMO hosted xpi installed in the user profile XPIProvider location.
238+
*
236239
* @param {string} id
237240
* The ID of the theme to remove from the retained themes list.
238241
*/
@@ -255,9 +258,10 @@ class _BuiltInThemes {
255258
* same base color but with different intensities (soft, balanced, and bold),
256259
* or if the current collection doesn't have intensities, each colorway is
257260
* their own group. Group name localization is optional.
258-
* @param {string} id
261+
*
262+
* @param {string} colorwayId
259263
* The ID of the colorway add-on.
260-
* @return {string}
264+
* @returns {string}
261265
* Localized colorway group name. null if there's no such name, in which
262266
* case the caller should fall back on getting a name from the add-on API.
263267
*/
@@ -266,9 +270,9 @@ class _BuiltInThemes {
266270
}
267271

268272
/**
269-
* @param {string} id
273+
* @param {string} colorwayId
270274
* The ID of the colorway add-on.
271-
* @return {string}
275+
* @returns {string}
272276
* L10nId for intensity value of the colorway with the provided id, null if
273277
* there's none.
274278
*/
@@ -280,9 +284,9 @@ class _BuiltInThemes {
280284
}
281285

282286
/**
283-
* @param {string} id
287+
* @param {string} colorwayId
284288
* The ID of the colorway add-on.
285-
* @return {string}
289+
* @returns {string}
286290
* Localized description of the colorway with the provided id, null if
287291
* there's none.
288292
*/

browser/tools/mozscreenshots/head.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ async function setup() {
4141

4242
/**
4343
* Used by pre-defined sets of configurations to decide whether to run for a build.
44-
* @note This is not used by browser_screenshots.js which handles when MOZSCREENSHOTS_SETS is set.
45-
* @return {bool} whether to capture screenshots.
44+
*
45+
* This is not used by browser_screenshots.js which handles when MOZSCREENSHOTS_SETS is set.
46+
*
47+
* @returns {bool} whether to capture screenshots.
4648
*/
4749
function shouldCapture() {
4850
if (Services.env.get("MOZSCREENSHOTS_SETS")) {

browser/tools/mozscreenshots/mozscreenshots/extension/TestRunner.sys.mjs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,9 @@ export var TestRunner = {
155155
/**
156156
* Helper function for loadSets. This filters out the restricted configs from setName.
157157
* This was made a helper function to facilitate xpcshell unit testing.
158-
* @param {String} setName - set name to be filtered e.g. "Toolbars[onlyNavBar,allToolbars]"
159-
* @return {Object} Returns an object with two values: the filtered set name and a set of
158+
*
159+
* @param {string} setName - set name to be filtered e.g. "Toolbars[onlyNavBar,allToolbars]"
160+
* @returns {object} Returns an object with two values: the filtered set name and a set of
160161
* restricted configs.
161162
*/
162163
filterRestrictions(setName) {
@@ -175,8 +176,9 @@ export var TestRunner = {
175176

176177
/**
177178
* Load sets of configurations from JSMs.
178-
* @param {String[]} setNames - array of set names (e.g. ["Tabs", "WindowSize"].
179-
* @return {Object[]} Array of sets containing `name` and `configurations` properties.
179+
*
180+
* @param {string[]} setNames - array of set names (e.g. ["Tabs", "WindowSize"].
181+
* @returns {object[]} Array of sets containing `name` and `configurations` properties.
180182
*/
181183
loadSets(setNames) {
182184
let sets = [];
@@ -243,9 +245,10 @@ export var TestRunner = {
243245
/**
244246
* Calculate the bounding box based on CSS selector from config for cropping
245247
*
246-
* @param {String[]} selectors - array of CSS selectors for relevant DOM element
247-
* @return {Geometry.sys.mjs Rect} Rect holding relevant x, y, width, height with padding
248-
**/
248+
* @param {string[]} selectors - array of CSS selectors for relevant DOM element
249+
* @returns {Rect}
250+
* A Geometry.sys.mjs Rect holding relevant x, y, width, height with padding
251+
*/
249252
_findBoundingBox(selectors, windowType) {
250253
if (!selectors.length) {
251254
throw new Error("No selectors specified.");
@@ -564,8 +567,9 @@ export var TestRunner = {
564567

565568
/**
566569
* Finds the index of the first comma that is not enclosed within square brackets.
567-
* @param {String} envVar - the string that needs to be searched
568-
* @return {Integer} index of valid comma or -1 if not found.
570+
*
571+
* @param {string} envVar - the string that needs to be searched
572+
* @returns {number} index of valid comma or -1 if not found.
569573
*/
570574
findComma(envVar) {
571575
let nestingDepth = 0;
@@ -584,8 +588,9 @@ export var TestRunner = {
584588

585589
/**
586590
* Splits the environment variable around commas not enclosed in brackets.
587-
* @param {String} envVar - The environment variable
588-
* @return {String[]} Array of strings containing the configurations
591+
*
592+
* @param {string} envVar - The environment variable
593+
* @returns {string[]} Array of strings containing the configurations
589594
* e.g. ["Toolbars[onlyNavBar,allToolbars]","DevTools[jsdebugger,webconsole]","Tabs"]
590595
*/
591596
splitEnv(envVar) {
@@ -604,7 +609,7 @@ export var TestRunner = {
604609

605610
/**
606611
* Helper to lazily compute the Cartesian product of all of the sets of configurations.
607-
**/
612+
*/
608613
function LazyProduct(sets) {
609614
/**
610615
* An entry for each set with the value being:

0 commit comments

Comments
 (0)