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
|
||||
} from '@timesafari/polling-contracts';
|
||||
import {
|
||||
StarredProjectsRequestSchema,
|
||||
// StarredProjectsRequestSchema,
|
||||
StarredProjectsResponseSchema,
|
||||
createResponseValidator,
|
||||
generateIdempotencyKey
|
||||
|
||||
@@ -148,14 +148,14 @@ class iOSStaleDataUX {
|
||||
]
|
||||
};
|
||||
|
||||
this.viewController.present(alert, animated: true);
|
||||
this.viewController.present(alert, { animated: true });
|
||||
}
|
||||
|
||||
showBannerView(hoursSinceUpdate: number): void {
|
||||
// Create banner view
|
||||
const banner = {
|
||||
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',
|
||||
textColor: 'label',
|
||||
actions: [
|
||||
@@ -294,7 +294,7 @@ class WebStaleDataUX {
|
||||
class StaleDataManager {
|
||||
private platform: 'android' | 'ios' | 'web';
|
||||
private ux: AndroidStaleDataUX | iOSStaleDataUX | WebStaleDataUX;
|
||||
private lastSuccessfulPoll: number = 0;
|
||||
private lastSuccessfulPoll = 0;
|
||||
|
||||
constructor(platform: 'android' | 'ios' | 'web', context?: any) {
|
||||
this.platform = platform;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Core TypeScript interfaces for polling system
|
||||
*/
|
||||
|
||||
import { z } from 'zod';
|
||||
// import { z } from 'zod';
|
||||
|
||||
// Core polling interfaces
|
||||
export interface GenericPollingRequest<TRequest, TResponse> {
|
||||
|
||||
@@ -363,7 +363,7 @@ export interface DailyNotificationPlugin {
|
||||
getContentHistory(): Promise<ContentFetchResult[]>;
|
||||
|
||||
// Callback management methods
|
||||
registerCallback(name: string, callback: Function): Promise<void>;
|
||||
registerCallback(name: string, callback: (...args: any[]) => void): Promise<void>;
|
||||
unregisterCallback(name: string): Promise<void>;
|
||||
getRegisteredCallbacks(): Promise<string[]>;
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ export class DailyNotificationWeb implements DailyNotificationPlugin {
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { Capacitor } from '@capacitor/core';
|
||||
import { DailyNotificationPlugin } from '@timesafari/daily-notification-plugin';
|
||||
// import { Capacitor } from '@capacitor/core';
|
||||
// import { DailyNotificationPlugin } from '@timesafari/daily-notification-plugin';
|
||||
|
||||
// Phase 4: Import TimeSafari components
|
||||
import { EndorserAPIClient, TIMESAFARI_ENDSORER_CONFIG } from '../shared/typescript/EndorserAPIClient';
|
||||
import { SecurityManager, TIMESAFARI_SECURITY_CONFIG } from '../shared/typescript/SecurityManager';
|
||||
import { TimeSafariNotificationManager, DEFAULT_TIMESAFARI_PREFERENCES } from '../shared/typescript/TimeSafariNotificationManager';
|
||||
import {
|
||||
TimeSafariUser,
|
||||
TimeSafariPreferences,
|
||||
EnhancedTimeSafariNotification,
|
||||
TimeSafariNotificationType
|
||||
} from '../../../src/definitions';
|
||||
import { EndorserAPIClient } from '../shared/typescript/EndorserAPIClient';
|
||||
import { SecurityManager } from '../shared/typescript/SecurityManager';
|
||||
import { TimeSafariNotificationManager } from '../shared/typescript/TimeSafariNotificationManager';
|
||||
// import {
|
||||
// TimeSafariUser,
|
||||
// TimeSafariPreferences,
|
||||
// EnhancedTimeSafariNotification,
|
||||
// TimeSafariNotificationType
|
||||
// } from '../../../src/definitions';
|
||||
|
||||
// Generic Polling Interface
|
||||
import {
|
||||
@@ -144,7 +144,7 @@ class MockDailyNotificationService {
|
||||
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}`);
|
||||
}
|
||||
|
||||
@@ -766,7 +766,7 @@ class TimeSafariAndroidTestApp {
|
||||
private async testCallbacks() {
|
||||
try {
|
||||
this.log('Testing TimeSafari notification callbacks...');
|
||||
const config = this.configLoader.getConfig();
|
||||
// const config = this.configLoader.getConfig();
|
||||
|
||||
// Register offers callback
|
||||
await this.notificationService.registerCallback('offers', async (event: any) => {
|
||||
@@ -950,7 +950,7 @@ class TimeSafariAndroidTestApp {
|
||||
try {
|
||||
this.log('🔐 Testing SecurityManager...');
|
||||
|
||||
const timeSafariUser = this.configLoader.getTimeSafariUser();
|
||||
// const timeSafariUser = this.configLoader.getTimeSafariUser();
|
||||
|
||||
// Test JWT generation
|
||||
const jwt = await this.securityManager.generateJWT({
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { ConfigLoader, MockDailyNotificationService, TestLogger } from '../shared/config-loader';
|
||||
|
||||
// Phase 4: Import TimeSafari components
|
||||
import { EndorserAPIClient, TIMESAFARI_ENDSORER_CONFIG } from '../shared/typescript/EndorserAPIClient';
|
||||
import { SecurityManager, TIMESAFARI_SECURITY_CONFIG } from '../shared/typescript/SecurityManager';
|
||||
import { TimeSafariNotificationManager, DEFAULT_TIMESAFARI_PREFERENCES } from '../shared/typescript/TimeSafariNotificationManager';
|
||||
import {
|
||||
TimeSafariUser,
|
||||
TimeSafariPreferences,
|
||||
EnhancedTimeSafariNotification,
|
||||
TimeSafariNotificationType
|
||||
} from '../../../src/definitions';
|
||||
import { EndorserAPIClient } from '../shared/typescript/EndorserAPIClient';
|
||||
import { SecurityManager } from '../shared/typescript/SecurityManager';
|
||||
import { TimeSafariNotificationManager } from '../shared/typescript/TimeSafariNotificationManager';
|
||||
// import {
|
||||
// TimeSafariUser,
|
||||
// TimeSafariPreferences,
|
||||
// EnhancedTimeSafariNotification,
|
||||
// TimeSafariNotificationType
|
||||
// } from '../../../src/definitions';
|
||||
|
||||
// Enhanced UI components for Electron testing
|
||||
class PermissionManager {
|
||||
@@ -588,7 +588,7 @@ class TimeSafariElectronTestApp {
|
||||
private async testCallbacks() {
|
||||
try {
|
||||
this.log('Testing TimeSafari Electron notification callbacks...');
|
||||
const config = this.configLoader.getConfig();
|
||||
// const config = this.configLoader.getConfig();
|
||||
|
||||
// Register offers callback
|
||||
await this.notificationService.registerCallback('offers', async (event: any) => {
|
||||
@@ -781,7 +781,7 @@ class TimeSafariElectronTestApp {
|
||||
try {
|
||||
this.log('🔐 Testing SecurityManager (Electron)...');
|
||||
|
||||
const timeSafariUser = this.configLoader.getTimeSafariUser();
|
||||
// const timeSafariUser = this.configLoader.getTimeSafariUser();
|
||||
|
||||
// Test JWT generation
|
||||
const jwt = await this.securityManager.generateJWT({
|
||||
|
||||
@@ -5,12 +5,12 @@ import { ConfigLoader, MockDailyNotificationService, TestLogger } from '../share
|
||||
import { EndorserAPIClient } from '../shared/typescript/EndorserAPIClient';
|
||||
import { SecurityManager } from '../shared/typescript/SecurityManager';
|
||||
import { TimeSafariNotificationManager } from '../shared/typescript/TimeSafariNotificationManager';
|
||||
import {
|
||||
TimeSafariUser,
|
||||
TimeSafariPreferences,
|
||||
EnhancedTimeSafariNotification,
|
||||
TimeSafariNotificationType
|
||||
} from '../../../src/definitions';
|
||||
// import {
|
||||
// TimeSafariUser,
|
||||
// TimeSafariPreferences,
|
||||
// EnhancedTimeSafariNotification,
|
||||
// TimeSafariNotificationType
|
||||
// } from '../../../src/definitions';
|
||||
|
||||
// Generic Polling Interface
|
||||
import {
|
||||
@@ -621,7 +621,7 @@ class TimeSafariIOSTestApp {
|
||||
private async testCallbacks() {
|
||||
try {
|
||||
this.log('Testing TimeSafari iOS notification callbacks...');
|
||||
const config = this.configLoader.getConfig();
|
||||
// const config = this.configLoader.getConfig();
|
||||
|
||||
// Register offers callback
|
||||
await this.notificationService.registerCallback('offers', async (event: any) => {
|
||||
@@ -794,7 +794,7 @@ class TimeSafariIOSTestApp {
|
||||
try {
|
||||
this.log('🔐 Testing SecurityManager (iOS)...');
|
||||
|
||||
const timeSafariUser = this.configLoader.getTimeSafariUser();
|
||||
// const timeSafariUser = this.configLoader.getTimeSafariUser();
|
||||
|
||||
// Test JWT generation
|
||||
const jwt = await this.securityManager.generateJWT({
|
||||
|
||||
@@ -112,7 +112,9 @@ export class ConfigLoader {
|
||||
private static instance: ConfigLoader;
|
||||
private config: TimeSafariConfig | null = null;
|
||||
|
||||
private constructor() {}
|
||||
private constructor() {
|
||||
// Private constructor for singleton pattern
|
||||
}
|
||||
|
||||
/**
|
||||
* Get singleton instance
|
||||
@@ -354,7 +356,7 @@ export class TestLogger {
|
||||
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 logEntry = `[${timestamp}] [${level.toUpperCase()}] ${message}`;
|
||||
this.logs.push(logEntry);
|
||||
@@ -454,7 +456,7 @@ export class MockDailyNotificationService {
|
||||
/**
|
||||
* 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}`);
|
||||
// In a real implementation, this would register the callback
|
||||
this.logger.info(`Callback ${name} registered successfully`);
|
||||
|
||||
Reference in New Issue
Block a user