Skip to content

docs: fix @param names/types that contradict the function signatures#8813

Merged
willeastcott merged 1 commit into
mainfrom
docs/fix-param-name-mismatches
May 30, 2026
Merged

docs: fix @param names/types that contradict the function signatures#8813
willeastcott merged 1 commit into
mainfrom
docs/fix-param-name-mismatches

Conversation

@willeastcott
Copy link
Copy Markdown
Contributor

Description

Four JSDoc @param blocks documented parameter names (and in two cases types) that don't match the actual function signatures, so the API reference and the emitted .d.ts describe the wrong thing. Surfaced by enabling jsdoc/check-param-names (currently off in @playcanvas/eslint-config).

  • Morph._createTexture — documented levels before arrayLength, but the signature is (name, format, arrayLength, levels), so the two types were swapped (arrayLength shown as {Array}, levels as {number}). Reordered to match.
  • XrViews.update — documented xrView typed {XRView}; the parameter is xrViews and is iterated as an array, so corrected to {XRView[]} xrViews.
  • WebgpuXrBridge.getFramebufferSize / getViewport — documented frame; the parameter is the intentionally-unused _frame. Matched the docs to the real name.

How these were found

Ran eslint src --rule '{"jsdoc/check-param-names":"error"}' as a one-off discovery pass; these were the only 4 mismatches in src.

Verification

  • jsdoc/check-param-names: 0 mismatches remaining (was 4) ✅
  • npm run lint
  • npm run build:types + npm run test:types ✅ (the morph.js reorder corrects the emitted .d.ts param types)

Checklist

  • I have read the contributing guidelines
  • My code follows the project's coding standards
  • This PR focuses on a single change

🤖 Generated with Claude Code

Four JSDoc `@param` blocks documented names (and in two cases types) that
did not match the actual parameters, surfaced by enabling jsdoc/check-param-names
(currently off in the shared config):

- `Morph._createTexture` documented `levels` before `arrayLength`, but the
  signature is `(name, format, arrayLength, levels)` - so the emitted types were
  swapped (`arrayLength` as `{Array}`, `levels` as `{number}`). Reordered to match.
- `XrViews.update` documented `xrView` (`{XRView}`); the parameter is `xrViews`
  and is iterated as an array, so corrected to `{XRView[]} xrViews`.
- `WebgpuXrBridge.getFramebufferSize` / `getViewport` documented `frame`; the
  parameter is the intentionally-unused `_frame`. Matched the docs to it.

Verified: jsdoc/check-param-names reports 0 mismatches, lint clean,
build:types/test:types pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes JSDoc @param blocks whose parameter names and/or types contradicted the actual function signatures, ensuring the generated API reference and emitted .d.ts match runtime behavior.

Changes:

  • Reordered Morph._createTexture JSDoc params to match the (name, format, arrayLength, levels) signature (avoids swapped types in typings).
  • Corrected XrViews.update to document xrViews as an array ({XRView[]}) rather than a single view.
  • Updated WebgpuXrBridge JSDoc to match the intentionally-unused _frame parameter name.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/scene/morph.js Aligns _createTexture JSDoc param order with the real signature to prevent incorrect generated param typings.
src/platform/graphics/webgpu/webgpu-xr-bridge.js Matches JSDoc parameter name to _frame for getFramebufferSize / getViewport.
src/framework/xr/xr-views.js Fixes update JSDoc to correctly document an array of XRView objects.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@willeastcott willeastcott merged commit df7a4bf into main May 30, 2026
9 checks passed
@willeastcott willeastcott deleted the docs/fix-param-name-mismatches branch May 30, 2026 16:22
mvaligursky pushed a commit that referenced this pull request Jun 3, 2026
…8813)

Four JSDoc `@param` blocks documented names (and in two cases types) that
did not match the actual parameters, surfaced by enabling jsdoc/check-param-names
(currently off in the shared config):

- `Morph._createTexture` documented `levels` before `arrayLength`, but the
  signature is `(name, format, arrayLength, levels)` - so the emitted types were
  swapped (`arrayLength` as `{Array}`, `levels` as `{number}`). Reordered to match.
- `XrViews.update` documented `xrView` (`{XRView}`); the parameter is `xrViews`
  and is iterated as an array, so corrected to `{XRView[]} xrViews`.
- `WebgpuXrBridge.getFramebufferSize` / `getViewport` documented `frame`; the
  parameter is the intentionally-unused `_frame`. Matched the docs to it.

Verified: jsdoc/check-param-names reports 0 mismatches, lint clean,
build:types/test:types pass.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants