Skip to content

refactor(superdoc): mechanical residual checkJs fixes (SD-2867)#3088

Merged
caio-pizzol merged 3 commits into
mainfrom
caio/SD-2867-mechanical-residual
May 2, 2026
Merged

refactor(superdoc): mechanical residual checkJs fixes (SD-2867)#3088
caio-pizzol merged 3 commits into
mainfrom
caio/SD-2867-mechanical-residual

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

SD-2867 residual cluster, strictly mechanical fixes only. Each change is a JSDoc cast, a non-null assertion via optional-chain on a typed-optional method, or local narrowing β€” no public typedef changes, no behavior changes beyond what the type system already guaranteed at runtime.

Included (7 errors closed):

  • Object.keys narrowing (#initDocuments): pass the captured doc local instead of refetching this.config.document. The local was already narrowed by !!doc && typeof doc === 'object'; refetching re-widens to the full union and trips the overload.
  • storeDocs implicit-any[] (4 sites: #setStoreDocumentCollaboration, #resolveUpgradeTarget, navigateTo, scrollToElement): annotate the const storeDocs = this.superdocStore?.documents assignment as RuntimeDocument[] | undefined. The Pinia store currently emits Ref<never[]> which infers any[]; the explicit annotation overrides.
  • docs implicit-any[] (the comments-config viewing path): same pattern.
  • Yjs metaMap.observe event param: type as import('yjs').YMapEvent<unknown>. Closes the implicit-any without pulling broader Yjs type cascade.
  • cancelWebsocketRetry optional-chain: cfg.socket?.cancelWebsocketRetry?.(). The method is typed optional on HocuspocusProviderWebsocket but always present at runtime; the chain is a runtime no-op if the typedef ever drifts. disconnect/destroy on the same lines stay as-is β€” they're not optional on the typedef.

Explicitly out of scope (deferred):

  • uuid TS7016: needs @types/uuid added to the workspace catalog or an ambient declaration. That's a dep/catalog change, not a code typing fix; lands in a separate PR.
  • TS2740 provider widening, SearchMatch shape, DocumentMode literal, runtime-default mismatches: each touches public typedefs or runtime defaults; per-site review needed, not a misc-cleanup bucket.
  • TS2339 cascade: most depend on SD-2915 (Pinia store deep-any) clearing.

Verified:

  • pnpm --filter superdoc check:jsdoc β†’ 3 gated files clean
  • pnpm --filter superdoc build:es β†’ no FAIL-level findings
  • node tests/consumer-typecheck/typecheck-matrix.mjs β†’ 33 passed, 0 failed

@caio-pizzol caio-pizzol requested a review from a team as a code owner May 2, 2026 11:56
@linear
Copy link
Copy Markdown

linear Bot commented May 2, 2026

Base automatically changed from caio/SD-2867-type-mismatch-cluster to main May 2, 2026 12:00
@caio-pizzol caio-pizzol force-pushed the caio/SD-2867-mechanical-residual branch from 1148792 to caecd31 Compare May 2, 2026 12:04
@codecov-commenter

This comment was marked as outdated.

@caio-pizzol caio-pizzol merged commit 887ee2a into main May 2, 2026
72 checks passed
@caio-pizzol caio-pizzol deleted the caio/SD-2867-mechanical-residual branch May 2, 2026 14:15
@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 2, 2026

πŸŽ‰ This PR is included in @superdoc-dev/mcp v0.3.0-next.34

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 2, 2026

πŸŽ‰ This PR is included in @superdoc-dev/react v1.2.0-next.76

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 2, 2026

πŸŽ‰ This PR is included in vscode-ext v2.3.0-next.78

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 2, 2026

πŸŽ‰ This PR is included in superdoc v1.30.0-next.35

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 2, 2026

πŸŽ‰ This PR is included in superdoc-cli v0.8.0-next.52

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 2, 2026

πŸŽ‰ This PR is included in superdoc-sdk v1.8.0-next.38

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 7, 2026

πŸŽ‰ This PR is included in superdoc-cli v0.9.0

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 7, 2026

πŸŽ‰ This PR is included in superdoc v1.32.0

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 7, 2026

πŸŽ‰ This PR is included in @superdoc-dev/mcp v0.4.0

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 7, 2026

πŸŽ‰ This PR is included in @superdoc-dev/react v1.3.0

The release is available on GitHub release

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 7, 2026

πŸŽ‰ This PR is included in vscode-ext v2.4.0

@superdoc-bot
Copy link
Copy Markdown
Contributor

superdoc-bot Bot commented May 15, 2026

πŸŽ‰ This PR is included in superdoc-sdk v1.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants