docs: fix @param names/types that contradict the function signatures#8813
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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._createTextureJSDoc params to match the(name, format, arrayLength, levels)signature (avoids swapped types in typings). - Corrected
XrViews.updateto documentxrViewsas an array ({XRView[]}) rather than a single view. - Updated
WebgpuXrBridgeJSDoc to match the intentionally-unused_frameparameter 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.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Four JSDoc
@paramblocks documented parameter names (and in two cases types) that don't match the actual function signatures, so the API reference and the emitted.d.tsdescribe the wrong thing. Surfaced by enablingjsdoc/check-param-names(currentlyoffin@playcanvas/eslint-config).Morph._createTexture— documentedlevelsbeforearrayLength, but the signature is(name, format, arrayLength, levels), so the two types were swapped (arrayLengthshown as{Array},levelsas{number}). Reordered to match.XrViews.update— documentedxrViewtyped{XRView}; the parameter isxrViewsand is iterated as an array, so corrected to{XRView[]} xrViews.WebgpuXrBridge.getFramebufferSize/getViewport— documentedframe; 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 insrc.Verification
jsdoc/check-param-names: 0 mismatches remaining (was 4) ✅npm run lint✅npm run build:types+npm run test:types✅ (themorph.jsreorder corrects the emitted.d.tsparam types)Checklist
🤖 Generated with Claude Code