Skip to content

Check builder-frontend formatting and types in the test suite - #589

Merged
prestoncabe merged 2 commits into
mainfrom
builder-frontend-guardrails
Nov 5, 2026
Merged

prestoncabe merged 2 commits into
mainfrom
builder-frontend-guardrails

Conversation

@prestoncabe

Copy link
Copy Markdown
Collaborator

Summary

Until now CI only ran builder-frontend's tests. Prettier was partly applied (29 files under src didn't match), and tsc reported 187 errors, so neither could catch problems in new code.

 run_builder_frontend_suite        # bin/run-all-tests; CI runs it as `devbox run test -- builder-frontend`
   npm test
+  npm run format:check            # prettier --check src
+  npm run typecheck               # tsc, failing only when a file exceeds its baseline
+  # every check runs, and the suite fails if any did

The type check is a per-file ratchet:

typecheck
  count tsc errors per file
  fail if any file has more than typecheck-baseline.json allows   (a new file allows 0)
  note files that improved -> `npm run typecheck -- --update` lowers the baseline

The baseline drops from 187 to 151 errors:

  • @types/lodash and @types/lodash.debounce remove 13 errors.
  • skipLibCheck removes the errors inside library .d.ts files. Otherwise a dependency bump (Dependabot included) could fail the ratchet.

Commits:

  1. Format builder-frontend with Prettier: formatting only, 29 files. None of them is touched by Share one screening session between Preview and published screeners #586.
  2. Check builder-frontend formatting and types in the test suite: the scripts, the baseline, the type packages, skipLibCheck and the suite wiring. The README documents the new scripts.

Evidence

  • Before: prettier --check src listed 29 files, and tsc reported 187 errors with no way to tell which were new.
    After: devbox run test -- builder-frontend:
    Tests  389 passed (389)
    All matched files use Prettier code style!
    Type check passed: 151 type errors, none beyond the baseline.
    🎉 All selected test suites passed.
    
  • I trial-merged this branch with Share one screening session between Preview and published screeners #586 in a throwaway worktree. Format check, type check and tests (389) all pass, so the two PRs can merge in either order.
  • npm run build still succeeds with skipLibCheck; Vite doesn't type-check.

Merge Danger

Door: two-way

Revert the second commit to remove the checks. The formatting commit is harmless to keep.

Blast Radius: builder-frontend PRs

Open builder-frontend PRs now need Prettier-formatted code and no new type errors in the files they touch. Branches that touch any of the 29 reformatted files may need a rebase.

🤖 Generated with Claude Code

prestoncabe and others added 2 commits November 5, 2026 14:56
Formatting only: the 29 files under src that didn't match Prettier's
defaults.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The builder-frontend suite, which CI runs, now also checks Prettier
formatting and type-checks src against a per-file baseline of the
errors that exist today, failing only when a file gets more. Lodash
type definitions remove 13 of those errors, and skipLibCheck leaves
library type definitions to their authors, so dependency updates can't
trip the baseline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@prestoncabe
prestoncabe force-pushed the builder-frontend-guardrails branch from b421d8d to ce9e30d Compare November 5, 2026 19:56
@prestoncabe
prestoncabe merged commit 1411440 into main Nov 5, 2026
6 checks passed
@prestoncabe
prestoncabe deleted the builder-frontend-guardrails branch November 5, 2026 20:04
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.

1 participant