Repository navigation
fix: no-explicit-any en e2e/offline-full-flow.spec.ts, decimotercer batch (201 -> 184) - #100
Merged
Merged
Conversation
…atch (201 -> 184)
e2e/fixtures.ts: getRequestQueue/getSyncQueue en el ambient __bambu (agregado
en el batch anterior) pasan de Promise<unknown[]> a Promise<OfflineRequest[]>/
Promise<SyncQueueItem[]>, importando los tipos reales ya definidos en
src/lib/db/offline.ts (mismas interfaces que usa offlineDb.requestQueue/
syncQueue). Esto no rompe la asignacion real en connectivity-indicator.tsx
(esa linea castea aparte via "as unknown as {...}" con su propio tipo
inline, independiente de esta declaracion global) y le da a todo spec de
e2e/ que llame __bambu.getRequestQueue() campos reales (offlineId, method,
url, localEndpoint, createdAt, attempts, etc.) en vez de unknown.
e2e/offline-full-flow.spec.ts (17 ocurrencias):
- (window as any).__bambu !== undefined -> window.__bambu !== undefined
- (window as any).__bambu.X(...) -> window.__bambu!.X(...) / const bambu =
window.__bambu! (mismo "!" legitimo del batch anterior: cada test hace
waitForFunction(() => window.__bambu !== undefined) antes de usarlo).
- queueFull.every((q: any) => q.offlineId === offlineId) -> anotacion
removida; q ya se infiere como OfflineRequest gracias al tipado de
getRequestQueue() en fixtures.ts.
Verificacion:
- npx eslint e2e/offline-full-flow.spec.ts e2e/fixtures.ts --max-warnings 999 -> limpio
- npx tsc --noEmit (repo completo, sobre main actualizado con PR #99) -> 0 errores
(el primer intento con getRequestQueue() sin tipar rompio 4 sitios via tsc
-- Object is of type unknown / no overload matches -- corregido tipando
OfflineRequest/SyncQueueItem en fixtures.ts antes de cerrar el batch)
- npx eslint . --max-warnings 999 --format json -> total 201 -> 184 (-17,
no-explicit-any 136 -> 119, delta exacto = 17 ocurrencias corregidas)
- npx vitest run (repo completo) -> 233 archivos, 2461 tests, 0 fallos, 0 regresiones
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
casasleonj
pushed a commit
that referenced
this pull request
Aug 21, 2026
…, decimocuarto batch (184 -> 172) Mismo patron mecanico de los 2 batches anteriores (window.__bambu ya tipado en e2e/fixtures.ts): - (window as any).__bambu !== undefined -> window.__bambu !== undefined - (window as any).__bambu.X(...) / const api = (window as any).__bambu -> window.__bambu!.X(...) / const api = window.__bambu! (guardado por waitForFunction(() => window.__bambu !== undefined) antes de usarse). Bug real encontrado y corregido como efecto directo de tipar syncWithServer() (ya tipado en fixtures.ts desde el batch 12): el test "doble clic offline" leia `syncResult.conflict` (singular), un campo que NO existe en SyncResult (src/lib/db/sync.ts) -- el campo real es `conflicts` (plural). Con `any`, `syncResult.conflict` evaluaba silenciosamente a `undefined` y `(syncResult.conflict ?? 0)` caia siempre a 0, por lo que el assert `expect(created).toBe(2)` en la practica solo verificaba `synced === 2`, nunca sumaba los conflicts reales -- exactamente el tipo de asercion mas debil de lo que el comentario del propio test describe. tsc lo catcheo solo (TS2551: Property 'conflict' does not exist... Did you mean 'conflicts'?) al quitar el any. Corregido a `syncResult.conflicts`. Verificacion: - npx eslint e2e/flujo-crear-pedido-offline-mobile.spec.ts --max-warnings 999 -> limpio - npx tsc --noEmit (repo completo, sobre main actualizado con PR #100) -> 0 errores (el primer intento fallo con TS2551 en syncResult.conflict, corregido antes de cerrar el batch) - npx eslint . --max-warnings 999 --format json -> total 184 -> 172 (-12, no-explicit-any 119 -> 107, delta exacto = 12 ocurrencias corregidas) - npx vitest run (repo completo) -> 233 archivos, 2461 tests, 0 fallos, 0 regresiones
casasleonj
added a commit
that referenced
this pull request
Aug 21, 2026
…, decimocuarto batch (184 -> 172) Mismo patron mecanico de los 2 batches anteriores (window.__bambu ya tipado en e2e/fixtures.ts): - (window as any).__bambu !== undefined -> window.__bambu !== undefined - (window as any).__bambu.X(...) / const api = (window as any).__bambu -> window.__bambu!.X(...) / const api = window.__bambu! (guardado por waitForFunction(() => window.__bambu !== undefined) antes de usarse). Bug real encontrado y corregido como efecto directo de tipar syncWithServer() (ya tipado en fixtures.ts desde el batch 12): el test "doble clic offline" leia `syncResult.conflict` (singular), un campo que NO existe en SyncResult (src/lib/db/sync.ts) -- el campo real es `conflicts` (plural). Con `any`, `syncResult.conflict` evaluaba silenciosamente a `undefined` y `(syncResult.conflict ?? 0)` caia siempre a 0, por lo que el assert `expect(created).toBe(2)` en la practica solo verificaba `synced === 2`, nunca sumaba los conflicts reales -- exactamente el tipo de asercion mas debil de lo que el comentario del propio test describe. tsc lo catcheo solo (TS2551: Property 'conflict' does not exist... Did you mean 'conflicts'?) al quitar el any. Corregido a `syncResult.conflicts`. Verificacion: - npx eslint e2e/flujo-crear-pedido-offline-mobile.spec.ts --max-warnings 999 -> limpio - npx tsc --noEmit (repo completo, sobre main actualizado con PR #100) -> 0 errores (el primer intento fallo con TS2551 en syncResult.conflict, corregido antes de cerrar el batch) - npx eslint . --max-warnings 999 --format json -> total 184 -> 172 (-12, no-explicit-any 119 -> 107, delta exacto = 12 ocurrencias corregidas) - npx vitest run (repo completo) -> 233 archivos, 2461 tests, 0 fallos, 0 regresiones Co-authored-by: Claude <[email protected]>
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.
Resumen
Decimotercer batch de la limpieza de deuda de
@typescript-eslint/no-explicit-any. Reduce el total de issues de eslint del repo de 201 a 184 (-17). Todas las 17 ocurrencias estaban ene2e/offline-full-flow.spec.ts.Cambios
e2e/fixtures.ts:getRequestQueue/getSyncQueueen el ambient__bambu(agregado en el batch anterior) pasan dePromise<unknown[]>aPromise<OfflineRequest[]>/Promise<SyncQueueItem[]>, importando los tipos reales ya definidos ensrc/lib/db/offline.ts(mismas interfaces que usaofflineDb.requestQueue/syncQueue). Esto no rompe la asignacion real enconnectivity-indicator.tsx(esa linea castea aparte viaas unknown as {...}con su propio tipo inline, independiente de esta declaracion global) y le da a todo spec dee2e/que llame__bambu.getRequestQueue()campos reales (offlineId,method,url,localEndpoint,createdAt,attempts, etc.) en vez deunknown.e2e/offline-full-flow.spec.ts(17 ocurrencias):(window as any).__bambu !== undefined->window.__bambu !== undefined(window as any).__bambu.X(...)->window.__bambu!.X(...)/const bambu = window.__bambu!(mismo!legitimo del batch anterior: cada test hacewaitForFunction(() => window.__bambu !== undefined)antes de usarlo).queueFull.every((q: any) => q.offlineId === offlineId)-> anotacion removida;qya se infiere comoOfflineRequestgracias al tipado degetRequestQueue()enfixtures.ts.Verificacion
npx eslint e2e/offline-full-flow.spec.ts e2e/fixtures.ts --max-warnings 999-> limpionpx tsc --noEmit(repo completo, sobre main actualizado con PR fix: no-explicit-any en e2e/mobile-offline-comprehensive.spec.ts, decimosegundo batch (219 -> 201) #99) -> 0 errores (el primer intento congetRequestQueue()sin tipar rompio 4 sitios via tsc —Object is of type unknown/no overload matches— corregido tipandoOfflineRequest/SyncQueueItemenfixtures.tsantes de cerrar el batch)npx eslint . --max-warnings 999 --format json-> total 201 -> 184 (-17,no-explicit-any136 -> 119, delta exacto = 17 ocurrencias corregidas)npx vitest run(repo completo) -> 233 archivos, 2461 tests, 0 fallos, 0 regresionesNota sobre CI
El job
e2eesta desactivado temporalmente (if: falseen.github/workflows/ci.yml) mientras dure esta limpieza de lint, por instruccion explicita del usuario — se revertira una vez resueltos todos los issues restantes.Type check + TestsyLint (non-blocking)corren normalmente.Generated by Claude Code