Skip to content

fix(docs): remove stale @ts-expect-error directives in docs examples#21928

Closed
benesjan wants to merge 1 commit into
nextfrom
jan/fix-docs-stale-ts-expect-error
Closed

fix(docs): remove stale @ts-expect-error directives in docs examples#21928
benesjan wants to merge 1 commit into
nextfrom
jan/fix-docs-stale-ts-expect-error

Conversation

@benesjan

@benesjan benesjan commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Docs build was broken and it resulted in flakes in 2 of my other PRs:

I am not exactly sure why this happened but the changes here seem harmless so I think we can just merge this to not cause pain to other people today.

AI Summary

  • Removed 9 unused @ts-expect-error directives from docs/examples/ts/example_swap/index.ts
  • Removed 6 unused @ts-expect-error directives from docs/examples/ts/token_bridge/index.ts

These directives were suppressing viem type inference errors for JSON-imported ABIs, but @aztec/viem@2.38.2 now handles this correctly. The stale directives cause TS2578: Unused '@ts-expect-error' directive errors during the docs examples validation pipeline (docs/bootstrap.sh).

Test plan

  • Verified example_swap passes tsc --noEmit locally
  • Verified token_bridge passes tsc --noEmit locally

🤖 Generated with Claude Code

…nd token_bridge

The viem type inference for JSON-imported ABIs now works correctly with
@aztec/viem@2.38.2, making these @ts-expect-error directives unused and
causing TS2578 build errors in the docs examples validation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@benesjan benesjan requested a review from a team as a code owner March 24, 2026 04:58
@benesjan

Copy link
Copy Markdown
Contributor Author

Affected files

  • docs/examples/ts/example_swap/index.ts — 9 @ts-expect-error directives removed across L1 contract interactions (portal init, token minting, approvals, deposits, readContract, writeContract calls)
  • docs/examples/ts/token_bridge/index.ts — 6 @ts-expect-error directives removed across L1 contract interactions (portal init, NFT minting, approvals, deposits, readContract, withdraw)

All directives had the same comment: // @ts-expect-error - viem type inference doesn't work with JSON-imported ABIs. The underlying viem issue has been resolved in @aztec/viem@2.38.2.

benesjan commented Mar 24, 2026

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@benesjan

Copy link
Copy Markdown
Contributor Author

Closing as I was retarded and didn't manage to read #enginnering channel where it was written that there is already a fix on next. Sadge

@benesjan benesjan closed this Mar 24, 2026
@benesjan benesjan deleted the jan/fix-docs-stale-ts-expect-error branch March 24, 2026 06:05
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