From 54752f10e8afeafcb05e45bd89a514c9470d24ad Mon Sep 17 00:00:00 2001 From: Karsten Hassel Date: Wed, 16 Jul 2025 00:38:03 +0200 Subject: [PATCH] replace `console` with `Log` in calendar `debug.js` (#3846) to avoid exception in eslint config. Background: If someone has a copy of the `modules` folder in his setup eslint fails because the file `debug.js` uses `console` statements. I need the `modules` folder renamed in my docker setup so this test always fails. I think this is a simple solution which has no impact. --- CHANGELOG.md | 1 + eslint.config.mjs | 1 - modules/default/calendar/debug.js | 13 +++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b4db3cb..9b0c7062 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Thanks to: @dathbe. - [refactor] Add new file `js/module_functions.js` to move code used in several modules to one place (#3837) - [tests] refactor: simplify jest config file (#3844) - [tests] refactor: extract constants for weather electron tests (#3845) +- [tests] replace `console` with `Log` in calendar `debug.js` to avoid exception in eslint config (#3846) ### Updated diff --git a/eslint.config.mjs b/eslint.config.mjs index b046879d..d73d5984 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -88,7 +88,6 @@ export default defineConfig([ files: ["**/*.js"], ignores: [ "clientonly/index.js", - "modules/default/calendar/debug.js", "js/logger.js", "tests/**/*.js" ], diff --git a/modules/default/calendar/debug.js b/modules/default/calendar/debug.js index 74d48cd7..2ab01e67 100644 --- a/modules/default/calendar/debug.js +++ b/modules/default/calendar/debug.js @@ -5,6 +5,7 @@ */ // Alias modules mentioned in package.js under _moduleAliases. require("module-alias/register"); +const Log = require("../../../js/logger"); const CalendarFetcher = require("./calendarfetcher"); @@ -20,22 +21,22 @@ const auth = { pass: pass }; -console.log("Create fetcher ..."); +Log.log("Create fetcher ..."); const fetcher = new CalendarFetcher(url, fetchInterval, [], maximumEntries, maximumNumberOfDays, auth); fetcher.onReceive(function (fetcher) { - console.log(fetcher.events()); - console.log("------------------------------------------------------------"); + Log.log(fetcher.events()); + Log.log("------------------------------------------------------------"); process.exit(0); }); fetcher.onError(function (fetcher, error) { - console.log("Fetcher error:"); - console.log(error); + Log.log("Fetcher error:"); + Log.log(error); process.exit(1); }); fetcher.startFetch(); -console.log("Create fetcher done! "); +Log.log("Create fetcher done! ");