diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..e65801a7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,56 @@ +# .gitattributes snippet to force users to use same line endings for project. +# +# Handle line endings automatically for files detected as text +# and leave all files detected as binary untouched. +* text=auto + +# +# The above will handle all files NOT found below +# https://help.github.com/articles/dealing-with-line-endings/ +# https://github.com/Danimoth/gitattributes/blob/master/Web.gitattributes + + + +# These files are text and should be normalized (Convert crlf => lf) +*.php text +*.css text +*.scss text +*.js text +*.json text +*.htm text +*.html text +*.xml text +*.txt text +*.ini text +*.inc text +*.pl text +*.rb text +*.py text +*.scm text +*.sql text +.htaccess text +*.sh text +Dockerfile* text +*.yml text +*.yaml text +*.md text +*.markdown text + +# These files are binary and should be left untouched +# (binary is a macro for -text -diff) +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.mov binary +*.mp4 binary +*.mp3 binary +*.flv binary +*.fla binary +*.swf binary +*.gz binary +*.zip binary +*.7z binary +*.ttf binary +*.pyc binary \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 56d265b0..ede64780 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ _This release is scheduled to be released on 2023-07-01._ - Fix envcanada hourly forecast time (#3080) - Fix electron not running under windows after async changes (#3083) +- Fix style issues after eslint-plugin-jsdoc update ## [2.23.0] - 2023-04-04 diff --git a/clientonly/index.js b/clientonly/index.js index 1a0a7970..479d14bb 100644 --- a/clientonly/index.js +++ b/clientonly/index.js @@ -11,7 +11,6 @@ /** * Get command line parameters * Assumes that a cmdline parameter is defined with `--key [value]` - * * @param {string} key key to look for at the command line * @param {string} defaultValue value if no key is given at the command line * @returns {string} the value of the parameter @@ -33,7 +32,6 @@ /** * Gets the config from the specified server url - * * @param {string} url location where the server is running. * @returns {Promise} the config */ @@ -63,7 +61,6 @@ /** * Print a message to the console in case of errors - * * @param {string} message error message to print * @param {number} code error code for the exit call */ diff --git a/js/app.js b/js/app.js index 81aefd4f..fa0fb71a 100644 --- a/js/app.js +++ b/js/app.js @@ -44,7 +44,6 @@ process.on("uncaughtException", function (err) { /** * The core app. - * * @class */ function App() { @@ -53,7 +52,6 @@ function App() { /** * Loads the config file. Combines it with the defaults and returns the config - * * @async * @returns {Promise} the loaded config or the defaults if something goes wrong */ @@ -135,7 +133,6 @@ function App() { /** * Checks the config for deprecated options and throws a warning in the logs * if it encounters one option from the deprecated.js list - * * @param {object} userConfig The user config */ function checkDeprecatedOptions(userConfig) { @@ -150,7 +147,6 @@ function App() { /** * Loads a specific module. - * * @param {string} module The name of the module (including subpath). */ function loadModule(module) { @@ -204,7 +200,6 @@ function App() { /** * Loads all modules. - * * @param {Module[]} modules All modules to be loaded * @returns {Promise} A promise that is resolved when all modules been loaded */ @@ -220,7 +215,6 @@ function App() { /** * Compare two semantic version numbers and return the difference. - * * @param {string} a Version number a. * @param {string} b Version number b. * @returns {number} A positive number if a is larger than b, a negative @@ -246,7 +240,6 @@ function App() { * Start the core app. * * It loads the config, then it loads all modules. - * * @async * @returns {Promise} the config used */ @@ -301,7 +294,6 @@ function App() { * exists. * * Added to fix #1056 - * * @returns {Promise} A promise that is resolved when all node_helpers and * the http server has been closed */ diff --git a/js/check_config.js b/js/check_config.js index 24368734..22a10918 100644 --- a/js/check_config.js +++ b/js/check_config.js @@ -18,7 +18,6 @@ const Utils = require(`${rootPath}/js/utils.js`); /** * Returns a string with path of configuration file. * Check if set by environment variable MM_CONFIG_FILE - * * @returns {string} path and filename of the config file */ function getConfigFile() { diff --git a/js/class.js b/js/class.js index 339e24b2..4e769359 100644 --- a/js/class.js +++ b/js/class.js @@ -82,7 +82,6 @@ /** * Define the clone method for later use. Helper Method. - * * @param {object} obj Object to be cloned * @returns {object} the cloned object */ diff --git a/js/fetch.js b/js/fetch.js index 3ae874c8..b549d9ed 100644 --- a/js/fetch.js +++ b/js/fetch.js @@ -4,7 +4,6 @@ * * Attention: After some discussion we always return the third party * implementation until the node implementation is stable and more tested - * * @see https://github.com/MichMich/MagicMirror/pull/2952 * @see https://github.com/MichMich/MagicMirror/issues/2649 * @param {string} url to be fetched diff --git a/js/loader.js b/js/loader.js index 930d57c8..517999bb 100644 --- a/js/loader.js +++ b/js/loader.js @@ -52,7 +52,6 @@ const Loader = (function () { /** * Retrieve list of all modules. - * * @returns {object[]} module data as configured in config */ const getAllModules = function () { @@ -61,7 +60,6 @@ const Loader = (function () { /** * Generate array with module information including module paths. - * * @returns {object[]} Module information. */ const getModuleData = function () { @@ -103,7 +101,6 @@ const Loader = (function () { /** * Load modules via ajax request and create module objects. - * * @param {object} module Information about the module we want to load. * @returns {Promise} resolved when module is loaded */ @@ -131,7 +128,6 @@ const Loader = (function () { /** * Bootstrap modules by setting the module data and loading the scripts & styles. - * * @param {object} module Information about the module we want to load. * @param {Module} mObj Modules instance. */ @@ -153,7 +149,6 @@ const Loader = (function () { /** * Load a script or stylesheet by adding it to the dom. - * * @param {string} fileName Path of the file we want to load. * @returns {Promise} resolved when the file is loaded */ @@ -229,7 +224,6 @@ const Loader = (function () { /** * Load a file (script or stylesheet). * Prevent double loading and search for files in the vendor folder. - * * @param {string} fileName Path of the file we want to load. * @param {Module} module The module that calls the loadFile function. * @returns {Promise} resolved when the file is loaded diff --git a/js/main.js b/js/main.js index 4187663b..026410c7 100644 --- a/js/main.js +++ b/js/main.js @@ -68,7 +68,6 @@ const MM = (function () { /** * Select the wrapper dom object for a specific position. - * * @param {string} position The name of the position. * @returns {HTMLElement | void} the wrapper element */ @@ -85,7 +84,6 @@ const MM = (function () { /** * Send a notification to all modules. - * * @param {string} notification The identifier of the notification. * @param {*} payload The payload of the notification. * @param {Module} sender The module that sent the notification. @@ -102,7 +100,6 @@ const MM = (function () { /** * Update the dom for a specific module. - * * @param {Module} module The module that needs an update. * @param {number} [speed] The (optional) number of microseconds for the animation. * @returns {Promise} Resolved when the dom is fully updated. @@ -129,7 +126,6 @@ const MM = (function () { /** * Update the dom with the specified content - * * @param {Module} module The module that needs an update. * @param {number} [speed] The (optional) number of microseconds for the animation. * @param {string} newHeader The new header that is generated. @@ -167,7 +163,6 @@ const MM = (function () { /** * Check if the content has changed. - * * @param {Module} module The module to check. * @param {string} newHeader The new header that is generated. * @param {HTMLElement} newContent The new content that is generated. @@ -198,7 +193,6 @@ const MM = (function () { /** * Update the content of a module on screen. - * * @param {Module} module The module to check. * @param {string} newHeader The new header that is generated. * @param {HTMLElement} newContent The new content that is generated. @@ -224,7 +218,6 @@ const MM = (function () { /** * Hide the module. - * * @param {Module} module The module to hide. * @param {number} speed The speed of the hide animation. * @param {Function} callback Called when the animation is done. @@ -269,7 +262,6 @@ const MM = (function () { /** * Show the module. - * * @param {Module} module The module to show. * @param {number} speed The speed of the show animation. * @param {Function} callback Called when the animation is done. @@ -376,13 +368,11 @@ const MM = (function () { /** * Adds special selectors on a collection of modules. - * * @param {Module[]} modules Array of modules. */ const setSelectionMethodsForModules = function (modules) { /** * Filter modules with the specified classes. - * * @param {string|string[]} className one or multiple classnames (array or space divided). * @returns {Module[]} Filtered collection of modules. */ @@ -392,7 +382,6 @@ const MM = (function () { /** * Filter modules without the specified classes. - * * @param {string|string[]} className one or multiple classnames (array or space divided). * @returns {Module[]} Filtered collection of modules. */ @@ -402,7 +391,6 @@ const MM = (function () { /** * Filters a collection of modules based on classname(s). - * * @param {string|string[]} className one or multiple classnames (array or space divided). * @param {boolean} include if the filter should include or exclude the modules with the specific classes. * @returns {Module[]} Filtered collection of modules. @@ -431,7 +419,6 @@ const MM = (function () { /** * Removes a module instance from the collection. - * * @param {object} module The module instance to remove from the collection. * @returns {Module[]} Filtered collection of modules. */ @@ -446,7 +433,6 @@ const MM = (function () { /** * Walks thru a collection of modules and executes the callback with the module as an argument. - * * @param {Function} callback The function to execute with the module as an argument. */ const enumerate = function (callback) { @@ -487,7 +473,6 @@ const MM = (function () { /** * Gets called when all modules are started. - * * @param {Module[]} moduleObjects All module instances. */ modulesStarted: function (moduleObjects) { @@ -502,7 +487,6 @@ const MM = (function () { /** * Send a notification to all modules. - * * @param {string} notification The identifier of the notification. * @param {*} payload The payload of the notification. * @param {Module} sender The module that sent the notification. @@ -529,7 +513,6 @@ const MM = (function () { /** * Update the dom for a specific module. - * * @param {Module} module The module that needs an update. * @param {number} [speed] The number of microseconds for the animation. */ @@ -550,7 +533,6 @@ const MM = (function () { /** * Returns a collection of all modules currently active. - * * @returns {Module[]} A collection of all modules currently active. */ getModules: function () { @@ -560,7 +542,6 @@ const MM = (function () { /** * Hide the module. - * * @param {Module} module The module to hide. * @param {number} speed The speed of the hide animation. * @param {Function} callback Called when the animation is done. @@ -573,7 +554,6 @@ const MM = (function () { /** * Show the module. - * * @param {Module} module The module to show. * @param {number} speed The speed of the show animation. * @param {Function} callback Called when the animation is done. diff --git a/js/module.js b/js/module.js index e0205599..110ccc55 100644 --- a/js/module.js +++ b/js/module.js @@ -46,7 +46,6 @@ const Module = Class.extend({ /** * Returns a list of scripts the module requires to be loaded. - * * @returns {string[]} An array with filenames. */ getScripts: function () { @@ -55,7 +54,6 @@ const Module = Class.extend({ /** * Returns a list of stylesheets the module requires to be loaded. - * * @returns {string[]} An array with filenames. */ getStyles: function () { @@ -66,7 +64,6 @@ const Module = Class.extend({ * Returns a map of translation files the module requires to be loaded. * * return Map - - * * @returns {*} A map with langKeys and filenames. */ getTranslations: function () { @@ -77,7 +74,6 @@ const Module = Class.extend({ * Generates the dom which needs to be displayed. This method is called by the MagicMirror² core. * This method can to be subclassed if the module wants to display info on the mirror. * Alternatively, the getTemplate method could be subclassed. - * * @returns {HTMLElement|Promise} The dom or a promise with the dom to display. */ getDom: function () { @@ -111,7 +107,6 @@ const Module = Class.extend({ * Generates the header string which needs to be displayed if a user has a header configured for this module. * This method is called by the MagicMirror² core, but only if the user has configured a default header for the module. * This method needs to be subclassed if the module wants to display modified headers on the mirror. - * * @returns {string} The header to display above the header. */ getHeader: function () { @@ -123,7 +118,6 @@ const Module = Class.extend({ * This method needs to be subclassed if the module wants to use a template. * It can either return a template sting, or a template filename. * If the string ends with '.html' it's considered a file from within the module's folder. - * * @returns {string} The template string of filename. */ getTemplate: function () { @@ -133,7 +127,6 @@ const Module = Class.extend({ /** * Returns the data to be used in the template. * This method needs to be subclassed if the module wants to use a custom data. - * * @returns {object} The data for the template */ getTemplateData: function () { @@ -142,7 +135,6 @@ const Module = Class.extend({ /** * Called by the MagicMirror² core when a notification arrives. - * * @param {string} notification The identifier of the notification. * @param {*} payload The payload of the notification. * @param {Module} sender The module that sent the notification. @@ -158,7 +150,6 @@ const Module = Class.extend({ /** * Returns the nunjucks environment for the current module. * The environment is checked in the _nunjucksEnvironment instance variable. - * * @returns {object} The Nunjucks Environment */ nunjucksEnvironment: function () { @@ -180,7 +171,6 @@ const Module = Class.extend({ /** * Called when a socket notification arrives. - * * @param {string} notification The identifier of the notification. * @param {*} payload The payload of the notification. */ @@ -208,7 +198,6 @@ const Module = Class.extend({ /** * Set the module data. - * * @param {object} data The module data */ setData: function (data) { @@ -222,7 +211,6 @@ const Module = Class.extend({ /** * Set the module config and combine it with the module defaults. - * * @param {object} config The combined module config. * @param {boolean} deep Merge module config in deep. */ @@ -233,7 +221,6 @@ const Module = Class.extend({ /** * Returns a socket object. If it doesn't exist, it's created. * It also registers the notification callback. - * * @returns {MMSocket} a socket object */ socket: function () { @@ -250,7 +237,6 @@ const Module = Class.extend({ /** * Retrieve the path to a module file. - * * @param {string} file Filename * @returns {string} the file path */ @@ -260,7 +246,6 @@ const Module = Class.extend({ /** * Load all required stylesheets by requesting the MM object to load the files. - * * @returns {Promise} */ loadStyles: function () { @@ -269,7 +254,6 @@ const Module = Class.extend({ /** * Load all required scripts by requesting the MM object to load the files. - * * @returns {Promise} */ loadScripts: function () { @@ -278,7 +262,6 @@ const Module = Class.extend({ /** * Helper method to load all dependencies. - * * @param {string} funcName Function name to call to get scripts or styles. * @returns {Promise} */ @@ -301,6 +284,7 @@ const Module = Class.extend({ /** * Load all translations. + * @returns {Promise} */ loadTranslations: async function () { const translations = this.getTranslations() || {}; @@ -329,7 +313,6 @@ const Module = Class.extend({ /** * Request the translation for a given key with optional variables and default value. - * * @param {string} key The key of the string to translate * @param {string|object} [defaultValueOrVariables] The default value or variables for translating. * @param {string} [defaultValue] The default value with variables. @@ -344,7 +327,6 @@ const Module = Class.extend({ /** * Request an (animated) update of the module. - * * @param {number} [speed] The speed of the animation. */ updateDom: function (speed) { @@ -353,7 +335,6 @@ const Module = Class.extend({ /** * Send a notification to all modules. - * * @param {string} notification The identifier of the notification. * @param {*} payload The payload of the notification. */ @@ -363,7 +344,6 @@ const Module = Class.extend({ /** * Send a socket notification to the node helper. - * * @param {string} notification The identifier of the notification. * @param {*} payload The payload of the notification. */ @@ -373,7 +353,6 @@ const Module = Class.extend({ /** * Hide this module. - * * @param {number} speed The speed of the hide animation. * @param {Function} callback Called when the animation is done. * @param {object} [options] Optional settings for the hide method. @@ -401,7 +380,6 @@ const Module = Class.extend({ /** * Show this module. - * * @param {number} speed The speed of the show animation. * @param {Function} callback Called when the animation is done. * @param {object} [options] Optional settings for the show method. @@ -447,7 +425,6 @@ const Module = Class.extend({ * ------- * * Todo: idea of Mich determinate what do you want to merge or not - * * @param {object} result the initial object * @returns {object} the merged config */ @@ -509,7 +486,6 @@ window.Module = Module; /** * Compare two semantic version numbers and return the difference. - * * @param {string} a Version number a. * @param {string} b Version number b. * @returns {number} A positive number if a is larger than b, a negative diff --git a/js/node_helper.js b/js/node_helper.js index 03c6dca7..c555eb72 100644 --- a/js/node_helper.js +++ b/js/node_helper.js @@ -32,7 +32,6 @@ const NodeHelper = Class.extend({ /** * This method is called when a socket notification arrives. - * * @param {string} notification The identifier of the notification. * @param {*} payload The payload of the notification. */ @@ -42,7 +41,6 @@ const NodeHelper = Class.extend({ /** * Set the module name. - * * @param {string} name Module name. */ setName(name) { @@ -51,7 +49,6 @@ const NodeHelper = Class.extend({ /** * Set the module path. - * * @param {string} path Module path. */ setPath(path) { @@ -123,7 +120,6 @@ NodeHelper.checkFetchStatus = function (response) { /** * Look at the specified error and return an appropriate error type, that * can be translated to a detailed error message - * * @param {Error} error the error from fetching something * @returns {string} the string of the detailed error message in the translations */ diff --git a/js/server.js b/js/server.js index 14546217..771870f2 100644 --- a/js/server.js +++ b/js/server.js @@ -19,7 +19,6 @@ const { cors, getConfig, getHtml, getVersion } = require("./server_functions"); /** * Server - * * @param {object} config The MM config * @class */ @@ -31,7 +30,6 @@ function Server(config) { /** * Opens the server for incoming connections - * * @returns {Promise} A promise that is resolved when the server listens to connections */ this.open = function () { @@ -106,7 +104,6 @@ function Server(config) { /** * Closes the server and destroys all lingering connections to it. - * * @returns {Promise} A promise that resolves when server has successfully shut down */ this.close = function () { diff --git a/js/server_functions.js b/js/server_functions.js index 6ecc6cae..8e9d9aa9 100644 --- a/js/server_functions.js +++ b/js/server_functions.js @@ -5,7 +5,6 @@ const fetch = require("./fetch"); /** * Gets the config. - * * @param {Request} req - the request * @param {Response} res - the result */ @@ -19,7 +18,6 @@ function getConfig(req, res) { * Example input request url: /cors?sendheaders=header1:value1,header2:value2&expectedheaders=header1,header2&url=http://www.test.com/path?param1=value1 * * Only the url-param of the input request url is required. It must be the last parameter. - * * @param {Request} req - the request * @param {Response} res - the result */ @@ -57,7 +55,6 @@ async function cors(req, res) { /** * Gets headers and values to attach to the web request. - * * @param {string} url - The url containing the headers and values to send. * @returns {object} An object specifying name and value of the headers. */ @@ -79,7 +76,6 @@ function getHeadersToSend(url) { /** * Gets the headers expected from the response. - * * @param {string} url - The url containing the expected headers from the response. * @returns {string[]} headers - The name of the expected headers. */ @@ -97,7 +93,6 @@ function geExpectedRecievedHeaders(url) { /** * Gets the HTML to display the magic mirror. - * * @param {Request} req - the request * @param {Response} res - the result */ @@ -116,7 +111,6 @@ function getHtml(req, res) { /** * Gets the MagicMirror version. - * * @param {Request} req - the request * @param {Response} res - the result */ diff --git a/js/translator.js b/js/translator.js index 07dc20b6..2ebb0580 100644 --- a/js/translator.js +++ b/js/translator.js @@ -9,7 +9,6 @@ const Translator = (function () { /** * Load a JSON file via XHR. - * * @param {string} file Path of the file we want to load. * @returns {Promise} the translations in the specified file */ @@ -43,7 +42,6 @@ const Translator = (function () { /** * Load a translation for a given key for a given module. - * * @param {Module} module The module to load the translation for. * @param {string} key The key of the text to translate. * @param {object} variables The variables to use within the translation template (optional) @@ -55,7 +53,6 @@ const Translator = (function () { * template: "Please wait for {timeToWait} before continuing with {work}." * variables: {timeToWait: "2 hours", work: "painting"} * to: "Please wait for 2 hours before continuing with painting." - * * @param {string} template Text with placeholder * @param {object} variables Variables for the placeholder * @returns {string} the template filled with the variables @@ -98,7 +95,6 @@ const Translator = (function () { /** * Load a translation file (json) and remember the data. - * * @param {Module} module The module to load the translation file for. * @param {string} file Path of the file we want to load. * @param {boolean} isFallback Flag to indicate fallback translations. @@ -117,7 +113,6 @@ const Translator = (function () { /** * Load the core translations. - * * @param {string} lang The language identifier of the core language. */ loadCoreTranslations: async function (lang) { diff --git a/modules/default/alert/notificationFx.js b/modules/default/alert/notificationFx.js index 8f8a84cc..5a7426e9 100644 --- a/modules/default/alert/notificationFx.js +++ b/modules/default/alert/notificationFx.js @@ -9,13 +9,11 @@ * * Copyright 2014, Codrops * https://tympanus.net/codrops/ - * * @param {object} window The window object */ (function (window) { /** * Extend one object with another one - * * @param {object} a The object to extend * @param {object} b The object which extends the other, overwrites existing keys * @returns {object} The merged object @@ -31,7 +29,6 @@ /** * NotificationFx constructor - * * @param {object} options The configuration options * @class */ @@ -124,7 +121,6 @@ /** * Dismiss the notification - * * @param {boolean} [close] call the onClose callback at the end */ NotificationFx.prototype.dismiss = function (close = true) { diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index f78df757..250c635c 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -524,7 +524,6 @@ Module.register("calendar", { /** * Checks if this config contains the calendar url. - * * @param {string} url The calendar url * @returns {boolean} True if the calendar config contains the url, False otherwise */ @@ -540,7 +539,6 @@ Module.register("calendar", { /** * Creates the sorted list of all events. - * * @param {boolean} limitNumberOfEntries Whether to filter returned events for display. * @returns {object[]} Array with events. */ @@ -673,7 +671,6 @@ Module.register("calendar", { /** * Requests node helper to add calendar url. - * * @param {string} url The calendar url to add * @param {object} auth The authentication method and credentials * @param {object} calendarConfig The config of the specific calendar @@ -698,7 +695,6 @@ Module.register("calendar", { /** * Retrieves the symbols for a specific event. - * * @param {object} event Event to look for. * @returns {string[]} The symbols */ @@ -739,7 +735,6 @@ Module.register("calendar", { /** * Retrieves the symbolClass for a specific calendar url. - * * @param {string} url The calendar url * @returns {string} The class to be used for the symbols of the calendar */ @@ -749,7 +744,6 @@ Module.register("calendar", { /** * Retrieves the titleClass for a specific calendar url. - * * @param {string} url The calendar url * @returns {string} The class to be used for the title of the calendar */ @@ -759,7 +753,6 @@ Module.register("calendar", { /** * Retrieves the timeClass for a specific calendar url. - * * @param {string} url The calendar url * @returns {string} The class to be used for the time of the calendar */ @@ -769,7 +762,6 @@ Module.register("calendar", { /** * Retrieves the calendar name for a specific calendar url. - * * @param {string} url The calendar url * @returns {string} The name of the calendar */ @@ -779,7 +771,6 @@ Module.register("calendar", { /** * Retrieves the color for a specific calendar url. - * * @param {string} url The calendar url * @param {boolean} isBg Determines if we fetch the bgColor or not * @returns {string} The color @@ -790,7 +781,6 @@ Module.register("calendar", { /** * Retrieves the count title for a specific calendar url. - * * @param {string} url The calendar url * @returns {string} The title */ @@ -800,7 +790,6 @@ Module.register("calendar", { /** * Retrieves the maximum entry count for a specific calendar url. - * * @param {string} url The calendar url * @returns {number} The maximum entry count */ @@ -810,7 +799,6 @@ Module.register("calendar", { /** * Retrieves the maximum count of past days which events of should be displayed for a specific calendar url. - * * @param {string} url The calendar url * @returns {number} The maximum past days count */ @@ -820,7 +808,6 @@ Module.register("calendar", { /** * Helper method to retrieve the property for a specific calendar url. - * * @param {string} url The calendar url * @param {string} property The property to look for * @param {string} defaultValue The value if the property is not found diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index 3c7629e1..c7b62960 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -121,7 +121,6 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn /** * Sets the on success callback - * * @param {Function} callback The on success callback. */ this.onReceive = function (callback) { @@ -130,7 +129,6 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn /** * Sets the on error callback - * * @param {Function} callback The on error callback. */ this.onError = function (callback) { @@ -139,7 +137,6 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn /** * Returns the url of this fetcher. - * * @returns {string} The url of this fetcher. */ this.url = function () { @@ -148,7 +145,6 @@ const CalendarFetcher = function (url, reloadInterval, excludedEvents, maximumEn /** * Returns current available events for this fetcher. - * * @returns {object[]} The current available events for this fetcher. */ this.events = function () { diff --git a/modules/default/calendar/calendarfetcherutils.js b/modules/default/calendar/calendarfetcherutils.js index 0da061e8..539d80b1 100644 --- a/modules/default/calendar/calendarfetcherutils.js +++ b/modules/default/calendar/calendarfetcherutils.js @@ -17,7 +17,6 @@ const CalendarFetcherUtils = { /** * Calculate the time correction, either dst/std or full day in cases where * utc time is day before plus offset - * * @param {object} event the event which needs adjustment * @param {Date} date the date on which this event happens * @returns {number} the necessary adjustment in hours @@ -119,7 +118,6 @@ const CalendarFetcherUtils = { /** * Filter the events from ical according to the given config - * * @param {object} data the calendar data from ical * @param {object} config The configuration object * @returns {string[]} the filtered events @@ -511,7 +509,6 @@ const CalendarFetcherUtils = { /** * Lookup iana tz from windows - * * @param {string} msTZName the timezone name to lookup * @returns {string|null} the iana name or null of none is found */ @@ -524,7 +521,6 @@ const CalendarFetcherUtils = { /** * Gets the title from the event. - * * @param {object} event The event object to check. * @returns {string} The title of the event, or "Event" if no title is found. */ @@ -541,7 +537,6 @@ const CalendarFetcherUtils = { /** * Checks if an event is a fullday event. - * * @param {object} event The event object to check. * @returns {boolean} True if the event is a fullday event, false otherwise */ @@ -563,7 +558,6 @@ const CalendarFetcherUtils = { /** * Determines if the user defined time filter should apply - * * @param {Date} now Date object using previously created object for consistency * @param {Moment} endDate Moment object representing the event end date * @param {string} filter The time to subtract from the end date to determine if an event should be shown @@ -584,7 +578,6 @@ const CalendarFetcherUtils = { /** * Determines if the user defined title filter should apply - * * @param {string} title the title of the event * @param {string} filter the string to look for, can be a regex also * @param {boolean} useRegex true if a regex should be used, otherwise it just looks for the filter as a string diff --git a/modules/default/calendar/calendarutils.js b/modules/default/calendar/calendarutils.js index e3125f76..e953b635 100644 --- a/modules/default/calendar/calendarutils.js +++ b/modules/default/calendar/calendarutils.js @@ -7,7 +7,6 @@ const CalendarUtils = { /** * Capitalize the first letter of a string - * * @param {string} string The string to capitalize * @returns {string} The capitalized string */ @@ -19,7 +18,6 @@ const CalendarUtils = { * This function accepts a number (either 12 or 24) and returns a moment.js LocaleSpecification with the * corresponding time-format to be used in the calendar display. If no number is given (or otherwise invalid input) * it will a localeSpecification object with the system locale time format. - * * @param {number} timeFormat Specifies either 12 or 24-hour time format * @returns {moment.LocaleSpecification} formatted time */ @@ -39,7 +37,6 @@ const CalendarUtils = { /** * Shortens a string if it's longer than maxLength and add an ellipsis to the end - * * @param {string} string Text string to shorten * @param {number} maxLength The max length of the string * @param {boolean} wrapEvents Wrap the text after the line has reached maxLength @@ -94,7 +91,6 @@ const CalendarUtils = { * Transforms the title of an event for usage. * Replaces parts of the text as defined in config.titleReplace. * Shortens title based on config.maxTitleLength and config.wrapEvents - * * @param {string} title The title to transform. * @param {object} titleReplace Pairs of strings to be replaced in the title * @returns {string} The transformed title. diff --git a/modules/default/calendar/node_helper.js b/modules/default/calendar/node_helper.js index 08e6158b..05d4d457 100644 --- a/modules/default/calendar/node_helper.js +++ b/modules/default/calendar/node_helper.js @@ -33,7 +33,6 @@ module.exports = NodeHelper.create({ /** * Creates a fetcher for a new url if it doesn't exist yet. * Otherwise it reuses the existing one. - * * @param {string} url The url of the calendar * @param {number} fetchInterval How often does the calendar needs to be fetched in ms * @param {string[]} excludedEvents An array of words / phrases from event titles that will be excluded from being shown. diff --git a/modules/default/compliments/compliments.js b/modules/default/compliments/compliments.js index 555bfc46..a905581b 100644 --- a/modules/default/compliments/compliments.js +++ b/modules/default/compliments/compliments.js @@ -52,7 +52,6 @@ Module.register("compliments", { /** * Generate a random index for a list of compliments. - * * @param {string[]} compliments Array with compliments. * @returns {number} a random index of given array */ @@ -78,7 +77,6 @@ Module.register("compliments", { /** * Retrieve an array of compliments for the time of the day. - * * @returns {string[]} array with compliments for the time of the day. */ complimentArray: function () { @@ -115,7 +113,6 @@ Module.register("compliments", { /** * Retrieve a file from the local filesystem - * * @returns {Promise} Resolved when the file is loaded */ loadComplimentFile: async function () { @@ -127,7 +124,6 @@ Module.register("compliments", { /** * Retrieve a random compliment. - * * @returns {string} a compliment */ getRandomCompliment: function () { diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js index 320c5a5d..eee0b44a 100644 --- a/modules/default/newsfeed/newsfeed.js +++ b/modules/default/newsfeed/newsfeed.js @@ -179,7 +179,6 @@ Module.register("newsfeed", { /** * Generate an ordered list of items for this configured module. - * * @param {object} feeds An object with feeds returned by the node helper. */ generateFeed: function (feeds) { @@ -272,7 +271,6 @@ Module.register("newsfeed", { /** * Check if this module is configured to show this feed. - * * @param {string} feedUrl Url of the feed to check. * @returns {boolean} True if it is subscribed, false otherwise */ @@ -287,7 +285,6 @@ Module.register("newsfeed", { /** * Returns title for the specific feed url. - * * @param {string} feedUrl Url of the feed * @returns {string} The title of the feed */ diff --git a/modules/default/newsfeed/newsfeedfetcher.js b/modules/default/newsfeed/newsfeedfetcher.js index be2b9041..51d38f83 100644 --- a/modules/default/newsfeed/newsfeedfetcher.js +++ b/modules/default/newsfeed/newsfeedfetcher.js @@ -14,7 +14,6 @@ const NodeHelper = require("node_helper"); /** * Responsible for requesting an update on the set interval and broadcasting the data. - * * @param {string} url URL of the news feed. * @param {number} reloadInterval Reload interval in milliseconds. * @param {string} encoding Encoding of the feed. @@ -137,7 +136,6 @@ const NewsfeedFetcher = function (url, reloadInterval, encoding, logFeedWarnings /** * Update the reload interval, but only if we need to increase the speed. - * * @param {number} interval Interval for the update in milliseconds. */ this.setReloadInterval = function (interval) { diff --git a/modules/default/newsfeed/node_helper.js b/modules/default/newsfeed/node_helper.js index 534b7020..64ba5929 100644 --- a/modules/default/newsfeed/node_helper.js +++ b/modules/default/newsfeed/node_helper.js @@ -26,7 +26,6 @@ module.exports = NodeHelper.create({ /** * Creates a fetcher for a new feed if it doesn't exist yet. * Otherwise it reuses the existing one. - * * @param {object} feed The feed object * @param {object} config The configuration object */ diff --git a/modules/default/utils.js b/modules/default/utils.js index 74e48c37..e60d96ea 100644 --- a/modules/default/utils.js +++ b/modules/default/utils.js @@ -1,6 +1,5 @@ /** * A function to make HTTP requests via the server to avoid CORS-errors. - * * @param {string} url the url to fetch from * @param {string} type what contenttype to expect in the response, can be "json" or "xml" * @param {boolean} useCorsProxy A flag to indicate @@ -35,7 +34,6 @@ async function performWebRequest(url, type = "json", useCorsProxy = false, reque /** * Gets a URL that will be used when calling the CORS-method on the server. - * * @param {string} url the url to fetch from * @param {Array.<{name: string, value:string}>} requestHeaders the HTTP headers to send * @param {Array.} expectedResponseHeaders the expected HTTP headers to receive @@ -66,7 +64,6 @@ const getCorsUrl = function (url, requestHeaders, expectedResponseHeaders) { /** * Gets the part of the CORS URL that represents the HTTP headers to send. - * * @param {Array.<{name: string, value:string}>} requestHeaders the HTTP headers to send * @returns {string} to be used as request-headers component in CORS URL. */ @@ -87,7 +84,6 @@ const getRequestHeaderString = function (requestHeaders) { /** * Gets headers and values to attach to the web request. - * * @param {Array.<{name: string, value:string}>} requestHeaders the HTTP headers to send * @returns {object} An object specifying name and value of the headers. */ @@ -104,7 +100,6 @@ const getHeadersToSend = (requestHeaders) => { /** * Gets the part of the CORS URL that represents the expected HTTP headers to receive. - * * @param {Array.} expectedResponseHeaders the expected HTTP headers to receive * @returns {string} to be used as the expected HTTP-headers component in CORS URL. */ @@ -125,7 +120,6 @@ const getExpectedResponseHeadersString = function (expectedResponseHeaders) { /** * Gets the values for the expected headers from the response. - * * @param {Array.} expectedResponseHeaders the expected HTTP headers to receive * @param {Response} response the HTTP response * @returns {string} to be used as the expected HTTP-headers component in CORS URL. @@ -145,7 +139,6 @@ const getHeadersFromResponse = (expectedResponseHeaders, response) => { /** * Format the time according to the config - * * @param {object} config The config of the module * @param {object} time time to format * @returns {string} The formatted time string diff --git a/modules/default/weather/providers/openmeteo.js b/modules/default/weather/providers/openmeteo.js index 9d95aea1..688e1f54 100644 --- a/modules/default/weather/providers/openmeteo.js +++ b/modules/default/weather/providers/openmeteo.js @@ -194,7 +194,6 @@ WeatherProvider.register("openmeteo", { /** * Overrides method for setting config to check if endpoint is correct for hourly - * * @param {object} config The configuration object */ setConfig(config) { diff --git a/modules/default/weather/providers/openweathermap.js b/modules/default/weather/providers/openweathermap.js index d1bd378c..d0ed5180 100644 --- a/modules/default/weather/providers/openweathermap.js +++ b/modules/default/weather/providers/openweathermap.js @@ -90,7 +90,6 @@ WeatherProvider.register("openweathermap", { /** * Overrides method for setting config to check if endpoint is correct for hourly - * * @param {object} config The configuration object */ setConfig(config) { diff --git a/modules/default/weather/providers/smhi.js b/modules/default/weather/providers/smhi.js index 0115bcf5..0cdd85f1 100644 --- a/modules/default/weather/providers/smhi.js +++ b/modules/default/weather/providers/smhi.js @@ -69,7 +69,6 @@ WeatherProvider.register("smhi", { /** * Overrides method for setting config with checks for the precipitationValue being unset or invalid - * * @param {object} config The configuration object */ setConfig(config) { @@ -82,7 +81,6 @@ WeatherProvider.register("smhi", { /** * Of all the times returned find out which one is closest to the current time, should be the first if the data isn't old. - * * @param {object[]} times Array of time objects * @returns {object} The weatherdata closest to the current time */ @@ -100,7 +98,6 @@ WeatherProvider.register("smhi", { /** * Get the forecast url for the configured coordinates - * * @returns {string} the url for the specified coordinates */ getURL() { @@ -115,7 +112,6 @@ WeatherProvider.register("smhi", { /** * Calculates the apparent temperature based on known atmospheric data. - * * @param {object} weatherData Weatherdata to use for the calculation * @returns {number} The apparent temperature */ @@ -132,7 +128,6 @@ WeatherProvider.register("smhi", { * Converts the returned data into a WeatherObject with required properties set for both current weather and forecast. * The returned units is always in metric system. * Requires coordinates to determine if its daytime or nighttime to know which icon to use and also to set sunrise and sunset. - * * @param {object} weatherData Weatherdata to convert * @param {object} coordinates Coordinates of the locations of the weather * @returns {WeatherObject} The converted weatherdata at the specified location @@ -178,7 +173,6 @@ WeatherProvider.register("smhi", { /** * Takes all the data points and converts it to one WeatherObject per day. - * * @param {object[]} allWeatherData Array of weatherdata * @param {object} coordinates Coordinates of the locations of the weather * @param {string} groupBy The interval to use for grouping the data (day, hour) @@ -230,7 +224,6 @@ WeatherProvider.register("smhi", { /** * Resolve coordinates from the response data (probably preferably to use * this if it's not matching the config values exactly) - * * @param {object} data Response data from the weather service * @returns {{lon, lat}} the lat/long coordinates of the data */ @@ -241,7 +234,6 @@ WeatherProvider.register("smhi", { /** * The distance between the data points is increasing in the data the more distant the prediction is. * Find these gaps and fill them with the previous hours data to make the data returned a complete set. - * * @param {object[]} data Response data from the weather service * @returns {object[]} Given data with filled gaps */ @@ -263,7 +255,6 @@ WeatherProvider.register("smhi", { /** * Helper method to get a property from the returned data set. - * * @param {object} currentWeatherData Weatherdata to get from * @param {string} name The name of the property * @returns {*} The value of the property in the weatherdata @@ -276,7 +267,6 @@ WeatherProvider.register("smhi", { * Map the icon value from SMHI to an icon that MagicMirror² understands. * Uses different icons depending on if its daytime or nighttime. * SMHI's description of what the numeric value means is the comment after the case. - * * @param {number} input The SMHI icon value * @param {boolean} isDayTime True if the icon should be for daytime, false for nighttime * @returns {string} The icon name for the MagicMirror diff --git a/modules/default/weather/providers/ukmetoffice.js b/modules/default/weather/providers/ukmetoffice.js index 8f03cbe6..49c7d80c 100644 --- a/modules/default/weather/providers/ukmetoffice.js +++ b/modules/default/weather/providers/ukmetoffice.js @@ -189,7 +189,6 @@ WeatherProvider.register("ukmetoffice", { /** * Generates an url with api parameters based on the config. - * * @param {string} forecastType daily or 3hourly forecast * @returns {string} url */ diff --git a/modules/default/weather/providers/weatherbit.js b/modules/default/weather/providers/weatherbit.js index 7d0468bc..298d23ba 100644 --- a/modules/default/weather/providers/weatherbit.js +++ b/modules/default/weather/providers/weatherbit.js @@ -65,7 +65,6 @@ WeatherProvider.register("weatherbit", { /** * Overrides method for setting config to check if endpoint is correct for hourly - * * @param {object} config The configuration object */ setConfig(config) { diff --git a/modules/default/weather/weatherobject.js b/modules/default/weather/weatherobject.js index 565061da..9fae8873 100644 --- a/modules/default/weather/weatherobject.js +++ b/modules/default/weather/weatherobject.js @@ -75,7 +75,6 @@ class WeatherObject { /** * Determines if the sun sets or rises next. Uses the current time and not * the date from the weather-forecast. - * * @param {Moment} date an optional date where you want to get the next * action for. Useful only in tests, defaults to the current time. * @returns {string} "sunset" or "sunrise" @@ -93,7 +92,6 @@ class WeatherObject { /** * Checks if the weatherObject is at dayTime. - * * @returns {boolean} true if it is at dayTime */ isDayTime() { @@ -105,7 +103,6 @@ class WeatherObject { * Update the sunrise / sunset time depending on the location. This can be * used if your provider doesn't provide that data by itself. Then SunCalc * is used here to calculate them according to the location. - * * @param {number} lat latitude * @param {number} lon longitude */ @@ -121,7 +118,6 @@ class WeatherObject { * * Before being handed to other modules, mutable values must be cloned safely. * Especially 'moment' object is not immutable, so original 'date', 'sunrise', 'sunset' could be corrupted or changed by other modules. - * * @returns {object} plained object clone of original weatherObject */ simpleClone() { diff --git a/modules/default/weather/weatherprovider.js b/modules/default/weather/weatherprovider.js index 43762eae..662f87be 100644 --- a/modules/default/weather/weatherprovider.js +++ b/modules/default/weather/weatherprovider.js @@ -113,7 +113,6 @@ const WeatherProvider = Class.extend({ /** * A convenience function to make requests. - * * @param {string} url the url to fetch from * @param {string} type what contenttype to expect in the response, can be "json" or "xml" * @param {Array.<{name: string, value:string}>} requestHeaders the HTTP headers to send @@ -138,7 +137,6 @@ WeatherProvider.providers = []; /** * Static method to register a new weather provider. - * * @param {string} providerIdentifier The name of the weather provider * @param {object} providerDetails The details of the weather provider */ @@ -148,7 +146,6 @@ WeatherProvider.register = function (providerIdentifier, providerDetails) { /** * Static method to initialize a new weather provider. - * * @param {string} providerIdentifier The name of the weather provider * @param {object} delegate The weather module * @returns {object} The new weather provider diff --git a/modules/default/weather/weatherutils.js b/modules/default/weather/weatherutils.js index 50a9c7aa..585b44d2 100644 --- a/modules/default/weather/weatherutils.js +++ b/modules/default/weather/weatherutils.js @@ -7,7 +7,6 @@ const WeatherUtils = { /** * Convert wind (from m/s) to beaufort scale - * * @param {number} speedInMS the windspeed you want to convert * @returns {number} the speed in beaufort */ @@ -25,7 +24,6 @@ const WeatherUtils = { /** * Convert a value in a given unit to a string with a converted * value and a postfix matching the output unit system. - * * @param {number} value - The value to convert. * @param {string} valueUnit - The unit the values has. Default is mm. * @param {string} outputUnit - The unit system (imperial/metric) the return value should have. @@ -50,7 +48,6 @@ const WeatherUtils = { /** * Convert temp (from degrees C) into imperial or metric unit depending on * your config - * * @param {number} tempInC the temperature in celsius you want to convert * @param {string} unit can be 'imperial' or 'metric' * @returns {number} the converted temperature @@ -61,7 +58,6 @@ const WeatherUtils = { /** * Convert wind speed into another unit. - * * @param {number} windInMS the windspeed in meter/sec you want to convert * @param {string} unit can be 'beaufort', 'kmh', 'knots, 'imperial' (mph) * or 'metric' (mps) diff --git a/tests/e2e/helpers/mock-console.js b/tests/e2e/helpers/mock-console.js index 41294fad..f87be964 100644 --- a/tests/e2e/helpers/mock-console.js +++ b/tests/e2e/helpers/mock-console.js @@ -1,6 +1,5 @@ /** * Suppresses errors concerning web server already shut down. - * * @param {string} err The error message. */ const mockError = (err) => { diff --git a/tests/e2e/modules/compliments_spec.js b/tests/e2e/modules/compliments_spec.js index c4fcf686..97c044f3 100644 --- a/tests/e2e/modules/compliments_spec.js +++ b/tests/e2e/modules/compliments_spec.js @@ -3,7 +3,6 @@ const helpers = require("../helpers/global-setup"); describe("Compliments module", () => { /** * move similar tests in function doTest - * * @param {Array} complimentsArray The array of compliments. */ const doTest = async (complimentsArray) => { diff --git a/tests/electron/modules/calendar_spec.js b/tests/electron/modules/calendar_spec.js index cacc550d..b0b7c276 100644 --- a/tests/electron/modules/calendar_spec.js +++ b/tests/electron/modules/calendar_spec.js @@ -3,7 +3,6 @@ const helpers = require("../helpers/global-setup"); describe("Calendar module", () => { /** * move similar tests in function doTest - * * @param {string} cssClass css selector */ const doTest = async (cssClass) => { diff --git a/tests/electron/modules/compliments_spec.js b/tests/electron/modules/compliments_spec.js index 60a8b639..a6dd384e 100644 --- a/tests/electron/modules/compliments_spec.js +++ b/tests/electron/modules/compliments_spec.js @@ -3,7 +3,6 @@ const helpers = require("../helpers/global-setup"); describe("Compliments module", () => { /** * move similar tests in function doTest - * * @param {Array} complimentsArray The array of compliments. */ const doTest = async (complimentsArray) => {