Skip to content

Commit fed4c86

Browse files
[linter] Re-activate JSDoc linting and fix linting issues
1 parent a3d2064 commit fed4c86

File tree

6 files changed

+25
-19
lines changed

6 files changed

+25
-19
lines changed

eslint.config.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import globals from "globals";
33
import {flatConfigs as importX} from "eslint-plugin-import-x";
44
import jest from "eslint-plugin-jest";
55
import js from "@eslint/js";
6+
import jsdoc from "eslint-plugin-jsdoc";
67
import packageJson from "eslint-plugin-package-json";
78
import stylistic from "@stylistic/eslint-plugin";
89

@@ -22,8 +23,8 @@ export default defineConfig([
2223
moment: "readonly"
2324
}
2425
},
25-
plugins: {js, stylistic},
26-
extends: [importX.recommended, jest.configs["flat/recommended"], "js/recommended", "stylistic/all"],
26+
plugins: {js, jsdoc, stylistic},
27+
extends: [importX.recommended, jest.configs["flat/recommended"], "js/recommended", jsdoc.configs["flat/recommended"], "stylistic/all"],
2728
rules: {
2829
"@stylistic/array-element-newline": ["error", "consistent"],
2930
"@stylistic/arrow-parens": ["error", "always"],

js/check_config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ function checkConfigFile () {
7272
}
7373
}
7474

75+
/**
76+
*
77+
* @param {string} configFileName - The path and filename of the configuration file to validate.
78+
*/
7579
function validateModulePositions (configFileName) {
7680
Log.info("Checking modules structure configuration ...");
7781

modules/default/calendar/calendarfetcherutils.js

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -502,10 +502,10 @@ const CalendarFetcherUtils = {
502502
},
503503

504504
/**
505-
* fixup thew event fields that have dates to use local time
506-
* BEFORE calling rrule.between
507-
* @param the event being processed
508-
* @returns nothing
505+
* Fixes the event fields that have dates to use local time
506+
* before calling rrule.between.
507+
* @param {object} event - The event being processed.
508+
* @returns {void}
509509
*/
510510
fixEventtoLocal (event) {
511511
// if there are excluded dates, their date is incorrect and possibly key as well.
@@ -542,9 +542,9 @@ const CalendarFetcherUtils = {
542542
/**
543543
* convert a UTC date to local time
544544
* BEFORE calling rrule.between
545-
* @param date ti conert
546-
* tz event is currently in
547-
* @returns updated date object
545+
* @param {Date} date The date to convert
546+
* @param {string} tz The timezone string to convert the date to.
547+
* @returns {Date} updated date object
548548
*/
549549
convertDateToLocalTime (date, tz) {
550550
let delta_tz_offset = 0;
@@ -585,8 +585,8 @@ const CalendarFetcherUtils = {
585585
/**
586586
* get the exdate/recurrence hash key from the date object
587587
* BEFORE calling rrule.between
588-
* @param the date of the event
589-
* @returns string date key YYYY-MM-DD
588+
* @param {Date} date The date of the event
589+
* @returns {string} date key in the format YYYY-MM-DD
590590
*/
591591
getDateKeyFromDate (date) {
592592
// get our runtime timezone offset
@@ -611,9 +611,8 @@ const CalendarFetcherUtils = {
611611

612612
/**
613613
* get the timezone offset from the timezone string
614-
*
615-
* @param the timezone string
616-
* @returns the numerical offset
614+
* @param {string} timeZone The timezone string
615+
* @returns {number} The numerical offset in minutes from UTC.
617616
*/
618617
getTimezoneOffsetFromTimezone (timeZone) {
619618
const str = new Date().toLocaleString("en", { timeZone, timeZoneName: "longOffset" });
@@ -624,10 +623,10 @@ const CalendarFetcherUtils = {
624623

625624
/**
626625
* fixup the date start moment after rrule.between returns date array
627-
*
628-
* @param date object from rrule.between results
626+
* @param {Date} date object from rrule.between results
629627
* the event object it came from
630-
* @returns moment object
628+
* @param {object} event - The event object it came from.
629+
* @returns {Moment} moment object
631630
*/
632631
getAdjustedStartMoment (date, event) {
633632

modules/default/newsfeed/newsfeed.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ Module.register("newsfeed", {
181181
* Gets a feed property by name
182182
* @param {object} feed A feed object.
183183
* @param {string} property The name of the property.
184+
* @returns {*} The value of the specified property for the feed.
184185
*/
185186
getFeedProperty (feed, property) {
186187
let res = this.config[property];

modules/default/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @param {boolean} useCorsProxy A flag to indicate
66
* @param {Array.<{name: string, value:string}>} requestHeaders the HTTP headers to send
77
* @param {Array.<string>} expectedResponseHeaders the expected HTTP headers to receive
8-
* @param {string} basePath, default /
8+
* @param {string} basePath The base path, default is "/"
99
* @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).
1010
*/
1111
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
3838
* @param {string} url the url to fetch from
3939
* @param {Array.<{name: string, value:string}>} requestHeaders the HTTP headers to send
4040
* @param {Array.<string>} expectedResponseHeaders the expected HTTP headers to receive
41-
* @param {string} basePath, default /
41+
* @param {string} basePath The base path, default is "/"
4242
* @returns {string} to be used as URL when calling CORS-method on server.
4343
*/
4444
const getCorsUrl = function (url, requestHeaders, expectedResponseHeaders, basePath = "/") {

tests/electron/modules/compliments_spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ describe("Compliments module", () => {
55
/**
66
* move similar tests in function doTest
77
* @param {Array} complimentsArray The array of compliments.
8+
* @param {string} state The state of the element (e.g., "visible" or "attached").
89
* @returns {boolean} result
910
*/
1011
const doTest = async (complimentsArray, state = "visible") => {

0 commit comments

Comments
 (0)