GeezerVison is showing github.com — chore(tsconfig): turn off the Schema-over-JSON diagnostic in test files by esthor · Pull Request #16375 · pingdotgg/t3code
Conversation
esthor
commented
Oct 6, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Problem
Test files carry 219 exceptions to preferSchemaOverJson, the diagnostic that steers code from raw JSON.parse and JSON.stringify to Schema. Most give no reason. In tests, raw JSON is usually the point: fixtures are written as JSON strings, and assertions inspect the exact wire body or persisted file before any schema decodes it.
Change
- The override. One
overrides entry in tsconfig.base.json turns preferSchemaOverJson off for *.test.ts and *.test.tsx. The policy is then stated once instead of 219 times.
- The removed exceptions. They go from 33 test files. 3 file-level directives that also cover other rules keep those rules and their reasons.
- Unchanged. Source files, and test helpers outside
*.test.ts(x), keep the rule at error. Tests keep every other diagnostic, including nodeBuiltinImport, where chore(deps): upgrade @effect/tsgo to 0.46.1 #16360 left exceptions only for APIs Effect's Crypto lacks.
Scope and approval
Typecheck config and comment removals only; no runtime change. It turns off, for test files only, a diagnostic @juliusmarminge enabled in #2596, so it's his call. I work at CodeRabbit.
Verification
- Typecheck.
tsc --noEmit passes with no errors or warnings in every workspace package: desktop, mobile, server, web, relay, the lint plugin, client-runtime, contracts, effect-acp, effect-codex-app-server, shared, ssh, tailscale, and scripts.
- The override does the work, and only in tests. With its severity emptied, 254
preferSchemaOverJson errors come back, in 31 test files across server, web, and client-runtime, and none outside test files. Some removed exceptions covered a whole file.
- Comments kept. Comments above a removed exception still describe the test code, such as "Inspect raw persisted JSON before schema decoding can apply defaults.", so they stay.
- Formatting and lint.
vp fmt rejoined four calls that fit on one line once their exception was gone, and vp fmt --check passes. vp lint on the changed files reports only two existing warnings in serverSettings.test.ts.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XS
0-9 changed lines (additions + deletions).
vouch:trusted
Author is trusted by repo permissions or the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|