🔧 Fix ESLint Issues
✅ Resolved: - Removed unused imports (Database, BarChart3, Filter, etc.) - Fixed TypeScript 'any' types to proper types - Removed unused variables and parameters - Cleaned up import statements 🎯 Results: - ESLint errors: 0 ❌ → ✅ - Only 2 non-critical warnings remain (img vs Image) - Code is now production-ready for CI/CD 📊 Performance: - Type safety improved - Bundle size optimized through tree-shaking - Better developer experience
This commit is contained in:
12
lib/cache.ts
12
lib/cache.ts
@@ -6,7 +6,7 @@ export const apiCache = {
|
||||
return await cache.get('api:projects');
|
||||
},
|
||||
|
||||
async setProjects(projects: any, ttlSeconds = 300) {
|
||||
async setProjects(projects: unknown, ttlSeconds = 300) {
|
||||
return await cache.set('api:projects', projects, ttlSeconds);
|
||||
},
|
||||
|
||||
@@ -14,7 +14,7 @@ export const apiCache = {
|
||||
return await cache.get(`api:project:${id}`);
|
||||
},
|
||||
|
||||
async setProject(id: number, project: any, ttlSeconds = 300) {
|
||||
async setProject(id: number, project: unknown, ttlSeconds = 300) {
|
||||
return await cache.set(`api:project:${id}`, project, ttlSeconds);
|
||||
},
|
||||
|
||||
@@ -45,7 +45,7 @@ export const performanceCache = {
|
||||
return await cache.get(`perf:${url}`);
|
||||
},
|
||||
|
||||
async setMetrics(url: string, metrics: any, ttlSeconds = 600) {
|
||||
async setMetrics(url: string, metrics: unknown, ttlSeconds = 600) {
|
||||
return await cache.set(`perf:${url}`, metrics, ttlSeconds);
|
||||
},
|
||||
|
||||
@@ -53,7 +53,7 @@ export const performanceCache = {
|
||||
return await cache.get('perf:webvitals');
|
||||
},
|
||||
|
||||
async setWebVitals(vitals: any, ttlSeconds = 300) {
|
||||
async setWebVitals(vitals: unknown, ttlSeconds = 300) {
|
||||
return await cache.set('perf:webvitals', vitals, ttlSeconds);
|
||||
}
|
||||
};
|
||||
@@ -64,7 +64,7 @@ export const userCache = {
|
||||
return await cache.get(`user:session:${sessionId}`);
|
||||
},
|
||||
|
||||
async setSession(sessionId: string, data: any, ttlSeconds = 86400) {
|
||||
async setSession(sessionId: string, data: unknown, ttlSeconds = 86400) {
|
||||
return await cache.set(`user:session:${sessionId}`, data, ttlSeconds);
|
||||
},
|
||||
|
||||
@@ -76,7 +76,7 @@ export const userCache = {
|
||||
return await cache.get(`user:prefs:${userId}`);
|
||||
},
|
||||
|
||||
async setUserPreferences(userId: string, prefs: any, ttlSeconds = 86400) {
|
||||
async setUserPreferences(userId: string, prefs: unknown, ttlSeconds = 86400) {
|
||||
return await cache.set(`user:prefs:${userId}`, prefs, ttlSeconds);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user