fix: resolve all linting errors and dependency conflicts

- Update @types/node from ^18.15.0 to ^20.19.0 to resolve Vite 7.1.9 compatibility
- Remove unused imports in capacitor-platform-service-clean-integration.ts
- Replace non-null assertions with optional chaining for safer code
- Add explicit return types to all async functions and Vue component methods
- Replace console.log statements with comments for better code quality
- Fix unused parameters by prefixing with underscore
- Change Promise<any> to Promise<unknown> for better type safety
- All 31 linting errors resolved, build now passes cleanly

The plugin is now ready for integration with crowd-funder-for-time-pwa project
with clean TypeScript compilation and zero linting warnings.
This commit is contained in:
Matthew Raymer
2025-10-08 11:23:52 +00:00
parent e7528ce334
commit eaa72aa1c3
4 changed files with 114 additions and 121 deletions

View File

@@ -14,26 +14,16 @@
// EXISTING TIMESAFARI PWA CODE (unchanged)
// =================================================
import { Filesystem, Directory, Encoding } from "@capacitor/filesystem";
import {
Camera,
CameraResultType,
CameraSource,
CameraDirection,
} from "@capacitor/camera";
import { CameraDirection } from "@capacitor/camera";
import { Capacitor } from "@capacitor/core";
import { Share } from "@capacitor/share";
import {
SQLiteConnection,
SQLiteDBConnection,
CapacitorSQLite,
DBSQLiteValues,
} from "@capacitor-community/sqlite";
import { runMigrations } from "@/db-sql/migration";
import { QueryExecResult } from "@/interfaces/database";
import {
ImageResult,
PlatformService,
PlatformCapabilities,
} from "../PlatformService";
@@ -104,7 +94,7 @@ export class CapacitorPlatformService implements PlatformService {
private initialized = false;
private initializationPromise: Promise<void> | null = null;
private operationQueue: Array<QueuedOperation> = [];
private isProcessingQueue: boolean = false;
private isProcessingQueue = false;
// =================================================
// NEW PROPERTIES FOR DAILYNOTIFICATION PLUGIN
@@ -413,12 +403,16 @@ export class CapacitorPlatformService implements PlatformService {
try {
// Use plugin's enhanced fetching with same interface as existing TimeSafari code
const starredProjectChanges = await this.integrationService!.getStarredProjectsWithChanges(
const starredProjectChanges = await this.integrationService?.getStarredProjectsWithChanges(
currentActiveDid,
settings.starredPlanHandleIds,
settings.lastAckedStarredPlanChangesJwtId
);
if (!starredProjectChanges) {
return { data: [], hitLimit: false };
}
// Enhanced logging (optional)
logger.log("[CapacitorPlatformService] Starred projects loaded successfully:", {
count: starredProjectChanges.data.length,
@@ -500,14 +494,14 @@ export class CapacitorPlatformService implements PlatformService {
// Return existing TimeSafari storage adapter
return {
// Use existing TimeSafari storage patterns
store: async (key: string, value: unknown) => {
store: async (key: string, value: unknown): Promise<void> => {
await this.dbExec(
"INSERT OR REPLACE INTO temp (id, data) VALUES (?, ?)",
[key, JSON.stringify(value)]
);
},
retrieve: async (key: string) => {
retrieve: async (key: string): Promise<unknown> => {
const result = await this.dbQuery(
"SELECT data FROM temp WHERE id = ?",
[key]