pnpm format:check fails on main with 211 unformatted files, and CI never runs it

Cerrado Apto para principiantes
#260 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
62/100
Tipo de issue
Refactorización
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
github-actions, typescript
Área
ci-cd, tooling

Línea de trabajo

Empieza por el script format:check de package.json (línea 37), que ejecuta prettier --check ., y por los archivos .prettierrc.json y .prettierignore. Ejecuta pnpm format en local y haz commit solo del resultado, decidiendo antes si design-system/preview/*.html y design-system/ui_kits/** deben añadirse a .prettierignore. Después añade pnpm format:check al job de .github/workflows/ci.yml, cerca de las líneas 54-59. Está terminado cuando pnpm format:check pasa en main y CI falla un PR que rompe el formato.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

good first issue

Found while checking the formatting of a small change: most of what Prettier flagged had nothing to do with the change.

What happened

On a clean checkout of main (commit f8e9bc0), pnpm format:check fails:

Code style issues found in 211 files. Run Prettier with --write to fix.

That is 211 of roughly 400 files Prettier looks at. A contributor who runs pnpm format before a commit gets a diff full of unrelated files. A contributor who does not run it adds to the pile.

Where the 211 files are:

Where Files
src/app 50
src/components 32
design-system 26
src/lib 25
src/oauth 20
src/mcp 16
src/auth 9
src/services 7
repo root (CHANGELOG.md, CLAUDE.md, three config files) 5
src/db 5
src/email 4
src/schemas 3
tests, scripts, evals, docs 2 each
src/jobs 1

By type: 114 .ts, 61 .tsx, 17 .html, 7 .jsx, 7 .md, 2 .mjs, 2 .css, 1 .json.

Why

  • format:check is prettier --check . (package.json:37). The config (.prettierrc.json) and .prettierignore are in place, so the check itself is sound.
  • CI never runs it. The ci.yml job runs pnpm lint, pnpm typecheck, pnpm test, pnpm test:db and pnpm build (.github/workflows/ci.yml:54-59), and the e2e job. Nothing fails a PR for formatting, so the drift built up one PR at a time.
  • CONTRIBUTING.md and CLAUDE.md ask for pnpm lint && pnpm typecheck && pnpm test before a PR. The formatter is not part of that line.

Suggested fix

  1. One PR that only runs pnpm format and commits the result. No other change in it, so it is easy to review and easy to rebase over. Merge it when few other PRs are open, because it will conflict with most of them.
  2. Decide whether design-system/preview/*.html and design-system/ui_kits/** should be formatted at all. If they are generated or copied in, add them to .prettierignore instead.
  3. Add - run: pnpm format:check to the CI job next to pnpm lint (.github/workflows/ci.yml:54), in the same PR or straight after, so it stays clean.
  4. Optional: add the formatting commit's hash to a .git-blame-ignore-revs file, so git blame skips it. GitHub reads that file without any setup.
  5. Optional: add pnpm format:check to the "before any PR" line in CONTRIBUTING.md and CLAUDE.md.

Done when

  • pnpm format:check passes on main.
  • CI fails a PR that breaks it.
  • pnpm lint && pnpm typecheck && pnpm test still pass after the formatting PR.

🤖 Generated with Claude Code

Lenguaje dominante
TypeScript
Estrellas
19
Forks
4
Merge medio
21 h 17 min
PR fusionados (30 d)
205

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de richshaw/OpenSignup

Todos los issues de richshaw/OpenSignup

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.