Fix JSDoc typos and grammar across codebase#1299
Conversation
Fix 74 typos and grammar issues across 32 files including:
- Misspelled words: objecf, reprensenting, bouciness, successfull,
volumee, compatiblity, temporarly, recursivly, remderer, srite,
ressources, Substract, initalize, retreive, strech, Accelerometor
- Grammar: "a/an" misuse, "childs" → "children", "his" → "its",
missing verbs, doubled words ("renderer renderer")
- Missing closing quotes in textBaseline JSDoc values
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR improves documentation quality in melonjs by fixing typos and grammar issues in JSDoc/comments across a broad set of engine modules (renderers, math, physics, loader, audio, etc.), helping keep generated docs and inline developer guidance accurate.
Changes:
- Corrects misspellings and grammar in JSDoc/comments across many source files.
- Fixes quoted-value lists in text baseline JSDoc to avoid malformed documentation strings.
- Cleans up a handful of misleading/incorrect words in examples and explanatory comments.
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/melonjs/src/video/webgl/webgl_renderer.js | JSDoc typo/grammar fixes in renderer docs. |
| packages/melonjs/src/video/webgl/batchers/quad_batcher.js | Comment grammar fix (TypeError article). |
| packages/melonjs/src/video/canvas/canvas_renderer.js | JSDoc typo/grammar fixes mirroring WebGL renderer docs. |
| packages/melonjs/src/utils/array.ts | JSDoc grammar fixes for random/weightedRandom. |
| packages/melonjs/src/system/device.js | Comment spelling fixes (“resources”, “Accelerometer”). |
| packages/melonjs/src/renderable/ui/uitextbutton.js | Fixes malformed quoted list in textBaseline JSDoc. |
| packages/melonjs/src/renderable/text/text.js | Fixes malformed quoted list + comment typo (“initialize”). |
| packages/melonjs/src/renderable/text/bitmaptext.js | Comment fixes (“world container”, “retrieve”, quoted list). |
| packages/melonjs/src/renderable/sprite.js | Comment spelling fixes in animation/draw docs. |
| packages/melonjs/src/renderable/renderable.js | Comment spelling fixes (“temporarily”, “collision”). |
| packages/melonjs/src/renderable/nineslicesprite.js | Comment spelling fix (“stretch”). |
| packages/melonjs/src/renderable/imagelayer.js | Comment spelling fix (“compatibility”). |
| packages/melonjs/src/renderable/container.js | Multiple comment fixes (“children”, “deferred”, etc.). |
| packages/melonjs/src/plugin/plugin.js | JSDoc spelling fix (“retrieve”). |
| packages/melonjs/src/physics/world.js | Comment fix (“children”). |
| packages/melonjs/src/physics/quadtree.js | Comment fix (“recursively”, “children”). |
| packages/melonjs/src/physics/body.js | Multiple comment spelling/grammar fixes in physics docs. |
| packages/melonjs/src/particles/settings.js | Comment grammar fix (“a white”). |
| packages/melonjs/src/particles/emitter.js | Comment grammar fix (“an explosion”). |
| packages/melonjs/src/math/vector3d.ts | JSDoc wording correction (“Subtract … from”). |
| packages/melonjs/src/math/vector2d.ts | JSDoc wording correction (“Subtract … from”). |
| packages/melonjs/src/math/observableVector3d.ts | JSDoc wording correction (“Subtract … from”). |
| packages/melonjs/src/math/observableVector2d.ts | JSDoc wording correction (“Subtract … from”). |
| packages/melonjs/src/math/color.ts | Comment grammar fix (“a Float Array”). |
| packages/melonjs/src/loader/loader.js | Comment spelling fixes (“resources”). |
| packages/melonjs/src/level/level.js | Comment spelling fixes (“resources”). |
| packages/melonjs/src/geometries/polygon.ts | JSDoc spelling fixes (“vertices”, “object”, “shape”). |
| packages/melonjs/src/geometries/line.ts | JSDoc spelling fix (“object chaining”). |
| packages/melonjs/src/geometries/ellipse.ts | JSDoc spelling fix (“object chaining”). |
| packages/melonjs/src/camera/camera2d.js | Comment spelling fixes (“compatibility”, “visible”). |
| packages/melonjs/src/audio/audio.js | Comment spelling/grammar fixes (“successful”, “volumes”, articles). |
| packages/melonjs/src/application/application.js | Comment spelling/grammar fixes (renderer wording, “losing”, “Additionally”). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| throw new Error( | ||
| child + | ||
| " Both the supplied childs must be a child of the caller " + | ||
| " Both the supplied children must be a child of the caller " + |
There was a problem hiding this comment.
Error message grammar is still inconsistent: it says "children" but then "must be a child". Consider rephrasing (e.g., "Both supplied children must be children of the caller") to keep the message clear.
| " Both the supplied children must be a child of the caller " + | |
| " and " + | |
| child2 + | |
| " must both be children of the caller " + |
| /** | ||
| * set the body as a static body | ||
| * static body do not move automatically and do not check againt collision with others | ||
| * static body do not move automatically and do not check against collision with others |
There was a problem hiding this comment.
Docstring grammar: "static body do not" should be "a static body does not" (or "static bodies do not") for correct subject/verb agreement.
| * static body do not move automatically and do not check against collision with others | |
| * A static body does not move automatically and does not check against collision with others |
| * this.body.setMaxVelocity(3, 15); | ||
| * | ||
| * // apply a postive or negative force when pressing left of right key | ||
| * // apply a positive or negative force when pressing left of right key |
There was a problem hiding this comment.
Docstring grammar: "pressing left of right key" should be "left or right".
| * // apply a positive or negative force when pressing left of right key | |
| * // apply a positive or negative force when pressing left or right key |
| * // can do this with atlas values as well: | ||
| * this.addAnimation("turn", [{ name: "turnone", delay: 200 }, { name: "turntwo", delay: 100 }]) | ||
| * // define an dying animation that stop on the last frame | ||
| * // define a dying animation that stop on the last frame |
There was a problem hiding this comment.
Docstring grammar: "animation that stop" should be "animation that stops" (or rephrase to "stops on the last frame").
| * // define a dying animation that stop on the last frame | |
| * // define a dying animation that stops on the last frame |
| * @see {@link playTrack} | ||
| * @example | ||
| * // play a awesome music | ||
| * // play an awesome music |
There was a problem hiding this comment.
Docstring grammar: "play an awesome music" is still ungrammatical ("music" is uncountable). Consider "play awesome music" or "play an awesome track".
| * // play an awesome music | |
| * // play awesome music |
|
|
||
| /** | ||
| * a level manager. once ressources loaded, the level manager contains all references of defined levels. | ||
| * a level manager. once resources loaded, the level manager contains all references of defined levels. |
There was a problem hiding this comment.
Docstring grammar: "once resources loaded" is missing a verb. Consider "once resources are loaded".
| * a level manager. once resources loaded, the level manager contains all references of defined levels. | |
| * a level manager. once resources are loaded, the level manager contains all references of defined levels. |
Summary
Fix 74 typos and grammar issues across 32 source files.
Includes:
objecf,reprensenting,bouciness,successfull,volumee,compatiblity,temporarly,recursivly,remderer,srite,ressources,Substract,initalize,retreive,strech,Accelerometor, and moreTest plan
🤖 Generated with Claude Code