[linter] Re-activate JSDoc linting and fix linting issues

This commit is contained in:
Kristjan ESPERANTO
2025-05-10 23:21:13 +02:00
parent a3d2064bb7
commit fed4c86c7f
6 changed files with 25 additions and 19 deletions

View File

@@ -502,10 +502,10 @@ const CalendarFetcherUtils = {
},
/**
* fixup thew event fields that have dates to use local time
* BEFORE calling rrule.between
* @param the event being processed
* @returns nothing
* Fixes the event fields that have dates to use local time
* before calling rrule.between.
* @param {object} event - The event being processed.
* @returns {void}
*/
fixEventtoLocal (event) {
// if there are excluded dates, their date is incorrect and possibly key as well.
@@ -542,9 +542,9 @@ const CalendarFetcherUtils = {
/**
* convert a UTC date to local time
* BEFORE calling rrule.between
* @param date ti conert
* tz event is currently in
* @returns updated date object
* @param {Date} date The date to convert
* @param {string} tz The timezone string to convert the date to.
* @returns {Date} updated date object
*/
convertDateToLocalTime (date, tz) {
let delta_tz_offset = 0;
@@ -585,8 +585,8 @@ const CalendarFetcherUtils = {
/**
* get the exdate/recurrence hash key from the date object
* BEFORE calling rrule.between
* @param the date of the event
* @returns string date key YYYY-MM-DD
* @param {Date} date The date of the event
* @returns {string} date key in the format YYYY-MM-DD
*/
getDateKeyFromDate (date) {
// get our runtime timezone offset
@@ -611,9 +611,8 @@ const CalendarFetcherUtils = {
/**
* get the timezone offset from the timezone string
*
* @param the timezone string
* @returns the numerical offset
* @param {string} timeZone The timezone string
* @returns {number} The numerical offset in minutes from UTC.
*/
getTimezoneOffsetFromTimezone (timeZone) {
const str = new Date().toLocaleString("en", { timeZone, timeZoneName: "longOffset" });
@@ -624,10 +623,10 @@ const CalendarFetcherUtils = {
/**
* fixup the date start moment after rrule.between returns date array
*
* @param date object from rrule.between results
* @param {Date} date object from rrule.between results
* the event object it came from
* @returns moment object
* @param {object} event - The event object it came from.
* @returns {Moment} moment object
*/
getAdjustedStartMoment (date, event) {

View File

@@ -181,6 +181,7 @@ Module.register("newsfeed", {
* Gets a feed property by name
* @param {object} feed A feed object.
* @param {string} property The name of the property.
* @returns {*} The value of the specified property for the feed.
*/
getFeedProperty (feed, property) {
let res = this.config[property];

View File

@@ -5,7 +5,7 @@
* @param {boolean} useCorsProxy A flag to indicate
* @param {Array.<{name: string, value:string}>} requestHeaders the HTTP headers to send
* @param {Array.<string>} expectedResponseHeaders the expected HTTP headers to receive
* @param {string} basePath, default /
* @param {string} basePath The base path, default is "/"
* @returns {Promise} resolved when the fetch is done. The response headers is placed in a headers-property (provided the response does not already contain a headers-property).
*/
async function performWebRequest (url, type = "json", useCorsProxy = false, requestHeaders = undefined, expectedResponseHeaders = undefined, basePath = "/") {
@@ -38,7 +38,7 @@ async function performWebRequest (url, type = "json", useCorsProxy = false, requ
* @param {string} url the url to fetch from
* @param {Array.<{name: string, value:string}>} requestHeaders the HTTP headers to send
* @param {Array.<string>} expectedResponseHeaders the expected HTTP headers to receive
* @param {string} basePath, default /
* @param {string} basePath The base path, default is "/"
* @returns {string} to be used as URL when calling CORS-method on server.
*/
const getCorsUrl = function (url, requestHeaders, expectedResponseHeaders, basePath = "/") {