Skip to content

fix: reposition orphaned JSDoc blocks in type-system.ts#1

Merged
feffef merged 1 commit into
mainfrom
fix/finding-06-type-system-jsdoc
Apr 17, 2026
Merged

fix: reposition orphaned JSDoc blocks in type-system.ts#1
feffef merged 1 commit into
mainfrom
fix/finding-06-type-system-jsdoc

Conversation

@feffef
Copy link
Copy Markdown
Owner

@feffef feffef commented Apr 17, 2026

Finding

FINDING-06 | WARNING | Style / Documentation
Location: src/type-system.ts:107-123 (orphaned), src/type-system.ts:302-321 (duplicated)

Two JSDoc blocks in type-system.ts were misaligned:

  1. The ConnectOptions JSDoc block sat before Verbosity's own JSDoc, so Verbosity got documented correctly but ConnectOptions was left with no attached docstring — tooling like TypeDoc and editor hovers showed no description for ConnectOptions, despite a correctly-written block existing just above.
  2. MergeInner had two adjacent JSDoc blocks. Tooling that attaches the closest-preceding block to a declaration silently dropped the description and kept only the @internal tag.

Concrete impact: a consumer hovering over ConnectOptions in their IDE sees no documentation, even though the library maintains a hand-written block. A contributor reading generated API docs for the internal MergeInner helper sees only @internal with no explanation of what the helper does.

Approach chosen: A — Pure JSDoc repositioning

Minimal, zero-risk comment rearrangement. The fix re-homes the ConnectOptions block and merges the MergeInner pair.

Alternatives considered

  • B — A + @see cross-refs: Add bi-directional @see tags between Verbosity and ConnectOptions.errorVerbosity. Rejected because errorVerbosity already references Verbosity, so the extra cross-ref is noise.
  • C — A + ESLint JSDoc plugin: Add eslint-plugin-jsdoc with a rule that prevents orphaned blocks. Rejected because the project does not currently use ESLint; introducing a full lint dependency for a single class of issue is disproportionate.

Test plan

  • npx jest — all existing tests pass (JSDoc-only change, no runtime effect)
  • npm run typecheck — compilation succeeds

Review checklist

  • Dedicated opus peer review: approved

The ConnectOptions JSDoc block was orphaned — it sat above Verbosity's
own JSDoc, so tooling attached Verbosity's block to Verbosity correctly
while the ConnectOptions block floated loose. Move it directly above
the ConnectOptions interface. Also merge the two adjacent JSDoc blocks
on MergeInner into a single block so the description is not silently
dropped by tooling that only reads the closest block.

Addresses FINDING-06 from code review.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Copy link
Copy Markdown
Owner Author

@feffef feffef left a comment

Choose a reason for hiding this comment

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

Opus Reviewer (on behalf of @feffef): LGTM — would approve if GitHub allowed self-approval. Verified the diff is a pure JSDoc repositioning on src/type-system.ts only. The Verbosity block now sits directly above export type Verbosity (line 117), the ConnectOptions block sits directly above export interface ConnectOptions (line 136), and the two MergeInner JSDoc blocks have been merged into one (with @internal inside) immediately above export type MergeInner (line 321). No non-JSDoc content changed, no JSDoc content (examples, @param tags, @see refs) was lost, and only src/type-system.ts is touched — no scope creep. Matches Approach A exactly.

@feffef feffef merged commit 43e3df1 into main Apr 17, 2026
6 checks passed
@feffef feffef deleted the fix/finding-06-type-system-jsdoc branch April 17, 2026 14:30
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