From bf5edcaac65a0de90edab5d2b37d259b78c48eca Mon Sep 17 00:00:00 2001 From: veeck Date: Fri, 7 May 2021 12:23:29 +0200 Subject: [PATCH 1/2] Fix failing config check when es6 notation is used --- CHANGELOG.md | 1 + js/check_config.js | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5735a60a..5336b6ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ Special thanks to the following contributors: @B1gG, @codac, @ezeholz, @khassel, - Fix alert not recognizing multiple alerts (#2522) - Fix fetch option httpsAgent to agent in calendar module (#466) - Fix module updatenotification which did not work for repos with many refs (#1907) +- Fix config check failing when encountering let syntax ("Parsing error: Unexpected token config") ## [2.15.0] - 2021-04-01 diff --git a/js/check_config.js b/js/check_config.js index 01cd08e2..60b4cdf3 100644 --- a/js/check_config.js +++ b/js/check_config.js @@ -52,7 +52,13 @@ function checkConfigFile() { // I'm not sure if all ever is utf-8 const configFile = fs.readFileSync(configFileName, "utf-8"); - const errors = linter.verify(configFile); + // Explicitly tell linter that he might encounter es6 syntax ("let config = {...}") + const errors = linter.verify(configFile, { + env: { + es6: true + } + }); + if (errors.length === 0) { Log.info(Utils.colors.pass("Your configuration file doesn't contain syntax errors :)")); } else { From 43ba4bd00e85fe8f29962c1d21955402a5be8e2b Mon Sep 17 00:00:00 2001 From: veeck Date: Fri, 7 May 2021 12:28:55 +0200 Subject: [PATCH 2/2] Fix calendar debug --- CHANGELOG.md | 1 + modules/default/calendar/debug.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5336b6ac..26e8b860 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ Special thanks to the following contributors: @B1gG, @codac, @ezeholz, @khassel, - Fix fetch option httpsAgent to agent in calendar module (#466) - Fix module updatenotification which did not work for repos with many refs (#1907) - Fix config check failing when encountering let syntax ("Parsing error: Unexpected token config") +- Fix calendar debug check ## [2.15.0] - 2021-04-01 diff --git a/modules/default/calendar/debug.js b/modules/default/calendar/debug.js index f01bcc0d..f2d3a48e 100644 --- a/modules/default/calendar/debug.js +++ b/modules/default/calendar/debug.js @@ -5,6 +5,9 @@ * By Michael Teeuw https://michaelteeuw.nl * MIT Licensed. */ +// Alias modules mentioned in package.js under _moduleAliases. +require("module-alias/register"); + const CalendarFetcher = require("./calendarfetcher.js"); const url = "https://calendar.google.com/calendar/ical/pkm1t2uedjbp0uvq1o7oj1jouo%40group.calendar.google.com/private-08ba559f89eec70dd74bbd887d0a3598/basic.ics"; // Standard test URL @@ -26,11 +29,13 @@ const fetcher = new CalendarFetcher(url, fetchInterval, [], maximumEntries, maxi fetcher.onReceive(function (fetcher) { console.log(fetcher.events()); console.log("------------------------------------------------------------"); + process.exit(0); }); fetcher.onError(function (fetcher, error) { console.log("Fetcher error:"); console.log(error); + process.exit(1); }); fetcher.startFetch();