Repository navigation
fix: no-explicit-any en e2e/critical-flows.spec.ts, decimonoveno batch (137 -> 133) - #106
Merged
Merged
Conversation
…h (137 -> 133)
Las 4 ocurrencias eran variables mutadas dentro de un page.route(...)
handler y leidas despues en el test (apiResponse, requestBody x2) mas un
dialog: any en page.on('dialog', ...).
- page.on('dialog', async (dialog: any) => ...) -> anotacion removida,
Page.on('dialog', ...) ya tipa el callback como (dialog: Dialog) => void
contextualmente.
- apiResponse/requestBody: tipar directamente "let x: {...} | null = null"
parece lo obvio, pero rompe tsc con TS2339 "Property does not exist on
type 'never'" (apiResponse) y TS18047 "possibly null" (requestBody) --
la asignacion real ocurre dentro de un closure pasado a page.route(),
que TS no considera al hacer control-flow narrowing de una variable let
fuera del closure; la lectura posterior queda narrowed al valor inicial
(null) en vez de ensancharse de vuelta al tipo declarado. Confirmado
reproduciendo el patron minimo en un archivo temporal dentro de e2e/.
Fix: declarar la variable como "unknown" (nombre con sufijo Raw) y
castear explicitamente en el punto de lectura, patron tambien
verificado en aislamiento antes de aplicarlo. Sin este ajuste no habria
sido posible eliminar el any sin comprometer el chequeo de tipos real.
Verificacion:
- npx eslint e2e/critical-flows.spec.ts --max-warnings 999 -> limpio
- npx tsc --noEmit (repo completo, sobre main actualizado con PR #105) -> 0 errores
(el intento inicial con tipos union directos fallo con 8 errores TS2339/
TS18047 -- corregido con el patron unknown + cast antes de cerrar el batch)
- npx eslint . --max-warnings 999 --format json -> total 137 -> 133 (-4,
no-explicit-any 72 -> 68, delta exacto = 4 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
… 129)
Mismo patron del batch 15 (embarques-stats.spec.ts): page: any en
embarquesLogin/gotoEmbarques/cerrarEmbarqueTest -> page: Page (import
type de @playwright/test), lo que hace que el route: any interno de
page.route('**/api/cierre/last', async (route: any) => {...}) tambien
quede tipado sin anotacion explicita (contexto real desde Page.route).
Verificacion:
- npx eslint e2e/embarques.spec.ts --max-warnings 999 -> limpio
- npx tsc --noEmit (repo completo, sobre main actualizado con PR #106) -> 0 errores
- npx eslint . --max-warnings 999 --format json -> total 133 -> 129 (-4,
no-explicit-any 68 -> 64, delta exacto = 4 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
… 129)
Mismo patron del batch 15 (embarques-stats.spec.ts): page: any en
embarquesLogin/gotoEmbarques/cerrarEmbarqueTest -> page: Page (import
type de @playwright/test), lo que hace que el route: any interno de
page.route('**/api/cierre/last', async (route: any) => {...}) tambien
quede tipado sin anotacion explicita (contexto real desde Page.route).
Verificacion:
- npx eslint e2e/embarques.spec.ts --max-warnings 999 -> limpio
- npx tsc --noEmit (repo completo, sobre main actualizado con PR #106) -> 0 errores
- npx eslint . --max-warnings 999 --format json -> total 133 -> 129 (-4,
no-explicit-any 68 -> 64, delta exacto = 4 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
Decimonoveno batch de la limpieza de deuda de
@typescript-eslint/no-explicit-any. Reduce el total de issues de eslint del repo de 137 a 133 (-4). Todas las 4 ocurrencias estaban ene2e/critical-flows.spec.ts.Cambios
Las 4 ocurrencias eran variables mutadas dentro de un
page.route(...)handler y leidas despues en el test (apiResponse,requestBodyx2) mas undialog: anyenpage.on('dialog', ...).page.on('dialog', async (dialog: any) => ...)-> anotacion removida,Page.on('dialog', ...)ya tipa el callback como(dialog: Dialog) => voidcontextualmente.apiResponse/requestBody: tipar directamentelet x: {...} | null = nullparece lo obvio, pero rompetscconTS2339 "Property does not exist on type 'never'"(apiResponse) yTS18047 "possibly null"(requestBody) — la asignacion real ocurre dentro de un closure pasado apage.route(), que TS no considera al hacer control-flow narrowing de una variableletfuera del closure; la lectura posterior queda narrowed al valor inicial (null) en vez de ensancharse de vuelta al tipo declarado. Confirmado reproduciendo el patron minimo en un archivo temporal dentro dee2e/. Fix: declarar la variable comounknown(nombre con sufijoRaw) y castear explicitamente en el punto de lectura, patron tambien verificado en aislamiento antes de aplicarlo. Sin este ajuste no habria sido posible eliminar elanysin comprometer el chequeo de tipos real.Verificacion
npx eslint e2e/critical-flows.spec.ts --max-warnings 999-> limpionpx tsc --noEmit(repo completo, sobre main actualizado con PR fix: no-explicit-any en 09-realistic-day/00-fixtures.ts, decimoctavo batch (142 -> 137) #105) -> 0 errores (el intento inicial con tipos union directos fallo con 8 erroresTS2339/TS18047— corregido con el patronunknown+ cast antes de cerrar el batch)npx eslint . --max-warnings 999 --format json-> total 137 -> 133 (-4,no-explicit-any72 -> 68, delta exacto = 4 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