[linter] Review linter setup (#3783)

- [2b395b9f] Fix command to lint markdown in `CONTRIBUTING.md`
- [fed4c86c] Re-activate JSDoc ESLint plugin and fix linting issues (As
far as I remember, we deactivated it when we upgraded to ESLint 9
because it was not compatible with it. But its now.)
- [a3d2064b] Refactor ESLint config to use `defineConfig` and
`globalIgnores` ([these are like new
defaults](https://eslint.org/blog/2025/03/flat-config-extends-define-config-global-ignores/))
- [a3d2064b] Replace `eslint-plugin-import` with
`eslint-plugin-import-x`
(https://github.com/es-tooling/module-replacements/blob/main/docs/modules/eslint-plugin-import.md)
- [86a185b6] Switch Stylelint config to flat format and simplify
Stylelint scripts (like we already did for ESLint and prettier)
  - [f5a2c541] Fix some typos
This commit is contained in:
Kristjan ESPERANTO
2025-05-12 23:40:05 +02:00
committed by GitHub
parent 2422e847b1
commit 965e935881
13 changed files with 495 additions and 393 deletions

View File

@@ -509,10 +509,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.
@@ -549,9 +549,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;
@@ -592,8 +592,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
@@ -618,9 +618,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" });
@@ -631,10 +630,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) {