feat: continue Priority 1 any type fixes
- Fix remaining any types in electron test app (9 types)
- Fix remaining any types in shared config loader (11 types)
- Fix remaining any types in core plugin files (4 types)
- Fix remaining any types in polling contracts (8 types)
- Enhanced type safety across all test apps and core modules
Linting status: ✅ 0 errors, 292 warnings (down from 436 warnings)
Priority 1 progress: 144 warnings fixed (33% reduction)
Any types remaining: 76 (down from 113, 37% reduction)
This commit is contained in:
@@ -24,7 +24,7 @@ export const PlanSummarySchema = z.object({
|
||||
export const PreviousClaimSchema = z.object({
|
||||
jwtId: z.string().regex(JWT_ID_PATTERN),
|
||||
claimType: z.string(),
|
||||
claimData: z.record(z.any()),
|
||||
claimData: z.record(z.unknown()),
|
||||
metadata: z.object({
|
||||
createdAt: z.string().datetime(),
|
||||
updatedAt: z.string().datetime()
|
||||
@@ -68,7 +68,7 @@ export const ErrorResponseSchema = z.object({
|
||||
error: z.string(),
|
||||
code: z.string().optional(),
|
||||
message: z.string(),
|
||||
details: z.record(z.any()).optional(),
|
||||
details: z.record(z.unknown()).optional(),
|
||||
retryAfter: z.number().optional(),
|
||||
requestId: z.string().optional()
|
||||
});
|
||||
|
||||
@@ -6,7 +6,7 @@ import { TelemetryMetrics, TelemetryLogs } from './types';
|
||||
import { hashDid, redactPii } from './validation';
|
||||
|
||||
export class TelemetryManager {
|
||||
private metrics: Map<string, any> = new Map();
|
||||
private metrics: Map<string, Record<string, unknown>> = new Map();
|
||||
private logLevel: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';
|
||||
|
||||
constructor(logLevel: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR' = 'INFO') {
|
||||
@@ -163,7 +163,7 @@ export class TelemetryManager {
|
||||
}
|
||||
}
|
||||
|
||||
logError(error: Error, context?: Record<string, any>): void {
|
||||
logError(error: Error, context?: Record<string, unknown>): void {
|
||||
if (this.shouldLog('ERROR')) {
|
||||
const redactedContext = context ? redactPii(context) : undefined;
|
||||
console.error('Polling error:', {
|
||||
@@ -174,14 +174,14 @@ export class TelemetryManager {
|
||||
}
|
||||
}
|
||||
|
||||
logWarning(message: string, context?: Record<string, any>): void {
|
||||
logWarning(message: string, context?: Record<string, unknown>): void {
|
||||
if (this.shouldLog('WARN')) {
|
||||
const redactedContext = context ? redactPii(context) : undefined;
|
||||
console.warn('Polling warning:', { message, context: redactedContext });
|
||||
}
|
||||
}
|
||||
|
||||
logDebug(message: string, context?: Record<string, any>): void {
|
||||
logDebug(message: string, context?: Record<string, unknown>): void {
|
||||
if (this.shouldLog('DEBUG')) {
|
||||
const redactedContext = context ? redactPii(context) : undefined;
|
||||
console.debug('Polling debug:', { message, context: redactedContext });
|
||||
|
||||
@@ -180,7 +180,7 @@ export interface PlanSummary {
|
||||
export interface PreviousClaim {
|
||||
jwtId: string;
|
||||
claimType: string;
|
||||
claimData: Record<string, any>;
|
||||
claimData: Record<string, unknown>;
|
||||
metadata: {
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
@@ -212,7 +212,7 @@ export interface TelemetryLogs {
|
||||
changeCount: number;
|
||||
duration: number;
|
||||
error?: string;
|
||||
metadata?: Record<string, any>;
|
||||
metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
// Clock sync
|
||||
|
||||
Reference in New Issue
Block a user