From 53bf62a6657ed656873d62864479fcc9bef5b16f Mon Sep 17 00:00:00 2001 From: simatec Date: Mon, 9 Dec 2024 15:35:27 +0100 Subject: [PATCH] (simatec) Fix eslint check --- eslint.config.mjs | 2 +- lib/elevationDown.js | 2 +- lib/isSummerTime.js | 10 +++++----- lib/setShutter.js | 8 ++++---- lib/shutterBrightnessSensor.js | 2 +- lib/shutterDownChildren.js | 2 +- lib/shutterDownLiving.js | 2 +- lib/shutterDownSleep.js | 2 +- lib/shutterGoldenHour.js | 2 +- lib/shutterSunriseSunset.js | 2 +- lib/tools.js | 30 +++++++++++++++--------------- main.js | 12 ++++++------ 12 files changed, 38 insertions(+), 38 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index a1bb76c..f03080b 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -43,7 +43,7 @@ export default [ //'no-useless-escape': 'off', //'jsdoc/require-param': 'off', //'@typescript-eslint/no-require-imports': 'off', - 'jsdoc/no-types': 'off', + //'jsdoc/no-types': 'off', //'jsdoc/tag-lines': 'off', }, }, diff --git a/lib/elevationDown.js b/lib/elevationDown.js index fc18db3..858051a 100644 --- a/lib/elevationDown.js +++ b/lib/elevationDown.js @@ -9,7 +9,7 @@ const CheckInSummerNotDown = require('./isSummerTime.js').CheckInSummerNotDown; const GetXmasLevel = require('./isSummerTime.js').GetXmasLevel; // Check is XMas /** - * @param {Date | undefined} [d] + * @param [d] */ function getDate(d) { d = d || new Date(); diff --git a/lib/isSummerTime.js b/lib/isSummerTime.js index 3235829..5089497 100644 --- a/lib/isSummerTime.js +++ b/lib/isSummerTime.js @@ -1,9 +1,9 @@ 'use strict'; /** - * @param {{ log: { debug: (arg0: string) => void; error: (arg0: string) => void; }; }} adapter - * @param {string} StartDate - * @param {string} EndDate + * @param adapter + * @param StartDate + * @param EndDate */ async function IsSummerTime(adapter, StartDate, EndDate) { return new Promise(async (resolve) => { @@ -79,8 +79,8 @@ async function CheckInSummerNotDown(adapter, shutter) { } /** - * @param {{ log: any; config?: any; }} adapter - * @param {{ shutterName: string; useXmasLevel: any; XmasLevel: string; }} shutter + * @param adapter + * @param shutter */ async function GetXmasLevel(adapter, shutter) { return new Promise(async (resolve) => { diff --git a/lib/setShutter.js b/lib/setShutter.js index ac52be1..9a61272 100644 --- a/lib/setShutter.js +++ b/lib/setShutter.js @@ -22,10 +22,10 @@ async function setShutterState(adapter, shutterSettings, currentShutterSettings, } /** - * @param {{ setStateAsync: (arg0: string, arg1: { val: any; ack: boolean; }) => any; log: { warn: (arg0: string) => void; }; }} adapter - * @param {any} shutterSettings - * @param {{ currentHeight: string; currentAction: any; name: any; }} currentShutterSettings - * @param {string} nameDevice + * @param adapter + * @param shutterSettings + * @param currentShutterSettings + * @param nameDevice */ async function setShutterInfo(adapter, shutterSettings, currentShutterSettings, nameDevice) { return new Promise(async (resolve) => { diff --git a/lib/shutterBrightnessSensor.js b/lib/shutterBrightnessSensor.js index cfee578..00f7164 100644 --- a/lib/shutterBrightnessSensor.js +++ b/lib/shutterBrightnessSensor.js @@ -17,7 +17,7 @@ async function sleep(ms) { } /** - * @param {Date | undefined} [d] + * @param [d] */ function getDate(d) { d = d || new Date(); diff --git a/lib/shutterDownChildren.js b/lib/shutterDownChildren.js index f71cbe3..ca14f24 100644 --- a/lib/shutterDownChildren.js +++ b/lib/shutterDownChildren.js @@ -19,7 +19,7 @@ async function sleep(ms) { } /** - * @param {Date | undefined} [d] + * @param [d] */ function getDate(d) { d = d || new Date(); diff --git a/lib/shutterDownLiving.js b/lib/shutterDownLiving.js index b6ab272..afd857b 100644 --- a/lib/shutterDownLiving.js +++ b/lib/shutterDownLiving.js @@ -19,7 +19,7 @@ async function sleep(ms) { } /** - * @param {Date | undefined} [d] + * @param [d] */ function getDate(d) { d = d || new Date(); diff --git a/lib/shutterDownSleep.js b/lib/shutterDownSleep.js index 60e8477..23c346c 100644 --- a/lib/shutterDownSleep.js +++ b/lib/shutterDownSleep.js @@ -19,7 +19,7 @@ async function sleep(ms) { } /** - * @param {Date | undefined} [d] + * @param [d] */ function getDate(d) { d = d || new Date(); diff --git a/lib/shutterGoldenHour.js b/lib/shutterGoldenHour.js index 439c926..bc6dde5 100644 --- a/lib/shutterGoldenHour.js +++ b/lib/shutterGoldenHour.js @@ -19,7 +19,7 @@ async function sleep(ms) { } /** - * @param {Date | undefined} [d] + * @param [d] */ function getDate(d) { d = d || new Date(); diff --git a/lib/shutterSunriseSunset.js b/lib/shutterSunriseSunset.js index f29c66f..141425f 100644 --- a/lib/shutterSunriseSunset.js +++ b/lib/shutterSunriseSunset.js @@ -19,7 +19,7 @@ async function sleep(ms) { } /** - * @param {Date | undefined} [d] + * @param [d] */ function getDate(d) { d = d || new Date(); diff --git a/lib/tools.js b/lib/tools.js index d57458f..1178df9 100644 --- a/lib/tools.js +++ b/lib/tools.js @@ -3,8 +3,8 @@ const axios = require('axios'); /** * Tests whether the given variable is a real object and not an Array * - * @param {any} it The variable to test - * @returns {it is Record} + * @param it The variable to test + * @returns */ function isObject(it) { // This is necessary because: @@ -17,8 +17,8 @@ function isObject(it) { /** * Tests whether the given variable is really an Array * - * @param {any} it The variable to test - * @returns {it is any[]} + * @param it The variable to test + * @returns */ function isArray(it) { if (typeof Array.isArray === 'function') return Array.isArray(it); @@ -28,10 +28,10 @@ function isArray(it) { /** * Translates text to the target language. Automatically chooses the right translation API. * - * @param {string} text The text to translate - * @param {string} targetLang The target languate - * @param {string} [yandexApiKey] The yandex API key. You can create one for free at https://translate.yandex.com/developers - * @returns {Promise} + * @param text The text to translate + * @param targetLang The target languate + * @param [yandexApiKey] The yandex API key. You can create one for free at https://translate.yandex.com/developers + * @returns */ async function translateText(text, targetLang, yandexApiKey) { if (targetLang === 'en') { @@ -47,10 +47,10 @@ async function translateText(text, targetLang, yandexApiKey) { /** * Translates text with Yandex API * - * @param {string} text The text to translate - * @param {string} targetLang The target languate - * @param {string} [apiKey] The yandex API key. You can create one for free at https://translate.yandex.com/developers - * @returns {Promise} + * @param text The text to translate + * @param targetLang The target languate + * @param [apiKey] The yandex API key. You can create one for free at https://translate.yandex.com/developers + * @returns */ async function translateYandex(text, targetLang, apiKey) { if (targetLang === 'zh-cn') { @@ -72,9 +72,9 @@ async function translateYandex(text, targetLang, apiKey) { /** * Translates text with Google API * - * @param {string} text The text to translate - * @param {string} targetLang The target languate - * @returns {Promise} + * @param text The text to translate + * @param targetLang The target languate + * @returns */ async function translateGoogle(text, targetLang) { try { diff --git a/main.js b/main.js index 3834b6f..3495433 100644 --- a/main.js +++ b/main.js @@ -1720,8 +1720,8 @@ async function detectedOldShutter(result) { // +++++++++++++++++++ Is Later function ++++++++++++++++++++++ /** - * @param {string} timeVal - * @param {string} timeLimit + * @param timeVal + * @param timeLimit */ function IsLater(timeVal, timeLimit) { let ret = false; @@ -1756,8 +1756,8 @@ function IsLater(timeVal, timeLimit) { // +++++++++++++++++ Is Earlier function +++++++++++++++++++++ /** - * @param {string } timeVal - * @param {string } [timeLimit] + * @param timeVal + * @param [timeLimit] */ function IsEarlier(timeVal, timeLimit) { let ret = false; @@ -1791,8 +1791,8 @@ function IsEarlier(timeVal, timeLimit) { // ++++++++++++++++++++++++++ is Equal function ++++++++++++++++++++++ /** - * @param {string} timeVal - * @param {string} timeLimit + * @param timeVal + * @param timeLimit */ function IsEqual(timeVal, timeLimit) { let ret = false;