mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Fix lint failures, console.* convention violations, and CI Node version mismatch
- Add docs/capacitor-native-app-plan.md to hex-lint ignore list (code examples naturally reference hex colors in Capacitor config) - Replace direct console.error/console.log calls with logger utility in historyView.js, profileCache.js, EventDetailsModal.js, ZapInterface.js, and notificationController.js - Update CI workflow from Node 20 to Node 22 to match package.json engines https://claude.ai/code/session_01LzErpH9FNw4hAPsjoYb1v9
This commit is contained in:
7 files changed
+19
-14
No files matched your search
@@ -16,7 +16,7 @@ jobs:
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20]
|
||||
node-version: [22]
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
@@ -85,7 +85,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [20]
|
||||
node-version: [22]
|
||||
shard: [1, 2, 3]
|
||||
|
||||
steps:
|
||||
@@ -128,7 +128,7 @@ jobs:
|
||||
timeout-minutes: 20
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20]
|
||||
node-version: [22]
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
@@ -168,7 +168,7 @@ jobs:
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20]
|
||||
node-version: [22]
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
@@ -208,7 +208,7 @@ jobs:
|
||||
timeout-minutes: 45
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20]
|
||||
node-version: [22]
|
||||
|
||||
steps:
|
||||
- name: Check out repository
|
||||
|
||||
+2
-2
@@ -2154,7 +2154,7 @@ export function createWatchHistoryRenderer(config = {}) {
|
||||
if (typeof app?.showSuccess === "function") {
|
||||
app.showSuccess("Local watch history reset.");
|
||||
} else {
|
||||
console.log("Local watch history reset.");
|
||||
userLogger.info("[historyView] Local watch history reset.");
|
||||
}
|
||||
} catch (error) {
|
||||
const message =
|
||||
@@ -2165,7 +2165,7 @@ export function createWatchHistoryRenderer(config = {}) {
|
||||
if (typeof app?.showError === "function") {
|
||||
app.showError(message);
|
||||
} else {
|
||||
console.error(message);
|
||||
userLogger.error("[historyView]", message);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -414,7 +414,7 @@ class ProfileCache {
|
||||
try {
|
||||
listener(event, detail);
|
||||
} catch (error) {
|
||||
console.error("[ProfileCache] Listener error", error);
|
||||
userLogger.error("[ProfileCache] Listener error", error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { prepareStaticModal, openStaticModal, closeStaticModal } from "./staticModalAccessibility.js";
|
||||
import { sanitizeProfileMediaUrl } from "../../utils/profileMedia.js";
|
||||
import { devLogger } from "../../utils/logger.js";
|
||||
|
||||
const DEFAULT_PROFILE_AVATAR = "assets/svg/default-profile.svg";
|
||||
|
||||
@@ -334,7 +335,7 @@ export class EventDetailsModal {
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(
|
||||
devLogger.error(
|
||||
"[EventDetailsModal] Failed to fetch raw event:",
|
||||
error,
|
||||
);
|
||||
@@ -441,7 +442,7 @@ export class EventDetailsModal {
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Failed to load history", e);
|
||||
devLogger.error("[EventDetailsModal] Failed to load history", e);
|
||||
} finally {
|
||||
this.isLoadingHistory = false;
|
||||
this.updateNavigationState();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ZapReceiptList } from "./ZapReceiptList.js";
|
||||
import { createAndPublishZapRequest, resolveZapRecipient } from "../../payments/zapRequests.js";
|
||||
import { userLogger } from "../../utils/logger.js";
|
||||
|
||||
function createElement(doc, tag, className, text) {
|
||||
const element = doc.createElement(tag);
|
||||
@@ -91,7 +92,7 @@ export function createZapInterface(doc, { contact, zapReceipts, onSendZap, zapCo
|
||||
throw new Error("No signer available");
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
userLogger.error("[ZapInterface] Failed to send zap:", err);
|
||||
statusDiv.textContent = "Failed to send zap";
|
||||
statusDiv.className = "text-error text-xs text-center mt-1";
|
||||
} finally {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { userLogger as _fallbackUserLogger, devLogger as _fallbackDevLogger } from "../utils/logger.js";
|
||||
|
||||
export default class NotificationController {
|
||||
constructor({
|
||||
portal,
|
||||
@@ -16,8 +18,8 @@ export default class NotificationController {
|
||||
this.statusContainer?.querySelector("[data-status-message]") || null;
|
||||
|
||||
// Fallback loggers if not provided
|
||||
this.userLogger = loggers.userLogger || { error: console.error, warn: console.warn, log: console.log, info: console.info };
|
||||
this.devLogger = loggers.devLogger || { error: console.error, warn: console.warn, log: console.log, info: console.info };
|
||||
this.userLogger = loggers.userLogger || _fallbackUserLogger;
|
||||
this.devLogger = loggers.devLogger || _fallbackDevLogger;
|
||||
|
||||
this.document = documentRef;
|
||||
this.window = windowRef;
|
||||
|
||||
@@ -34,7 +34,8 @@ const IGNORED_GLOBS = [
|
||||
'**/*.ai',
|
||||
'releases/**',
|
||||
'bitvid-working-webtorrent/**',
|
||||
'scripts/agent/**'
|
||||
'scripts/agent/**',
|
||||
'docs/capacitor-native-app-plan.md'
|
||||
];
|
||||
|
||||
const gitArgs = [
|
||||
|
||||
Reference in new issue
Block a user