refactor(superdoc): mechanical residual checkJs fixes (SD-2867)#3088
Conversation
1148792 to
caecd31
Compare
This comment was marked as outdated.
This comment was marked as outdated.
|
π This PR is included in @superdoc-dev/mcp v0.3.0-next.34 The release is available on GitHub release |
|
π This PR is included in @superdoc-dev/react v1.2.0-next.76 The release is available on GitHub release |
|
π This PR is included in vscode-ext v2.3.0-next.78 |
|
π This PR is included in superdoc v1.30.0-next.35 The release is available on GitHub release |
|
π This PR is included in superdoc-cli v0.8.0-next.52 The release is available on GitHub release |
|
π This PR is included in superdoc-sdk v1.8.0-next.38 |
|
π This PR is included in superdoc-cli v0.9.0 The release is available on GitHub release |
|
π This PR is included in superdoc v1.32.0 The release is available on GitHub release |
|
π This PR is included in @superdoc-dev/mcp v0.4.0 The release is available on GitHub release |
|
π This PR is included in @superdoc-dev/react v1.3.0 The release is available on GitHub release |
|
π This PR is included in vscode-ext v2.4.0 |
|
π This PR is included in superdoc-sdk v1.9.0 |
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):
#initDocuments): pass the captureddoclocal instead of refetchingthis.config.document. The local was already narrowed by!!doc && typeof doc === 'object'; refetching re-widens to the full union and trips the overload.storeDocsimplicit-any[] (4 sites:#setStoreDocumentCollaboration,#resolveUpgradeTarget,navigateTo,scrollToElement): annotate theconst storeDocs = this.superdocStore?.documentsassignment asRuntimeDocument[] | undefined. The Pinia store currently emitsRef<never[]>which infersany[]; the explicit annotation overrides.docsimplicit-any[] (the comments-config viewing path): same pattern.metaMap.observeevent param: type asimport('yjs').YMapEvent<unknown>. Closes the implicit-any without pulling broader Yjs type cascade.cancelWebsocketRetryoptional-chain:cfg.socket?.cancelWebsocketRetry?.(). The method is typed optional onHocuspocusProviderWebsocketbut always present at runtime; the chain is a runtime no-op if the typedef ever drifts.disconnect/destroyon the same lines stay as-is β they're not optional on the typedef.Explicitly out of scope (deferred):
uuidTS7016: needs@types/uuidadded to the workspace catalog or an ambient declaration. That's a dep/catalog change, not a code typing fix; lands in a separate PR.SearchMatchshape,DocumentModeliteral, runtime-default mismatches: each touches public typedefs or runtime defaults; per-site review needed, not a misc-cleanup bucket.any) clearing.Verified:
pnpm --filter superdoc check:jsdocβ 3 gated files cleanpnpm --filter superdoc build:esβ no FAIL-level findingsnode tests/consumer-typecheck/typecheck-matrix.mjsβ 33 passed, 0 failed