Repository navigation
refactor(backend): quitar los any restantes y hacer no-explicit-any error - #10
Merged
Merged
Conversation
- user-repository.ts: replace 6 'catch (error: any)' with 'catch (error)' and type assertions for .code and .message access
- user-repository.ts: replace 'as any' with explicit type 'Error & { code?: string }' for the duplicate entry error
- user-controllers.ts: replace 'catch (error: any)' with 'catch (error)' and type assertion for .message access
- Pattern used: (error as { code?: string }).code and (error as Error).message
- db-config.ts: ssl?: any → ssl?: object - cron-service.ts: results?: any → results?: unknown - checklist-report.ts: replace 9 any with proper types: - Import RowDataPacket from mysql2 - Define interfaces RunRow, StepRow, CommentRow extending RowDataPacket - Use db.query<RowType[]> instead of (db as any).query - Replace (d: any) with (d: unknown) in fmt function - Remove all (s: any) and (c: any) from callbacks
- demo-restriction.test.ts: replace 9 'as any' with 'as unknown as Request[...]' or 'as unknown' for socket, user, headers, and mock access - user-repository-login.test.ts: import RowDataPacket, replace db.query<any[]> with db.query<RowDataPacket[]>, replace (user as any) with (user as Record<string, unknown>) - checklist.test.ts: import RowDataPacket, replace 7 'const [rows]: any' with 'const [rows] = await db.query<RowDataPacket[]>', remove (r: any) from callback - employee-requests-repository.test.ts: import RowDataPacket, replace 'const [users]: any' with 'const [users] = await db.query<RowDataPacket[]>'
- Change '@typescript-eslint/no-explicit-any' from 'warn' to 'error' in eslint.config.js - Remove outdated comment about 341 existing uses (now 0) - All code is now free of explicit any types
- Remove the "55 uses of any left in the backend" entry. Why: auth, config, cron, scripts and tests are typed and no-explicit-any is an error again; the backend lint reports 0 problems.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cambios
anyque quedaban en auth, cron, config, scripts y tests.no-explicit-anypasa de aviso a error en el lint del backend.docs/TODO.md: se borra el punto, ya hecho.Por qué
Los
anyescondían errores de tipos; con la regla como error no vuelven a entrar.