commit fd62657728ec5007c2bb30b9acd620f56683facd parent 88ea51175c70c64704c7ca3290b8dd7474121e3c Author: Mark Banner <standard8@mozilla.com> Date: Mon, 22 Dec 2025 12:39:06 +0000 Bug 2004680 - Fix ESLint rule jsdoc/check-tag-names issues in devtools. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe Differential Revision: https://phabricator.services.mozilla.com/D275754 Diffstat:
24 files changed, 86 insertions(+), 73 deletions(-)
diff --git a/devtools/client/accessibility/components/Accessible.js b/devtools/client/accessibility/components/Accessible.js @@ -464,7 +464,7 @@ const isAccessibleFront = value => value && value.typeName === "accessible"; * translate accessibleFront to a grip-like object that can be used with an Accessible * rep. * - * @params {accessibleFront} accessibleFront + * @param {AccessibleFront} accessibleFront * The AccessibleFront for which we want to create a grip-like object. * @returns {object} a grip-like object that can be used with Reps. */ diff --git a/devtools/client/debugger/src/utils/memoizableAction.js b/devtools/client/debugger/src/utils/memoizableAction.js @@ -9,11 +9,6 @@ import { validateContext } from "./context"; * memoizableActon is a utility for actions that should only be performed * once per key. It is useful for loading sources * - * @getValue - gets the result from the redux store - * @createKey - creates a key for the requests map - * @action - kicks off the async work for the action - * - * * For Example * * export const setItem = memoizeableAction( @@ -25,6 +20,15 @@ import { validateContext } from "./context"; * action: ({ a }, thunkArgs) => doSetItem(a, thunkArgs) * } * ); + * + * @param {string} name + * @param {object} options + * @param {Function} options.getValue + * Gets the result from the redux store. + * @param {Function} options.createKey + * Creates a key for the requests map. + * @param {Function} options.action + * Kicks off the async work for the action. */ export function memoizeableAction(name, { getValue, createKey, action }) { const requests = new Map(); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg-blackbox.js b/devtools/client/debugger/test/mochitest/browser_dbg-blackbox.js @@ -508,8 +508,8 @@ async function assertContextMenuDisabled(dbg, selector, shouldBeDisabled) { /** * Asserts that the gutter blackbox context menu items which are visible are correct * - * @params {object} dbg - * @params {Array} testFixtures + * @param {object} dbg + * @param {Array} testFixtures * Details needed for the assertion. Any blackboxed/nonBlackboxed lines * and any blackboxed/nonBlackboxed sources */ @@ -566,8 +566,8 @@ async function assertGutterBlackBoxBoxContextMenuItems(dbg, testFixtures) { /** * Asserts that the source tree blackbox context menu items which are visible are correct * - * @params {object} dbg - * @params {Array} testFixtures + * @param {object} dbg + * @param {Array} testFixtures * Details needed for the assertion. Any blackboxed/nonBlackboxed sources */ async function assertSourceTreeBlackBoxBoxContextMenuItems(dbg, testFixtures) { @@ -599,8 +599,8 @@ async function assertSourceTreeBlackBoxBoxContextMenuItems(dbg, testFixtures) { /** * Asserts that the editor blackbox context menu items which are visible are correct * - * @params {object} dbg - * @params {Array} testFixtures + * @param {object} dbg + * @param {Array} testFixtures * Details needed for the assertion. Any blackboxed/nonBlackboxed lines * and any blackboxed/nonBlackboxed sources */ diff --git a/devtools/client/fronts/memory.js b/devtools/client/fronts/memory.js @@ -37,11 +37,12 @@ class MemoryFront extends FrontClassWithSpec(memorySpec) { * Note that this is safe to call for actors inside sandoxed child processes, * as we jump through the correct IPDL hoops. * - * @params Boolean options.forceCopy + * @param {object} options + * @param {boolean} options.forceCopy * Always force a bulk data copy of the saved heap snapshot, even when * the server and client share a file system. * - * @params {object | undefined} options.boundaries + * @param {object | undefined} options.boundaries * The boundaries for the heap snapshot. See * ChromeUtils.webidl for more details. * diff --git a/devtools/client/inspector/changes/test/xpcshell/mocks.js b/devtools/client/inspector/changes/test/xpcshell/mocks.js @@ -10,6 +10,7 @@ * It corresponds to the tracking of a single property value change (background-color) * within a deeply nested CSS at-rule structure from an inline stylesheet: * + * ``` * @media (min-width: 50em) { * @supports (display: grid) { * body { @@ -18,6 +19,7 @@ * } * } * } + * ``` */ module.exports.CHANGES_STATE = { source1: { diff --git a/devtools/client/inspector/fonts/test/head.js b/devtools/client/inspector/fonts/test/head.js @@ -226,7 +226,7 @@ function getFamilyName(fontEl) { * @return {object} * Object with the value and unit of the given font property or axis tag * from the corresponding input fron the font editor. - * @Example: + * @example * { * value: {String|null} * unit: {String|null} diff --git a/devtools/client/inspector/shared/highlighters-overlay.js b/devtools/client/inspector/shared/highlighters-overlay.js @@ -848,7 +848,7 @@ class HighlightersOverlay { * * @param {NodeFront} node * The NodeFront of the flexbox container element to highlight. - * @param. {string} trigger + * @param {string} trigger * String name matching "layout", "markup" or "rule" to indicate where the * flexbox highlighter was toggled on from. "layout" represents the layout view. * "markup" represents the markup view. "rule" represents the rule view. @@ -870,7 +870,7 @@ class HighlightersOverlay { * The NodeFront of the flexbox container element to highlight. * @param {object} options * Object used for passing options to the flexbox highlighter. - * @param. {string} trigger + * @param {string} trigger * String name matching "layout", "markup" or "rule" to indicate where the * flexbox highlighter was toggled on from. "layout" represents the layout view. * "markup" represents the markup view. "rule" represents the rule view. @@ -936,7 +936,7 @@ class HighlightersOverlay { * * @param {NodeFront} node * The NodeFront of the grid container element to highlight. - * @param. {string} trigger + * @param {string} trigger * String name matching "grid", "markup" or "rule" to indicate where the * grid highlighter was toggled on from. "grid" represents the grid view. * "markup" represents the markup view. "rule" represents the rule view. diff --git a/devtools/client/inspector/shared/utils.js b/devtools/client/inspector/shared/utils.js @@ -183,7 +183,7 @@ function promiseWarn(error) { * While waiting for a reps fix in https://github.com/firefox-devtools/reps/issues/92, * translate nodeFront to a grip-like object that can be used with an ElementNode rep. * - * @params {NodeFront} nodeFront + * @param {NodeFront} nodeFront * The NodeFront for which we want to create a grip-like object. * @returns {object} a grip-like object that can be used with Reps. */ diff --git a/devtools/client/netmonitor/src/components/messages/parsers/socket-io/binary.js b/devtools/client/netmonitor/src/components/messages/parsers/socket-io/binary.js @@ -18,7 +18,7 @@ * @param {object} packet - event packet with placeholders * @param {Array} buffers - binary buffers to put in placeholder positions * @return {object} reconstructed packet - * @api public + * @public */ exports.reconstructPacket = function (packet, buffers) { diff --git a/devtools/client/netmonitor/src/components/messages/parsers/socket-io/component-emitter.js b/devtools/client/netmonitor/src/components/messages/parsers/socket-io/component-emitter.js @@ -14,7 +14,7 @@ /** * Initialize a new `Emitter`. * - * @api public + * @public */ function Emitter(obj) { @@ -28,7 +28,7 @@ function Emitter(obj) { * * @param {object} obj * @return {object} - * @api private + * @private */ function mixin(obj) { @@ -44,7 +44,7 @@ function mixin(obj) { * @param {string} event * @param {Function} fn * @return {Emitter} - * @api public + * @public */ Emitter.prototype.on = function (event, fn) { diff --git a/devtools/client/netmonitor/src/components/messages/parsers/socket-io/index.js b/devtools/client/netmonitor/src/components/messages/parsers/socket-io/index.js @@ -77,7 +77,7 @@ const BINARY_ACK = 6; * A socket.io Decoder instance * * @return {object} decoder - * @api public + * @public */ function Decoder() { @@ -97,7 +97,7 @@ Emitter(Decoder.prototype); * * @param {object} packet * @return {BinaryReconstructor} initialized reconstructor - * @api private + * @private */ function BinaryReconstructor(packet) { @@ -112,7 +112,7 @@ function BinaryReconstructor(packet) { * @param {Buffer | ArrayBuffer} binData - the raw binary data received * @return {null | object} returns null if more binary data is expected or * a reconstructed packet object if all buffers have been received. - * @api private + * @private */ BinaryReconstructor.prototype.takeBinaryData = function (binData) { @@ -129,7 +129,7 @@ BinaryReconstructor.prototype.takeBinaryData = function (binData) { /** * Cleans up binary packet reconstruction variables. * - * @api private + * @private */ BinaryReconstructor.prototype.finishedReconstruction = function () { @@ -142,7 +142,7 @@ BinaryReconstructor.prototype.finishedReconstruction = function () { * * @param {string} obj - encoded packet * @return {object} packet - * @api public + * @public */ Decoder.prototype.add = function (obj) { @@ -183,7 +183,7 @@ Decoder.prototype.add = function (obj) { * * @param {string} str * @return {object} packet - * @api private + * @private */ // eslint-disable-next-line complexity function decodeString(str) { @@ -273,7 +273,7 @@ function tryParse(str) { /** * Deallocates a parser's resources * - * @api public + * @public */ Decoder.prototype.destroy = function () { diff --git a/devtools/client/netmonitor/src/components/messages/parsers/socket-io/is-buffer.js b/devtools/client/netmonitor/src/components/messages/parsers/socket-io/is-buffer.js @@ -27,7 +27,7 @@ var isView = function (obj) { /** * Returns true if obj is a buffer or an arraybuffer. * - * @api private + * @private */ function isBuf(obj) { diff --git a/devtools/client/responsive/utils/window.js b/devtools/client/responsive/utils/window.js @@ -20,7 +20,7 @@ exports.getDOMWindowUtils = getDOMWindowUtils; /** * Check if the given browser window has finished the startup. * - * @params {nsIDOMWindow} window + * @param {nsIDOMWindow} window */ const isStartupFinished = window => window.gBrowserInit?.delayedStartupFinished; diff --git a/devtools/client/shared/components/reps/reps/error.mjs b/devtools/client/shared/components/reps/reps/error.mjs @@ -123,18 +123,22 @@ function getErrorName(props) { * Returns a React element reprensenting the Error stacktrace, i.e. * transform error.stack from: * + * ``` * semicolon@debugger eval code:1:109 * jkl@debugger eval code:1:63 * asdf@debugger eval code:1:28 * * @debugger eval code:1:227 + * ``` * * Into a column layout: * + * ``` * semicolon (<anonymous>:8:10) * jkl (<anonymous>:5:10) * asdf (<anonymous>:2:10) * (<anonymous>:11:1) + * ``` */ function getStacktraceElements(props, preview) { const stack = []; diff --git a/devtools/client/shared/components/test/chrome/test_searchbox-with-autocomplete.html b/devtools/client/shared/components/test/chrome/test_searchbox-with-autocomplete.html @@ -23,8 +23,8 @@ window.onload = async function () { * Typically UL > LI and each item's text value is * compared with the reference item's value as a test * - * @params {Node} - Node to be compared - * @reference {Array} - Reference array for comparison. The selected index is + * @param {Node} list - Node to be compared + * @param {Array} reference - Reference array for comparison. The selected index is * highlighted as a single element array ie. ["[abc]", "ab", "abcPQR"], * Here the element "abc" is highlighted */ diff --git a/devtools/client/shared/sourceeditor/lezer-utils.js b/devtools/client/shared/sourceeditor/lezer-utils.js @@ -145,8 +145,8 @@ function clear() { * * @param {object} doc - The codemirror document used to retrive the part of content * @param {object} node - The parser syntax node https://lezer.codemirror.net/docs/ref/#common.SyntaxNode - * @params {object} options - * options.includeAnonymousFunctions - if true, allow matching anonymous functions + * @param {object} options + * @param {boolean} options.includeAnonymousFunctions - if true, allow matching anonymous functions * @returns */ function getEnclosingFunction( diff --git a/devtools/client/styleeditor/StyleEditorUI.sys.mjs b/devtools/client/styleeditor/StyleEditorUI.sys.mjs @@ -175,11 +175,11 @@ export class StyleEditorUI extends EventEmitter { /** * Initiates the style editor ui creation, and start to track TargetCommand updates. * - * @params {object} options - * @params {object} options.stylesheetToSelect - * @params {StyleSheetResource} options.stylesheetToSelect.stylesheet - * @params {Integer} options.stylesheetToSelect.line - * @params {Integer} options.stylesheetToSelect.column + * @param {object} options + * @param {object} options.stylesheetToSelect + * @param {StyleSheetResource} options.stylesheetToSelect.stylesheet + * @param {Integer} options.stylesheetToSelect.line + * @param {Integer} options.stylesheetToSelect.column */ async initialize(options = {}) { this.createUI(); @@ -472,8 +472,8 @@ export class StyleEditorUI extends EventEmitter { /** * Opens the Options Popup Menu * - * @params {number} screenX - * @params {number} screenY + * @param {number} screenX + * @param {number} screenY * Both obtained from the event object, used to position the popup */ #onOptionsButtonClick = ({ screenX, screenY }) => { diff --git a/devtools/server/actors/highlighters/eye-dropper.js b/devtools/server/actors/highlighters/eye-dropper.js @@ -241,9 +241,10 @@ class EyeDropper { * Create an image bitmap from the page screenshot, draw the eyedropper and set the * "drawn" attribute on the "root" element once it's done. * - * @params {string | null} screenshot: a dataURL representation of the page screenshot. - * If null, we'll use `drawWindow` to get the the page screenshot - * (⚠️ but it won't handle remote frames). + * @param {string | null} screenshot + * A dataURL representation of the page screenshot. + * If null, we'll use `drawWindow` to get the the page screenshot + * (⚠️ but it won't handle remote frames). */ async updateScreenshot(screenshot) { const rootElement = this.getElement("eye-dropper-root"); diff --git a/devtools/server/actors/targets/window-global.js b/devtools/server/actors/targets/window-global.js @@ -792,10 +792,10 @@ class WindowGlobalTargetActor extends BaseTargetActor { /** * Called when the actor is removed from the connection. * - * @params {object} options - * @params {boolean} options.isTargetSwitching: Set to true when this is called during + * @param {object} options + * @param {boolean} options.isTargetSwitching: Set to true when this is called during * a target switch. - * @params {boolean} options.isModeSwitching: Set to true true when this is called as the + * @param {boolean} options.isModeSwitching: Set to true true when this is called as the * result of a change to the devtools.browsertoolbox.scope pref. */ destroy({ isTargetSwitching = false, isModeSwitching = false } = {}) { diff --git a/devtools/server/actors/utils/stylesheets-manager.js b/devtools/server/actors/utils/stylesheets-manager.js @@ -316,7 +316,7 @@ class StyleSheetsManager extends EventEmitter { * Return resourceId of the given style sheet or create one if the stylesheet wasn't * registered yet. * - * @params {StyleSheet} styleSheet + * @param {StyleSheet} styleSheet * @returns {string} resourceId */ getStyleSheetResourceId(styleSheet) { @@ -335,7 +335,7 @@ class StyleSheetsManager extends EventEmitter { * Return the associated resourceId of the given registered style sheet, or null if the * stylesheet wasn't registered yet. * - * @params {StyleSheet} styleSheet + * @param {StyleSheet} styleSheet * @returns {string} resourceId */ #findStyleSheetResourceId(styleSheet) { @@ -354,7 +354,7 @@ class StyleSheetsManager extends EventEmitter { /** * Return owner node of the style sheet of the given resource id. * - * @params {string} resourceId + * @param {string} resourceId * The id associated with the stylesheet * @returns {Element|null} */ @@ -366,7 +366,7 @@ class StyleSheetsManager extends EventEmitter { /** * Return the index of given stylesheet of the given resource id. * - * @params {string} resourceId + * @param {string} resourceId * The id associated with the stylesheet * @returns {number} */ @@ -393,7 +393,7 @@ class StyleSheetsManager extends EventEmitter { /** * Get the text of a stylesheet given its resourceId. * - * @params {string} resourceId + * @param {string} resourceId * The id associated with the stylesheet * @returns {string} */ @@ -414,7 +414,7 @@ class StyleSheetsManager extends EventEmitter { /** * Toggle the disabled property of the stylesheet * - * @params {string} resourceId + * @param {string} resourceId * The id associated with the stylesheet * @return {boolean} the disabled state after toggling. */ diff --git a/devtools/server/connectors/worker-connector.js b/devtools/server/connectors/worker-connector.js @@ -16,13 +16,13 @@ loader.lazyRequireGetter( /** * Start a DevTools server in a worker and add it as a child server for a given active connection. * - * @params {DevToolsConnection} connection - * @params {WorkerDebugger} dbg: The WorkerDebugger we want to create a target actor for. - * @params {string} forwardingPrefix: The prefix that will be used to forward messages - * to the DevToolsServer on the worker thread. - * @params {object} options: An option object that will be passed with the "connect" packet. - * @params {object} options.sessionData: The sessionData object that will be passed to the - * worker target actor. + * @param {DevToolsConnection} connection + * @param {WorkerDebugger} dbg: The WorkerDebugger we want to create a target actor for. + * @param {string} forwardingPrefix: The prefix that will be used to forward messages + * to the DevToolsServer on the worker thread. + * @param {object} options: An option object that will be passed with the "connect" packet. + * @param {object} options.sessionData: The sessionData object that will be passed to the + * worker target actor. */ function connectToWorker(connection, dbg, forwardingPrefix, options) { return new Promise((resolve, reject) => { diff --git a/devtools/server/tracer/tracer.sys.mjs b/devtools/server/tracer/tracer.sys.mjs @@ -979,7 +979,7 @@ let activeTracer = null; * Start tracing JavaScript. * i.e. log the name of any function being called in JS and its location in source code. * - * @params {object} options (mandatory) + * @param {object} options (mandatory) * See JavaScriptTracer.startTracing jsdoc. */ function startTracing(options) { diff --git a/devtools/shared/protocol/Actor.js b/devtools/shared/protocol/Actor.js @@ -174,7 +174,7 @@ exports.Actor = Actor; * When a RDP packet is received for calling an actor method, this lookup for * the method name in this object and call the function holded on this attribute. * - * @params {object} actorSpec + * @param {object} actorSpec * The procotol-js actor specific coming from devtools/shared/specs/*.js files * This describes the types for methods and events implemented by all actors. * @return {object} requestTypes diff --git a/devtools/shared/specs/webconsole.js b/devtools/shared/specs/webconsole.js @@ -103,7 +103,7 @@ const webconsoleSpecPrototype = { * Start the given Web Console listeners. * * @see webconsoleFront LISTENERS - * @Arg array events + * @param {Array} events * Array of events you want to start. See this.LISTENERS for * known events. */ @@ -117,10 +117,10 @@ const webconsoleSpecPrototype = { * Stop the given Web Console listeners. * * @see webconsoleFront LISTENERS - * @Arg array events + * @param {Array} events * Array of events you want to stop. See this.LISTENERS for * known events. - * @Arg function onResponse + * @param {Function} onResponse * Function to invoke when the server response is received. */ stopListeners: { @@ -133,7 +133,7 @@ const webconsoleSpecPrototype = { * Retrieve the cached messages from the server. * * @see webconsoleFront CACHED_MESSAGES - * @Arg array types + * @param {Array} types * The array of message types you want from the server. See * this.CACHED_MESSAGES for known types. */ @@ -165,14 +165,15 @@ const webconsoleSpecPrototype = { /** * Autocomplete a JavaScript expression. * - * @Arg {string} string + * @param {string} string * The code you want to autocomplete. - * @Arg {number} cursor + * @param {number} cursor * Cursor location inside the string. Index starts from 0. - * @Arg {string} frameActor + * @param {string} frameActor * The id of the frame actor that made the call. - * @Arg {string} selectedNodeActor: Actor id of the selected node in the inspector. - * @Arg {Array} authorizedEvaluations + * @param {string} selectedNodeActor + * Actor id of the selected node in the inspector. + * @param {Array} authorizedEvaluations * Array of the properties access which can be executed by the engine. * Example: [["x", "myGetter"], ["x", "myGetter", "y", "anotherGetter"]] to * retrieve properties of `x.myGetter.` and `x.myGetter.y.anotherGetter`.