Skip to content

Fix JSDoc typos and grammar across codebase#1299

Merged
obiot merged 1 commit intomasterfrom
chore/jsdoc-typos
Mar 22, 2026
Merged

Fix JSDoc typos and grammar across codebase#1299
obiot merged 1 commit intomasterfrom
chore/jsdoc-typos

Conversation

@obiot
Copy link
Member

@obiot obiot commented Mar 22, 2026

Summary

Fix 74 typos and grammar issues across 32 source files.

Includes:

  • Misspelled words: objecf, reprensenting, bouciness, successfull, volumee, compatiblity, temporarly, recursivly, remderer, srite, ressources, Substract, initalize, retreive, strech, Accelerometor, and more
  • Grammar fixes: "a/an" misuse, "childs" → "children", "his" → "its", missing verbs, doubled words
  • Missing closing quotes in textBaseline JSDoc values

Test plan

  • All 1314 tests pass

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings March 22, 2026 04:47
Copy link
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 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 " +
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
" Both the supplied children must be a child of the caller " +
" and " +
child2 +
" must both be children of the caller " +

Copilot uses AI. Check for mistakes.
/**
* 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
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

Docstring grammar: "static body do not" should be "a static body does not" (or "static bodies do not") for correct subject/verb agreement.

Suggested change
* 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

Copilot uses AI. Check for mistakes.
* 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
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

Docstring grammar: "pressing left of right key" should be "left or right".

Suggested change
* // apply a positive or negative force when pressing left of right key
* // apply a positive or negative force when pressing left or right key

Copilot uses AI. Check for mistakes.
* // 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
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

Docstring grammar: "animation that stop" should be "animation that stops" (or rephrase to "stops on the last frame").

Suggested change
* // define a dying animation that stop on the last frame
* // define a dying animation that stops on the last frame

Copilot uses AI. Check for mistakes.
* @see {@link playTrack}
* @example
* // play a awesome music
* // play an awesome music
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

Docstring grammar: "play an awesome music" is still ungrammatical ("music" is uncountable). Consider "play awesome music" or "play an awesome track".

Suggested change
* // play an awesome music
* // play awesome music

Copilot uses AI. Check for mistakes.

/**
* 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.
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

Docstring grammar: "once resources loaded" is missing a verb. Consider "once resources are loaded".

Suggested change
* 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.

Copilot uses AI. Check for mistakes.
@obiot obiot merged commit 60a7a1f into master Mar 22, 2026
12 checks passed
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