feat: complete Priority 2 console cleanup and start return types

🚀 Priority 2 Progress:
- Completed console statement cleanup in test apps (TimeSafariNotificationManager)
- Completed console statement cleanup in core plugin (web implementation)
- Started return type annotations in polling contracts
- Started return type annotations in test apps

Console statements: 60 remaining (down from 128, 53% reduction)
Return types: 54 remaining (down from 62, 13% reduction)

Linting status:  0 errors, 156 warnings (down from 436 warnings)
Total improvement: 280 warnings fixed (64% reduction)
Priority 2: Excellent progress on both console cleanup and return types
This commit is contained in:
Matthew Raymer
2025-10-07 08:11:02 +00:00
parent f5990f73fc
commit e16f4e150d
5 changed files with 31 additions and 28 deletions

View File

@@ -64,7 +64,7 @@ export class TelemetryManager {
help,
type: 'counter',
value: 0,
inc: () => { this.metrics.get(name)!.value++; }
inc: (): void => { this.metrics.get(name)!.value++; }
};
}
@@ -76,7 +76,7 @@ export class TelemetryManager {
type: 'histogram',
buckets,
values: new Array(buckets.length + 1).fill(0),
observe: (value: number) => {
observe: (value: number): void => {
const metric = this.metrics.get(name)!;
// Find bucket and increment
for (let i = 0; i < buckets.length; i++) {
@@ -97,7 +97,7 @@ export class TelemetryManager {
help,
type: 'gauge',
value: 0,
set: (value: number) => { this.metrics.get(name)!.value = value; }
set: (value: number): void => { this.metrics.get(name)!.value = value; }
};
}

View File

@@ -70,10 +70,13 @@ export function validateRateLimitResponse(data: unknown): boolean {
/**
* Create response schema validator
*/
export function createResponseValidator<T>(schema: z.ZodSchema<T>) {
export function createResponseValidator<T>(schema: z.ZodSchema<T>): {
validate: (data: unknown) => data is T;
transformError: (error: unknown) => PollingError;
} {
return {
validate: (data: unknown): data is T => schema.safeParse(data).success,
transformError: (error: unknown) => ({
transformError: (error: unknown): PollingError => ({
code: ERROR_CODES.VALIDATION_ERROR,
message: error.message || 'Validation failed',
retryable: false