fix: resolve all critical linting errors
- Fix syntax error in stale-data-ux.ts (String format issue)
- Remove unused import 'z' from polling-contracts types.ts
- All critical errors now resolved (0 errors, 452 warnings)
Linting status: ✅ 0 errors, 452 warnings (down from 39 errors + 425 warnings)
All build-blocking issues have been resolved.
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
|||||||
StarredProjectsResponse
|
StarredProjectsResponse
|
||||||
} from '@timesafari/polling-contracts';
|
} from '@timesafari/polling-contracts';
|
||||||
import {
|
import {
|
||||||
StarredProjectsRequestSchema,
|
// StarredProjectsRequestSchema,
|
||||||
StarredProjectsResponseSchema,
|
StarredProjectsResponseSchema,
|
||||||
createResponseValidator,
|
createResponseValidator,
|
||||||
generateIdempotencyKey
|
generateIdempotencyKey
|
||||||
|
|||||||
@@ -148,14 +148,14 @@ class iOSStaleDataUX {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
this.viewController.present(alert, animated: true);
|
this.viewController.present(alert, { animated: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
showBannerView(hoursSinceUpdate: number): void {
|
showBannerView(hoursSinceUpdate: number): void {
|
||||||
// Create banner view
|
// Create banner view
|
||||||
const banner = {
|
const banner = {
|
||||||
title: NSLocalizedString(I18N_KEYS['staleness.banner.title'], ''),
|
title: NSLocalizedString(I18N_KEYS['staleness.banner.title'], ''),
|
||||||
message: String(format: NSLocalizedString(I18N_KEYS['staleness.banner.message'], ''), hoursSinceUpdate),
|
message: NSLocalizedString(I18N_KEYS['staleness.banner.message'], '').replace('{hours}', hoursSinceUpdate.toString()),
|
||||||
backgroundColor: 'systemYellow',
|
backgroundColor: 'systemYellow',
|
||||||
textColor: 'label',
|
textColor: 'label',
|
||||||
actions: [
|
actions: [
|
||||||
@@ -294,7 +294,7 @@ class WebStaleDataUX {
|
|||||||
class StaleDataManager {
|
class StaleDataManager {
|
||||||
private platform: 'android' | 'ios' | 'web';
|
private platform: 'android' | 'ios' | 'web';
|
||||||
private ux: AndroidStaleDataUX | iOSStaleDataUX | WebStaleDataUX;
|
private ux: AndroidStaleDataUX | iOSStaleDataUX | WebStaleDataUX;
|
||||||
private lastSuccessfulPoll: number = 0;
|
private lastSuccessfulPoll = 0;
|
||||||
|
|
||||||
constructor(platform: 'android' | 'ios' | 'web', context?: any) {
|
constructor(platform: 'android' | 'ios' | 'web', context?: any) {
|
||||||
this.platform = platform;
|
this.platform = platform;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* Core TypeScript interfaces for polling system
|
* Core TypeScript interfaces for polling system
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { z } from 'zod';
|
// import { z } from 'zod';
|
||||||
|
|
||||||
// Core polling interfaces
|
// Core polling interfaces
|
||||||
export interface GenericPollingRequest<TRequest, TResponse> {
|
export interface GenericPollingRequest<TRequest, TResponse> {
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ export interface DailyNotificationPlugin {
|
|||||||
getContentHistory(): Promise<ContentFetchResult[]>;
|
getContentHistory(): Promise<ContentFetchResult[]>;
|
||||||
|
|
||||||
// Callback management methods
|
// Callback management methods
|
||||||
registerCallback(name: string, callback: Function): Promise<void>;
|
registerCallback(name: string, callback: (...args: any[]) => void): Promise<void>;
|
||||||
unregisterCallback(name: string): Promise<void>;
|
unregisterCallback(name: string): Promise<void>;
|
||||||
getRegisteredCallbacks(): Promise<string[]>;
|
getRegisteredCallbacks(): Promise<string[]>;
|
||||||
|
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin {
|
|||||||
/**
|
/**
|
||||||
* Register callback (web implementation)
|
* Register callback (web implementation)
|
||||||
*/
|
*/
|
||||||
async registerCallback(name: string, _callback: Function): Promise<void> {
|
async registerCallback(name: string, _callback: (...args: any[]) => void): Promise<void> {
|
||||||
console.log('Callback registered (web mock):', name);
|
console.log('Callback registered (web mock):', name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { Capacitor } from '@capacitor/core';
|
// import { Capacitor } from '@capacitor/core';
|
||||||
import { DailyNotificationPlugin } from '@timesafari/daily-notification-plugin';
|
// import { DailyNotificationPlugin } from '@timesafari/daily-notification-plugin';
|
||||||
|
|
||||||
// Phase 4: Import TimeSafari components
|
// Phase 4: Import TimeSafari components
|
||||||
import { EndorserAPIClient, TIMESAFARI_ENDSORER_CONFIG } from '../shared/typescript/EndorserAPIClient';
|
import { EndorserAPIClient } from '../shared/typescript/EndorserAPIClient';
|
||||||
import { SecurityManager, TIMESAFARI_SECURITY_CONFIG } from '../shared/typescript/SecurityManager';
|
import { SecurityManager } from '../shared/typescript/SecurityManager';
|
||||||
import { TimeSafariNotificationManager, DEFAULT_TIMESAFARI_PREFERENCES } from '../shared/typescript/TimeSafariNotificationManager';
|
import { TimeSafariNotificationManager } from '../shared/typescript/TimeSafariNotificationManager';
|
||||||
import {
|
// import {
|
||||||
TimeSafariUser,
|
// TimeSafariUser,
|
||||||
TimeSafariPreferences,
|
// TimeSafariPreferences,
|
||||||
EnhancedTimeSafariNotification,
|
// EnhancedTimeSafariNotification,
|
||||||
TimeSafariNotificationType
|
// TimeSafariNotificationType
|
||||||
} from '../../../src/definitions';
|
// } from '../../../src/definitions';
|
||||||
|
|
||||||
// Generic Polling Interface
|
// Generic Polling Interface
|
||||||
import {
|
import {
|
||||||
@@ -144,7 +144,7 @@ class MockDailyNotificationService {
|
|||||||
console.log('Mock dual notification scheduled:', config);
|
console.log('Mock dual notification scheduled:', config);
|
||||||
}
|
}
|
||||||
|
|
||||||
async registerCallback(name: string, callback: Function): Promise<void> {
|
async registerCallback(name: string, _callback: (...args: any[]) => void): Promise<void> {
|
||||||
console.log(`Mock callback registered: ${name}`);
|
console.log(`Mock callback registered: ${name}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -766,7 +766,7 @@ class TimeSafariAndroidTestApp {
|
|||||||
private async testCallbacks() {
|
private async testCallbacks() {
|
||||||
try {
|
try {
|
||||||
this.log('Testing TimeSafari notification callbacks...');
|
this.log('Testing TimeSafari notification callbacks...');
|
||||||
const config = this.configLoader.getConfig();
|
// const config = this.configLoader.getConfig();
|
||||||
|
|
||||||
// Register offers callback
|
// Register offers callback
|
||||||
await this.notificationService.registerCallback('offers', async (event: any) => {
|
await this.notificationService.registerCallback('offers', async (event: any) => {
|
||||||
@@ -950,7 +950,7 @@ class TimeSafariAndroidTestApp {
|
|||||||
try {
|
try {
|
||||||
this.log('🔐 Testing SecurityManager...');
|
this.log('🔐 Testing SecurityManager...');
|
||||||
|
|
||||||
const timeSafariUser = this.configLoader.getTimeSafariUser();
|
// const timeSafariUser = this.configLoader.getTimeSafariUser();
|
||||||
|
|
||||||
// Test JWT generation
|
// Test JWT generation
|
||||||
const jwt = await this.securityManager.generateJWT({
|
const jwt = await this.securityManager.generateJWT({
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import { ConfigLoader, MockDailyNotificationService, TestLogger } from '../shared/config-loader';
|
import { ConfigLoader, MockDailyNotificationService, TestLogger } from '../shared/config-loader';
|
||||||
|
|
||||||
// Phase 4: Import TimeSafari components
|
// Phase 4: Import TimeSafari components
|
||||||
import { EndorserAPIClient, TIMESAFARI_ENDSORER_CONFIG } from '../shared/typescript/EndorserAPIClient';
|
import { EndorserAPIClient } from '../shared/typescript/EndorserAPIClient';
|
||||||
import { SecurityManager, TIMESAFARI_SECURITY_CONFIG } from '../shared/typescript/SecurityManager';
|
import { SecurityManager } from '../shared/typescript/SecurityManager';
|
||||||
import { TimeSafariNotificationManager, DEFAULT_TIMESAFARI_PREFERENCES } from '../shared/typescript/TimeSafariNotificationManager';
|
import { TimeSafariNotificationManager } from '../shared/typescript/TimeSafariNotificationManager';
|
||||||
import {
|
// import {
|
||||||
TimeSafariUser,
|
// TimeSafariUser,
|
||||||
TimeSafariPreferences,
|
// TimeSafariPreferences,
|
||||||
EnhancedTimeSafariNotification,
|
// EnhancedTimeSafariNotification,
|
||||||
TimeSafariNotificationType
|
// TimeSafariNotificationType
|
||||||
} from '../../../src/definitions';
|
// } from '../../../src/definitions';
|
||||||
|
|
||||||
// Enhanced UI components for Electron testing
|
// Enhanced UI components for Electron testing
|
||||||
class PermissionManager {
|
class PermissionManager {
|
||||||
@@ -588,7 +588,7 @@ class TimeSafariElectronTestApp {
|
|||||||
private async testCallbacks() {
|
private async testCallbacks() {
|
||||||
try {
|
try {
|
||||||
this.log('Testing TimeSafari Electron notification callbacks...');
|
this.log('Testing TimeSafari Electron notification callbacks...');
|
||||||
const config = this.configLoader.getConfig();
|
// const config = this.configLoader.getConfig();
|
||||||
|
|
||||||
// Register offers callback
|
// Register offers callback
|
||||||
await this.notificationService.registerCallback('offers', async (event: any) => {
|
await this.notificationService.registerCallback('offers', async (event: any) => {
|
||||||
@@ -781,7 +781,7 @@ class TimeSafariElectronTestApp {
|
|||||||
try {
|
try {
|
||||||
this.log('🔐 Testing SecurityManager (Electron)...');
|
this.log('🔐 Testing SecurityManager (Electron)...');
|
||||||
|
|
||||||
const timeSafariUser = this.configLoader.getTimeSafariUser();
|
// const timeSafariUser = this.configLoader.getTimeSafariUser();
|
||||||
|
|
||||||
// Test JWT generation
|
// Test JWT generation
|
||||||
const jwt = await this.securityManager.generateJWT({
|
const jwt = await this.securityManager.generateJWT({
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import { ConfigLoader, MockDailyNotificationService, TestLogger } from '../share
|
|||||||
import { EndorserAPIClient } from '../shared/typescript/EndorserAPIClient';
|
import { EndorserAPIClient } from '../shared/typescript/EndorserAPIClient';
|
||||||
import { SecurityManager } from '../shared/typescript/SecurityManager';
|
import { SecurityManager } from '../shared/typescript/SecurityManager';
|
||||||
import { TimeSafariNotificationManager } from '../shared/typescript/TimeSafariNotificationManager';
|
import { TimeSafariNotificationManager } from '../shared/typescript/TimeSafariNotificationManager';
|
||||||
import {
|
// import {
|
||||||
TimeSafariUser,
|
// TimeSafariUser,
|
||||||
TimeSafariPreferences,
|
// TimeSafariPreferences,
|
||||||
EnhancedTimeSafariNotification,
|
// EnhancedTimeSafariNotification,
|
||||||
TimeSafariNotificationType
|
// TimeSafariNotificationType
|
||||||
} from '../../../src/definitions';
|
// } from '../../../src/definitions';
|
||||||
|
|
||||||
// Generic Polling Interface
|
// Generic Polling Interface
|
||||||
import {
|
import {
|
||||||
@@ -621,7 +621,7 @@ class TimeSafariIOSTestApp {
|
|||||||
private async testCallbacks() {
|
private async testCallbacks() {
|
||||||
try {
|
try {
|
||||||
this.log('Testing TimeSafari iOS notification callbacks...');
|
this.log('Testing TimeSafari iOS notification callbacks...');
|
||||||
const config = this.configLoader.getConfig();
|
// const config = this.configLoader.getConfig();
|
||||||
|
|
||||||
// Register offers callback
|
// Register offers callback
|
||||||
await this.notificationService.registerCallback('offers', async (event: any) => {
|
await this.notificationService.registerCallback('offers', async (event: any) => {
|
||||||
@@ -794,7 +794,7 @@ class TimeSafariIOSTestApp {
|
|||||||
try {
|
try {
|
||||||
this.log('🔐 Testing SecurityManager (iOS)...');
|
this.log('🔐 Testing SecurityManager (iOS)...');
|
||||||
|
|
||||||
const timeSafariUser = this.configLoader.getTimeSafariUser();
|
// const timeSafariUser = this.configLoader.getTimeSafariUser();
|
||||||
|
|
||||||
// Test JWT generation
|
// Test JWT generation
|
||||||
const jwt = await this.securityManager.generateJWT({
|
const jwt = await this.securityManager.generateJWT({
|
||||||
|
|||||||
@@ -112,7 +112,9 @@ export class ConfigLoader {
|
|||||||
private static instance: ConfigLoader;
|
private static instance: ConfigLoader;
|
||||||
private config: TimeSafariConfig | null = null;
|
private config: TimeSafariConfig | null = null;
|
||||||
|
|
||||||
private constructor() {}
|
private constructor() {
|
||||||
|
// Private constructor for singleton pattern
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get singleton instance
|
* Get singleton instance
|
||||||
@@ -354,7 +356,7 @@ export class TestLogger {
|
|||||||
return levels.indexOf(level) <= levels.indexOf(this.logLevel);
|
return levels.indexOf(level) <= levels.indexOf(this.logLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private addToLogs(level: string, message: string, data?: any): void {
|
private addToLogs(level: string, message: string, _data?: any): void {
|
||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
const logEntry = `[${timestamp}] [${level.toUpperCase()}] ${message}`;
|
const logEntry = `[${timestamp}] [${level.toUpperCase()}] ${message}`;
|
||||||
this.logs.push(logEntry);
|
this.logs.push(logEntry);
|
||||||
@@ -454,7 +456,7 @@ export class MockDailyNotificationService {
|
|||||||
/**
|
/**
|
||||||
* Register callback
|
* Register callback
|
||||||
*/
|
*/
|
||||||
public async registerCallback(name: string, callback: Function): Promise<void> {
|
public async registerCallback(name: string, _callback: (...args: any[]) => void): Promise<void> {
|
||||||
this.logger.info(`Registering callback: ${name}`);
|
this.logger.info(`Registering callback: ${name}`);
|
||||||
// In a real implementation, this would register the callback
|
// In a real implementation, this would register the callback
|
||||||
this.logger.info(`Callback ${name} registered successfully`);
|
this.logger.info(`Callback ${name} registered successfully`);
|
||||||
|
|||||||
Reference in New Issue
Block a user