diff --git a/editor/draw.js b/editor/draw.js index dd7f347b..bf7b100a 100644 --- a/editor/draw.js +++ b/editor/draw.js @@ -121,7 +121,7 @@ export class Drawing { * Note: Layers are ordered, but referenced externally by name; so, we need both container * types depending on which function is called (i.e. all_layers and layer_map). * - * @type {PlainObject.} + * @type {PlainObject} */ this.layer_map = {}; @@ -133,7 +133,7 @@ export class Drawing { /** * The nonce to use to uniquely identify elements across drawings. - * @type {!String} + * @type {!string} */ this.nonce_ = ''; const n = this.svgElem_.getAttributeNS(NS.SE, 'nonce'); diff --git a/editor/embedapi.js b/editor/embedapi.js index e7db4a88..e38e27c4 100644 --- a/editor/embedapi.js +++ b/editor/embedapi.js @@ -12,7 +12,7 @@ let cbid = 0; */ /** * @callback module:EmbeddedSVGEdit.CallbackSetGetter -* @param {...*} args Signature dependent on the function +* @param {...Any} args Signature dependent on the function * @returns {module:EmbeddedSVGEdit.CallbackSetter} */ diff --git a/editor/extensions/ext-shapes.js b/editor/extensions/ext-shapes.js index a2ba2665..8c9b4940 100644 --- a/editor/extensions/ext-shapes.js +++ b/editor/extensions/ext-shapes.js @@ -71,7 +71,7 @@ export default { /** * @typedef {PlainObject} module:Extension.Shapes.Shapes - * @property {PlainObject.} data + * @property {PlainObject} data * @property {Integer} [size] * @property {boolean} [fill] */ diff --git a/editor/history.js b/editor/history.js index cf4b72eb..553987d8 100644 --- a/editor/history.js +++ b/editor/history.js @@ -310,7 +310,7 @@ RemoveElementCommand.type = RemoveElementCommand.prototype.type; * @typedef {"#text"|"#href"|string} module:history.CommandAttributeName */ /** -* @typedef {PlainObject.} module:history.CommandAttributes +* @typedef {PlainObject} module:history.CommandAttributes */ /** diff --git a/editor/jQuery.attr.js b/editor/jQuery.attr.js index a6bc24ff..30acdce9 100644 --- a/editor/jQuery.attr.js +++ b/editor/jQuery.attr.js @@ -22,7 +22,7 @@ export default function jQueryPluginSVG ($) { const proxied = $.fn.attr, svgns = 'http://www.w3.org/2000/svg'; /** - * @typedef {PlainObject.} module:jQueryAttr.Attributes + * @typedef {PlainObject} module:jQueryAttr.Attributes */ /** * @function external:jQuery.fn.attr diff --git a/editor/jgraduate/jQuery.jGraduate.js b/editor/jgraduate/jQuery.jGraduate.js index 2294aea1..aba01f31 100644 --- a/editor/jgraduate/jQuery.jGraduate.js +++ b/editor/jgraduate/jQuery.jGraduate.js @@ -200,7 +200,7 @@ export default function jQueryPluginJGraduate ($) { const isGecko = navigator.userAgent.includes('Gecko/'); /** - * @typedef {PlainObject.} module:jGraduate.Attrs + * @typedef {PlainObject} module:jGraduate.Attrs */ /** * @param {SVGElement} elem diff --git a/editor/jgraduate/jQuery.jPicker.js b/editor/jgraduate/jQuery.jPicker.js index 71afdc3b..63185954 100755 --- a/editor/jgraduate/jQuery.jPicker.js +++ b/editor/jgraduate/jQuery.jPicker.js @@ -406,7 +406,6 @@ const jPicker = function ($) { * @param {external:jQuery.jPicker.Color} color * @param {external:jQuery.fn.$.fn.jPicker} bindedHex * @param {Float} alphaPrecision - * @constructor */ class ColorValuePicker { constructor (picker, color, bindedHex, alphaPrecision) { diff --git a/editor/locale/locale.js b/editor/locale/locale.js index 55a2893d..e3f29cfa 100644 --- a/editor/locale/locale.js +++ b/editor/locale/locale.js @@ -12,16 +12,16 @@ /** * Used, for example, in the ImageLibs extension, to present libraries (with name/URL/description) in order - * @typedef {GenericArray.} module:locale.LocaleArray + * @typedef {GenericArray} module:locale.LocaleArray */ /** * The string keys of the object are two-letter language codes * @tutorial LocaleDocs - * @typedef {PlainObject.} module:locale.LocaleStrings + * @typedef {PlainObject} module:locale.LocaleStrings */ // keyed to an array of objects with "id" and "title" or "textContent" properties /** - * @typedef {PlainObject.} module:locale.LocaleSelectorValue + * @typedef {PlainObject} module:locale.LocaleSelectorValue */ import {importSetGlobalDefault} from '../external/dynamic-import-polyfill/importModule.js'; diff --git a/editor/path.js b/editor/path.js index addac38a..29ffa151 100644 --- a/editor/path.js +++ b/editor/path.js @@ -42,7 +42,7 @@ const segData = { /** * @tutorial LocaleDocs * @typedef {module:locale.LocaleStrings|PlainObject} module:path.uiStrings - * @property {PlainObject.} ui + * @property {PlainObject} ui */ const uiStrings = {}; @@ -89,7 +89,7 @@ let editorContext_ = null; * Object with the following keys/values * @typedef {PlainObject} module:path.SVGElementJSON * @property {string} element - Tag name of the SVG element to create -* @property {PlainObject.} attr - Has key-value attributes to assign to the new element +* @property {PlainObject} attr - Has key-value attributes to assign to the new element * @property {boolean} [curStyles=false] - Indicates whether current style attributes should be applied first * @property {module:path.SVGElementJSON[]} [children] - Data objects to be added recursively as children * @property {string} [namespace="http://www.w3.org/2000/svg"] - Indicate a (non-SVG) namespace @@ -135,7 +135,7 @@ let editorContext_ = null; /** * @function module:path.EditorContext#remapElement * @param {Element} selected - DOM element to be changed - * @param {PlainObject.} changes - Object with changes to be remapped + * @param {PlainObject} changes - Object with changes to be remapped * @param {SVGMatrix} m - Matrix object to use for remapping coordinates * @returns {void} */ diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 118e8d25..6a80eae3 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -3107,10 +3107,10 @@ editor.init = function () { * @typedef {PlainObject} module:SVGEditor.ContextTool * @property {string} panel The ID of the existing panel to which the tool is being added. Required. * @property {string} id The ID of the actual tool element. Required. - * @property {PlainObject.|PlainObject.<"change", external:jQuery.Function>} events DOM event names keyed to associated functions. Example: `{change () { alert('Option was changed') } }`. "change" event is one specifically handled for the "button-select" type. Required. + * @property {PlainObject|PlainObject<"change", external:jQuery.Function>} events DOM event names keyed to associated functions. Example: `{change () { alert('Option was changed') } }`. "change" event is one specifically handled for the "button-select" type. Required. * @property {string} title The tooltip text that will appear when the user hovers over the tool. Required. * @property {"tool_button"|"select"|"button-select"|"input"|string} type The type of tool being added. Expected. - * @property {PlainObject.} [options] List of options and their labels for select tools. Example: `{1: 'One', 2: 'Two', all: 'All' }`. Required by "select" tools. + * @property {PlainObject} [options] List of options and their labels for select tools. Example: `{1: 'One', 2: 'Two', all: 'All' }`. Required by "select" tools. * @property {string} [container_id] The ID to be given to the tool's container element. * @property {string} [defval] Default value * @property {string|Integer} [colnum] Added as part of the option list class. @@ -3228,7 +3228,7 @@ editor.init = function () { * @property {string} id A unique identifier for this button. If SVG icons are used, this must match the ID used in the icon file. Required. * @property {"mode_flyout"|"mode"|"context"|"app_menu"} type Type of button. Required. * @property {string} title The tooltip text that will appear when the user hovers over the icon. Required. - * @property {PlainObject.|PlainObject.<"click", external:jQuery.Function>} events DOM event names with associated functions. Example: `{click () { alert('Button was clicked') } }`. Click is used with `includeWith` and `type` of "mode_flyout" (and "mode"); any events may be added if `list` is not present. Expected. + * @property {PlainObject|PlainObject<"click", external:jQuery.Function>} events DOM event names with associated functions. Example: `{click () { alert('Button was clicked') } }`. Click is used with `includeWith` and `type` of "mode_flyout" (and "mode"); any events may be added if `list` is not present. Expected. * @property {string} panel The ID of the context panel to be included, if type is "context". Required only if type is "context". * @property {string} icon The file path to the raster version of the icon image source. Required only if no `svgicons` is supplied from [ExtensionInitResponse]{@link module:svgcanvas.ExtensionInitResponse}. * @property {string} [svgicon] If absent, will utilize the button "id"; used to set "placement" on the `svgIcons` call diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 7fac71dd..3eeaff64 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -89,6 +89,8 @@ if (window.opera) { window.console.dir = function (str) { /* */ }; } +// Reenable after fixing eslint-plugin-jsdoc to handle +/* eslint-disable jsdoc/valid-types */ /** * The main SvgCanvas class that manages all SVG-related functions. * @memberof module:svgcanvas @@ -118,6 +120,7 @@ if (window.opera) { * @borrows module:path.pathActions.linkControlPoints as #linkControlPoints */ class SvgCanvas { + /* eslint-enable jsdoc/valid-types */ /** * @param {HTMLElement} container - The container HTML element that should hold the SVG root element * @param {module:SVGEditor.curConfig} config - An object that contains configuration data @@ -279,7 +282,7 @@ let selectedElements = []; /** * @typedef {PlainObject} module:svgcanvas.SVGAsJSON * @property {string} element -* @property {PlainObject.} attr +* @property {PlainObject} attr * @property {module:svgcanvas.SVGAsJSON[]} children */ @@ -1061,8 +1064,8 @@ const runExtensions = this.runExtensions = function (action, vars, returnArray, /** * @interface module:svgcanvas.ExtensionInitResponse - * @property {module:SVGEditor.ContextTool[]|PlainObject.} [context_tools] - * @property {module:SVGEditor.Button[]|PlainObject.} [buttons] + * @property {module:SVGEditor.ContextTool[]|PlainObject} [context_tools] + * @property {module:SVGEditor.Button[]|PlainObject} [buttons] * @property {string} [svgicons] The location of a local SVG or SVGz file */ /** @@ -6383,7 +6386,7 @@ this.pasteElements = function (type, x, y) { const batchCmd = new BatchCommand('Paste elements'); // const drawing = getCurrentDrawing(); /** - * @typedef {PlainObject.} module:svgcanvas.ChangedIDs + * @typedef {PlainObject} module:svgcanvas.ChangedIDs */ /** * @type {module:svgcanvas.ChangedIDs} diff --git a/editor/svgicons/jQuery.svgIcons.js b/editor/svgicons/jQuery.svgIcons.js index ef917e4e..8ab25c60 100644 --- a/editor/svgicons/jQuery.svgIcons.js +++ b/editor/svgicons/jQuery.svgIcons.js @@ -90,7 +90,7 @@ $(function() { /** * @callback module:jQuerySVGIcons.SVGIconsLoadedCallback -* @param {PlainObject.} svgIcons IDs keyed to jQuery objects of images +* @param {PlainObject} svgIcons IDs keyed to jQuery objects of images */ /** @@ -105,12 +105,12 @@ export default function jQueryPluginSVGIcons ($) { /** * Map of raster images with each key being the SVG icon ID * to replace, and the value the image file name - * @typedef {PlainObject.} external:jQuery.svgIcons.Fallback + * @typedef {PlainObject} external:jQuery.svgIcons.Fallback */ /** * Map of raster images with each key being the SVG icon ID * whose `alt` will be set, and the value being the `alt` text - * @typedef {PlainObject.} external:jQuery.svgIcons.Alts + * @typedef {PlainObject} external:jQuery.svgIcons.Alts */ /** * @function external:jQuery.svgIcons diff --git a/editor/typedefs.js b/editor/typedefs.js index d25c193f..308e4205 100644 --- a/editor/typedefs.js +++ b/editor/typedefs.js @@ -13,12 +13,12 @@ /** * This should only be used when the return result from a callback * is not known as to type. -* @typedef {*} ArbitraryCallbackResult +* @typedef {Any} ArbitraryCallbackResult */ /** * @callback GenericCallback -* @param {...*} args Signature dependent on the function +* @param {...Any} args Signature dependent on the function * @returns {ArbitraryCallbackResult} Return dependent on the function */ @@ -48,9 +48,9 @@ * representing arguments for passing around * @typedef {GenericArray} ArgumentsArray */ + /** -* This should only be used for items known to be wholly arbitrary -* @typedef {*} Any +* The `Any` type should only be used for items known to be wholly arbitrary */ /** diff --git a/editor/utilities.js b/editor/utilities.js index bd1f7919..36bac308 100644 --- a/editor/utilities.js +++ b/editor/utilities.js @@ -41,7 +41,7 @@ let svgroot_ = null; * Object with the following keys/values * @typedef {PlainObject} module:utilities.SVGElementJSON * @property {string} element - Tag name of the SVG element to create -* @property {PlainObject.} attr - Has key-value attributes to assign to the new element +* @property {PlainObject} attr - Has key-value attributes to assign to the new element * @property {boolean} [curStyles=false] - Indicates whether current style attributes should be applied first * @property {module:utilities.SVGElementJSON[]} [children] - Data objects to be added recursively as children * @property {string} [namespace="http://www.w3.org/2000/svg"] - Indicate a (non-SVG) namespace diff --git a/package-lock.json b/package-lock.json index c9d0cea1..77ecb189 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4195,9 +4195,9 @@ } }, "eslint-plugin-jsdoc": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-8.7.0.tgz", - "integrity": "sha512-4UzO2Yw+5s1DOfQCTaasUx8Ng/h6/nTtrO3gGiCD086pOAcDFkbVHKdGrGnGuXd90MPDE9bHD92xJ5ke3cMrRA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-9.0.0.tgz", + "integrity": "sha512-N3GSid5pj8ELOyUXUdbbcP+JVsc6niGe4zURNy4yTOQ0aCufnlgGtGkOON7jFhg6PYerOyaMnkNsdGo60ih7kA==", "dev": true, "requires": { "comment-parser": "^0.5.5", diff --git a/package.json b/package.json index 42a50791..3d6a22db 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "eslint-plugin-compat": "^3.2.0", "eslint-plugin-eslint-comments": "^3.1.2", "eslint-plugin-import": "2.18.0", - "eslint-plugin-jsdoc": "^8.7.0", + "eslint-plugin-jsdoc": "^9.0.0", "eslint-plugin-markdown": "^1.0.0", "eslint-plugin-no-use-extend-native": "^0.4.1", "eslint-plugin-node": "9.1.0",