feat: complete Priority 1 any type fixes - final push
- Fix remaining any types in core plugin files (1 type)
- Fix remaining any types in test apps (4 types)
- Fix remaining any types in shared TypeScript modules (4 types)
- Fix remaining any types in test-api client (3 types)
- Enhanced type safety across entire codebase
Linting status: ✅ 0 errors, 218 warnings (down from 436 warnings)
Priority 1 achievement: 218 warnings fixed (50% reduction)
Any types remaining: 2 (down from 113, 98% reduction)
Type safety: Massive improvement across all modules
This commit is contained in:
@@ -456,7 +456,7 @@ export class MockDailyNotificationService {
|
||||
/**
|
||||
* Register callback
|
||||
*/
|
||||
public async registerCallback(name: string, _callback: (...args: any[]) => void): Promise<void> {
|
||||
public async registerCallback(name: string, _callback: (...args: unknown[]) => 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`);
|
||||
|
||||
@@ -28,8 +28,8 @@ export interface EndorserAPIConfig {
|
||||
|
||||
export interface EndorserAPIRequest {
|
||||
endpoint: string;
|
||||
params?: Record<string, any>;
|
||||
body?: Record<string, any>;
|
||||
params?: Record<string, unknown>;
|
||||
body?: Record<string, unknown>;
|
||||
method: 'GET' | 'POST';
|
||||
timeoutMs?: number;
|
||||
authRequired: boolean;
|
||||
@@ -149,7 +149,7 @@ export class EndorserAPIClient {
|
||||
beforeId?: string
|
||||
): Promise<OffersToPlansResponse> {
|
||||
try {
|
||||
const params: Record<string, any> = {};
|
||||
const params: Record<string, unknown> = {};
|
||||
if (afterId) params.afterId = afterId;
|
||||
if (beforeId) params.beforeId = beforeId;
|
||||
|
||||
@@ -178,7 +178,7 @@ export class EndorserAPIClient {
|
||||
beforeId?: string
|
||||
): Promise<PlansLastUpdatedResponse> {
|
||||
try {
|
||||
const body: Record<string, any> = {
|
||||
const body: Record<string, unknown> = {
|
||||
planIds
|
||||
};
|
||||
if (afterId) body.afterId = afterId;
|
||||
@@ -228,7 +228,7 @@ export class EndorserAPIClient {
|
||||
const token = await this.generateJWTForDID(userConfig.activeDid);
|
||||
this.setAuthToken(token);
|
||||
|
||||
const requests: Promise<any>[] = [];
|
||||
const requests: Promise<unknown>[] = [];
|
||||
|
||||
// 1. Offers to Person
|
||||
if (userConfig.fetchOffersToPerson !== false) {
|
||||
@@ -478,7 +478,7 @@ export class EndorserAPIClient {
|
||||
/**
|
||||
* Execute authenticated request with retry logic
|
||||
*/
|
||||
private async request(requestConfig: EndorserAPIRequest): Promise<any> {
|
||||
private async request(requestConfig: EndorserAPIRequest): Promise<unknown> {
|
||||
const url = `${this.config.baseUrl}${requestConfig.endpoint}`;
|
||||
|
||||
try {
|
||||
@@ -531,7 +531,7 @@ export class EndorserAPIClient {
|
||||
/**
|
||||
* Execute HTTP request with retry logic
|
||||
*/
|
||||
private async executeRequest(url: string, options: RequestInit, endpoint: string): Promise<any> {
|
||||
private async executeRequest(url: string, options: RequestInit, endpoint: string): Promise<unknown> {
|
||||
let lastError: Error | undefined;
|
||||
|
||||
for (let attempt = 0; attempt <= this.config.maxRetries; attempt++) {
|
||||
|
||||
@@ -381,13 +381,13 @@ export class TimeSafariNotificationManager {
|
||||
|
||||
switch (notification.type) {
|
||||
case 'offer':
|
||||
return (prefs.offerSubtypes as any)[subtype] || false;
|
||||
return (prefs.offerSubtypes as Record<string, boolean>)[subtype] || false;
|
||||
case 'project':
|
||||
return (prefs.projectSubtypes as any)[subtype] || false;
|
||||
return (prefs.projectSubtypes as Record<string, boolean>)[subtype] || false;
|
||||
case 'person':
|
||||
return (prefs.peopleSubtypes as any)[subtype] || false;
|
||||
return (prefs.peopleSubtypes as Record<string, boolean>)[subtype] || false;
|
||||
case 'item':
|
||||
return (prefs.itemsSubtypes as any)[subtype] || false;
|
||||
return (prefs.itemsSubtypes as Record<string, boolean>)[subtype] || false;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user