Skip to content

chore: enable strict mode in demos/freelance-escrow's tsconfig - #103

Merged
collinsezedike merged 1 commit into
drydocs:mainfrom
ZuLu0890:chore/freelance-escrow-strict-mode
Aug 19, 2026
Merged

chore: enable strict mode in demos/freelance-escrow's tsconfig#103
collinsezedike merged 1 commit into
drydocs:mainfrom
ZuLu0890:chore/freelance-escrow-strict-mode

Conversation

@ZuLu0890

@ZuLu0890 ZuLu0890 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #95

demos/freelance-escrow/tsconfig.app.json was not running TypeScript in strict mode. Only three lint-oriented flags were enabled explicitly — noUnusedLocals, noUnusedParameters, and noFallthroughCasesInSwitch — while the entire strict family (strictNullChecks, noImplicitAny, strictFunctionTypes, strictPropertyInitialization, etc.) was left at its default of off. The demo app's code happened to be well-typed, so nothing looked wrong day-to-day, but the compiler was not actually enforcing it: a regression that introduced a null leak, an implicit any, or a misused this would have sailed through pnpm build and CI undetected.

This PR adds a single line — "strict": true — to tsconfig.app.json's compilerOptions. It is a type-checking tightening only: no source files changed, no runtime behavior changed, and no emitted JavaScript is affected.

The change

     "moduleDetection": "force",
     "noEmit": true,
     "jsx": "react-jsx",
+    "strict": true,

     /* Linting */
     "noUnusedLocals": true,

One file touched, one line added. The diff is intentionally minimal and scoped exactly to what the issue asks for.

What strict: true actually turns on

strict is a meta-flag that enables the entire strict family. Confirmed via tsc --showConfig -p tsconfig.app.json, the app project's effective compiler options now include:

Flag Effect
noImplicitAny Errors on parameters/variables with an implicit any type
noImplicitThis Errors on this expressions with an implicit any type
strictNullChecks Makes null/undefined explicit in the type system
strictFunctionTypes Enforces contravariant function parameter checking
strictBindCallApply Type-checks bind/call/apply against the target signature
strictPropertyInitialization Requires class properties to be initialized in the constructor
strictBuiltinIteratorReturn Types Iterator/Generator return values strictly
alwaysStrict Emits "use strict" and parses in strict mode
useUnknownInCatchVariables Types catch variables as unknown

The demo's previously-explicit noUnusedLocals / noUnusedParameters / noFallthroughCasesInSwitch remain in place and are unaffected.

Why no code changes were needed

The issue's proposed approach anticipated this: "the existing code already reads as well-typed; if it turns out to be large, say so in the PR rather than working around it." The code was indeed genuinely well-typed:

  • A clean tsc -b — after deleting node_modules/.tmp/*.tsbuildinfo to rule out incremental-cache false positives — surfaced zero errors across all 20 source files under src/.
  • Consequently there are no @ts-expect-error suppressions, // @ts-ignore comments, or any casts added anywhere. The PR is purely the config flip.
  • This is the outcome the issue explicitly preferred: the compiler now enforces the guarantee the code was already meeting, rather than papering over new failures.

Verification

All checks were run locally, mirroring the demo job in .github/workflows/ci.yml exactly (build the SDK first, install with a frozen lockfile, then lint and build):

  1. SDK prerequisitepackages/tholos-sdk was built first (pnpm install --frozen-lockfile && pnpm build), producing the dist/ that demos/freelance-escrow's file:../../packages/tholos-sdk dependency requires to resolve.
  2. Installpnpm install --frozen-lockfile in demos/freelance-escrow (no lockfile changes).
  3. Typecheck + buildpnpm build (tsc -b && vite build) ✅ passes from a clean state (deleted .tsbuildinfo first). vite build transformed 248 modules and emitted the production bundle successfully.
  4. Lintpnpm lint (oxlint) ✅ 0 warnings, 0 errors across 19 files.
  5. Config sanitytsc --showConfig -p tsconfig.app.json confirms "strict": true and the full strict family (strictNullChecks, noImplicitAny, …) are active.

Test plan checklist

  • pnpm build passes from a clean typecheck state
  • pnpm lint passes (0 warnings, 0 errors)
  • tsc --showConfig confirms strict and the strict family are active
  • Full demo CI path reproduced locally (SDK build → frozen install → lint → build)

Out of scope (deliberately not changed)

  • tsconfig.node.json covers only vite.config.ts (a 6-line config file). The issue scopes this work to tsconfig.app.json; extending strict mode to the node-side config would be a reasonable follow-up but is intentionally left out of this PR to keep it to the stated scope. Happy to do it in a separate PR if desired.
  • packages/tholos-sdk and the Rust contracts/ / tools/ crates are untouched. This is a demo-app-only change.
  • No other demos exist under demos/ today, so there's nothing else to align.

Risk assessment

  • Runtime risk: none. strict is a compile-time-only flag; no source files changed, so the emitted bundle is unchanged.
  • Maintenance risk: reduced. Future changes to the demo are now type-checked under the full strict family, so the class of bugs this issue describes (implicit any, null leaks, etc.) will be caught at build time rather than in production.
  • CI risk: none. The local demo job steps all pass; the PR's CI run is expected to go green.

Related

The app tsconfig only enabled noUnusedLocals/noUnusedParameters/
noFallthroughCasesInSwitch explicitly, leaving strictNullChecks,
noImplicitAny, and the rest of the strict family off by default. The
code happens to be well-typed, so flipping strict on surfaces no
errors; it just makes the compiler actually enforce it going forward.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>

@collinsezedike collinsezedike left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the contribution, feel free to pick up another open issue.

@collinsezedike
collinsezedike merged commit 32f07ac into drydocs:main Aug 19, 2026
3 checks passed
@collinsezedike

Copy link
Copy Markdown
Collaborator

Hey @ZuLu0890, really solid work on this one. The PR write-up was thorough, verification steps, risk assessment, and the out-of-scope notes all made it an easy review. This is also one of the few PRs here that's passed on a single review round. Hope you stick around, there's more open issues if you're interested in taking on another.

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.

[Chore] Enable strict mode in demos/freelance-escrow's tsconfig

2 participants