From 05fc69795c8f69737dda3203e0182393639e6e4c Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Fri, 8 May 2020 17:32:46 +0800 Subject: [PATCH] - Linting (ESLint): eslint-plugin-jsdoc PR-inspired fixes; temporarily disable `unicorn/prefer-number-properties` --- .eslintrc.js | 1 + editor/embedapi.js | 5 ++++- editor/extensions/ext-webappfind.js | 4 +++- editor/utilities.js | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 9d078e2b..b86c75d0 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -346,6 +346,7 @@ module.exports = { 'unicorn/prefer-query-selector': 'off', 'unicorn/prefer-node-append': 'off', 'unicorn/no-zero-fractions': 'off', + 'unicorn/prefer-number-properties': 'off', 'jsdoc/require-file-overview': ['error', { tags: { file: { diff --git a/editor/embedapi.js b/editor/embedapi.js index 5d6148ea..b41a6e9b 100644 --- a/editor/embedapi.js +++ b/editor/embedapi.js @@ -37,7 +37,10 @@ function getCallbackSetter (funcName) { * avoid using JSON parsing (and its limitations) in the case * of same domain control. * @param {module:EmbeddedSVGEdit.EmbeddedSVGEdit} t The `this` value -* @param {JSON} data +* @param {PlainObject} data +* @param {JSON} data.result +* @param {string} data.error +* @param {Integer} data.id * @returns {void} */ function addCallback (t, {result, error, id: callbackID}) { diff --git a/editor/extensions/ext-webappfind.js b/editor/extensions/ext-webappfind.js index c34bdf0f..4eb86c08 100644 --- a/editor/extensions/ext-webappfind.js +++ b/editor/extensions/ext-webappfind.js @@ -20,7 +20,9 @@ export default { 'message', /** * @param {external:Window} win - * @param {module:svgcanvas.SvgCanvas#event:message} data + * @param {PlainObject} info + * @param {module:svgcanvas.SvgCanvas#event:message} info.data + * @param {string} info.origin * @listens module:svgcanvas.SvgCanvas#event:message * @throws {Error} Unexpected event type * @returns {void} diff --git a/editor/utilities.js b/editor/utilities.js index 8ed1f01a..895c562e 100644 --- a/editor/utilities.js +++ b/editor/utilities.js @@ -1396,6 +1396,9 @@ export const isNullish = (val) => { * Overwrite methods for unit testing. * @function module:utilities.mock * @param {PlainObject} mockMethods +* @param {module:utilities.getHref} mockMethods.getHref +* @param {module:utilities.setHref} mockMethods.setHref +* @param {module:utilities.getRotationAngle} mockMethods.getRotationAngle * @returns {void} */ export const mock = ({