Skip to content

chore(lint): limpiar los 13 warnings de no-unused-vars#2

Merged
gonzalezulises merged 1 commit into
mainfrom
chore/clean-unused-vars
Jun 8, 2026
Merged

chore(lint): limpiar los 13 warnings de no-unused-vars#2
gonzalezulises merged 1 commit into
mainfrom
chore/clean-unused-vars

Conversation

@gonzalezulises

Copy link
Copy Markdown
Owner

Limpia los 13 warnings de @typescript-eslint/no-unused-vars que quedaban tras el PR #1. Dos categorías, dos enfoques:

Patrones intencionales (9) → config, no reescribir código

const { id, ...rest } = x descarta id/caseId a propósito antes de insertar en la DB (el patrón de seguridad de FK que agregaron tus commits recientes). Los nombres con prefijo _ (_id, _caseId) marcan bindings intencionalmente sin usar. Borrarlos reintroduciría bugs, así que el fix correcto es configurar la regla:

  • ignoreRestSiblings: true
  • argsIgnorePattern / varsIgnorePattern / caughtErrorsIgnorePattern / destructuredArrayIgnorePattern: "^_"

Afecta: plan.ts, prioritization.ts, risks.ts, tracking.ts, vsm.ts, weekly-tracking.tsx.

Código muerto (4) → eliminar

  • case-context-form.tsx: imports sin usar Separator, SaveBar.
  • prioritization.test.ts: import sin usar DEFAULT_WEIGHTS.
  • action-plan-table.tsx: función statusBadge huérfana (el status se edita con un <select>, nunca se muestra como badge) + su import Badge, que quedaba sin uso.

Verificación

  • eslint .0 problemas (antes: 13 warnings)
  • tsc --noEmit → limpio
  • npm run test51 tests passed

🤖 Generated with Claude Code

Two kinds of warnings, two fixes:

- Intentional patterns (9 warnings): `const { id, ...rest } = x` strips
  fields before DB insert (the FK-safety pattern recent commits added) and
  `_`-prefixed names mark intentionally-unused bindings. Configure
  @typescript-eslint/no-unused-vars with ignoreRestSiblings + ^_ ignore
  patterns instead of rewriting code (removing them would reintroduce bugs).
- Dead code (4 warnings): remove unused imports (Separator, SaveBar,
  DEFAULT_WEIGHTS) and the orphaned statusBadge helper in action-plan-table
  (status is edited via a <select>, never badged) plus its now-unused Badge
  import.

Verified: eslint 0 problems, tsc --noEmit clean, 51 tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
opsflow Ready Ready Preview, Comment Jun 8, 2026 12:21pm

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request cleans up unused imports and helper functions across several files and configures ESLint to ignore intentional unused variables prefixed with an underscore. The reviewer suggested escalating the @typescript-eslint/no-unused-vars rule severity from "warn" to "error" to proactively prevent future unused variables from being introduced.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread eslint.config.mjs
Comment on lines +25 to +26
"@typescript-eslint/no-unused-vars": [
"warn",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Dado que has logrado limpiar todos los warnings existentes (0 problemas reportados por eslint .), es una excelente oportunidad para cambiar la severidad de la regla de "warn" a "error". Esto evitará de forma proactiva que se introduzcan nuevas variables no utilizadas en el futuro, asegurando que el código se mantenga limpio y libre de código muerto.

Suggested change
"@typescript-eslint/no-unused-vars": [
"warn",
"@typescript-eslint/no-unused-vars": [
"error",

@gonzalezulises gonzalezulises merged commit 66fd076 into main Jun 8, 2026
5 checks passed
@gonzalezulises gonzalezulises deleted the chore/clean-unused-vars branch June 8, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants