fix(08-04): clean up Plan 03 disable directives and console.log site

Plan 03 added 6 `// eslint-disable-next-line no-console -- DEBUG
flag (Phase 8 D-07)` comments expecting Plan 04 to activate
`no-console` globally. The `no-console` rule is OFF in obsidianmd's
recommended config (not just in the Phase-8 override), so the
disables never had effect — they become "unused eslint-disable
directive" warnings once the Phase-8 override is removed.

Also changes CalendarService.ts:303 from `console.log` to
`console.debug` so it complies with `obsidianmd/rule-custom-message`
(which disallows console.log but allows console.debug). The
MemoChron: prefix convention is preserved.

Removed disables: CalendarService.ts:302,388,407,458 and
timezoneUtils.ts:211,221.

Prepares the tree for the Phase-8 override-block deletion in the
next commit.
This commit is contained in:
formax68 2026-05-17 10:11:36 +03:00
parent 42380f7900
commit c9b7dbef4f
2 changed files with 1 additions and 7 deletions

View file

@ -299,8 +299,7 @@ export class CalendarService {
return cacheData.events;
}
} catch (error) {
// eslint-disable-next-line no-console -- DEBUG flag (Phase 8 D-07)
if (DEBUG) console.log("MemoChron: No cache found or cache invalid", errorMessage(error));
if (DEBUG) console.debug("MemoChron: No cache found or cache invalid", errorMessage(error));
} finally {
this.isLoadingCache = false;
}
@ -385,7 +384,6 @@ export class CalendarService {
} else if (response.status === 404) {
new Notice(`MemoChron: Calendar "${source.name}" not found. Please check the URL.`);
} else {
// eslint-disable-next-line no-console -- DEBUG flag (Phase 8 D-07)
if (DEBUG) console.error(
`Failed to fetch calendar ${source.name}: ${response.status} ${
response.text || "Unknown error"
@ -404,7 +402,6 @@ export class CalendarService {
return this.parseCalendarData(response.text, source);
} catch (error) {
const message = errorMessage(error);
// eslint-disable-next-line no-console -- DEBUG flag (Phase 8 D-07)
if (DEBUG) console.error(`Error fetching calendar ${source.name}:`, message);
// Check for specific error types
@ -455,7 +452,6 @@ export class CalendarService {
(response.text && (response.text.includes('<!DOCTYPE html') || response.text.includes('<html')));
if (isHtmlResponse) {
// eslint-disable-next-line no-console -- DEBUG flag (Phase 8 D-07)
if (DEBUG) console.error(`Outlook calendar returned HTML error page for ${url.substring(0, 50)}...`);

View file

@ -208,7 +208,6 @@ export function convertIcalTimeToDate(
);
if (!dt.isValid) {
// eslint-disable-next-line no-console -- DEBUG flag (Phase 8 D-07)
if (DEBUG) console.warn(
`MemoChron: Invalid timezone conversion for zone: ${normalizedTzid} (mapped to ${zone}), falling back to local time`
);
@ -218,7 +217,6 @@ export function convertIcalTimeToDate(
// Convert to local timezone
return dt.toLocal().toJSDate();
} catch (error) {
// eslint-disable-next-line no-console -- DEBUG flag (Phase 8 D-07)
if (DEBUG) console.error("MemoChron: Failed to convert ICAL time:", errorMessage(error), {
icalTime,
tzid: normalizedTzid,