chore: fix TypeScript code quality violations from May 2026 audit
Los mantenedores suelen responder en 2 días
Ya se ha fusionado un pull request relacionado.
- #1230 de @prx-my — fusionado
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 84/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
Línea de trabajo
Elige un punto y comenta en el issue antes de empezar. Lee el archivo indicado y las constantes o mensajes existentes cercanos, conserva las grafías y el alcance especificados y luego ejecuta npm test y npm run build; estar terminado significa que la refactorización seleccionada está completa sin combinar puntos.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Small, self-contained refactors from a code-quality audit. Each bullet below is its own task and its own PR - please do not try to do them all in one. Comment on the issue saying which one you are taking so others can see, though the first working PR is the one that lands.
Re-verified against main on 2026-09-16, so the counts and paths below are current.
1. Extract the CLI flag literals in src/cli/args.ts
39 distinct flag strings ("--json", "--all", "--offline" and so on) appear as inline literals, 55 occurrences in total. Extract them into named constants so a typo becomes a compile error rather than a silently unrecognised flag. src/constants.ts already holds this kind of thing (DEFAULT_BATCH_SIZE, CACHE_TTL_MS) and is a reasonable home, or a dedicated src/cli/flags.ts if that reads better.
Good first issue. Mechanical, but please keep the flag spellings byte-identical - the tests and the docs both depend on them.
2. Extract the install command in src/utils/update-check.ts
src/utils/update-check.ts:98 has npm install -g cve-lite-cli inline. The registry URL right above it is already a named constant (NPM_REGISTRY_URL), so this is following an established pattern in the same file.
Good first issue, genuinely a few lines.
3. De-duplicate the flag-conflict errors in src/cli/validate.ts
Seven near-identical --X cannot be used with --Y messages. Extract a helper that takes the two flag names and builds the message, so the wording stays consistent when the eighth one is added.
4. Add braces to the remaining single-line if statements
Corrected 2026-09-27: ten in src/cli/args.ts and one in src/index.ts:131, so eleven in total. This previously said eight and one. For example src/cli/args.ts:74:
if (!val) throw new Error("--ca-cert requires a path argument");
Note this was previously filed as #1089 and closed as not-planned, so it is genuinely still open. There is no linter enforcing it yet; adding ESLint with curly is tracked separately as #1091, and that will supersede this task if it lands first.
Not in scope
scanPackages in src/scanner.ts is 1122 lines and well past our 60-line guideline, but it is core scanner internals and is being handled in-house. Please do not refactor it as part of this issue.
Already fixed, please do not re-report
The original May 2026 audit listed several items that have since been resolved. Leaving them here so nobody spends time re-finding them:
- Nested ternary in
src/output/formatters.ts- now an else-if chain batchSize/searchDepth- nowDEFAULT_BATCH_SIZE/DEFAULT_SEARCH_DEPTHinsrc/constants.ts- Cache TTL - now
CACHE_TTL_MS - The npm registry URL - now
NPM_REGISTRY_URL - The
src/index.tsline references from the old audit are stale; that file was reduced from 973 lines to 191 in #1129, and the advisory-DB warnings it mentioned now live insrc/scan/single-scan.ts
Before you open a PR
Run npm test and npm run build. Keep each PR to one bullet above.
- Lenguaje dominante
- TypeScript
- Estrellas
- 801
- Forks
- 204
- Merge medio
- 3 d 11 h
- PR fusionados (30 d)
- 135
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de OWASP/cve-lite-cli
-
docs(website): add a GitLab CI/CD button next to the GitHub Action button on the homepagePosiblemente ocupada @shryssssss-maker la tomó hoy. Abiertodocumentation enhancement first-timers-only good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
OWASP/cve-lite-cli#1739 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
[Bug] fix(remediation): parent upgrade rejected when child range is bumped past exact fix versionPosiblemente ocupada @coder-Yash886 la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
OWASP/cve-lite-cli#1720 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
fix: pnpm fix commands for workspace-root dependencies omit -wPosiblemente ocupada @sarankumar1325 la tomó hace 10 días. Abiertobug help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
OWASP/cve-lite-cli#1582 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
CVE Lite CLI — Public Adoption TrackerQuizá libre de nuevo @Darshan3690 la tomó hace 24 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
OWASP/cve-lite-cli#1396 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
bug: chain-upgrade fixes always warn that another path may need a separate upgradePosiblemente ocupada @Medhansh-741 la tomó hoy. Abiertobug help wanted
OWASP/cve-lite-cli#1736 · 8 comentarios · 1 asignado ·
Los mantenedores suelen responder en 2 días
Todos los issues de OWASP/cve-lite-cli
Issues similares
-
awaiting-final-review request-icon
Dificultad 1/5 Menos de una hora Aptitud para principiantes 70/100
homebridge/plugins#1376 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mindfold-ai/Trellis#672 ·
-
p1 state:active track
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
StellarCanary/ProtocolCanary-Action#698 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
pear-devs/pear-desktop#4839 ·
Los mantenedores suelen responder en 1 día