Skip to content

chore: clear Dependabot alerts + drop redundant type assertions#1444

Merged
obiot merged 3 commits into
masterfrom
chore/housekeeping-deps-lint
May 11, 2026
Merged

chore: clear Dependabot alerts + drop redundant type assertions#1444
obiot merged 3 commits into
masterfrom
chore/housekeeping-deps-lint

Conversation

@obiot
Copy link
Copy Markdown
Member

@obiot obiot commented May 11, 2026

Summary

Dependabot fixes

Alert Package Range Fix Severity
#157 fast-uri <3.1.1 3.1.2 high (path traversal)
#158 fast-uri <3.1.2 3.1.2 high (host confusion)
#156 postcss <8.5.10 8.5.14 medium (XSS)

Both are transitive (via serve / vite+vitest), no manifest changes required.

Lint cleanup

Locations touched (all auto-fixed by eslint --fix):

  • application.ts:415 — drop (cameras as unknown as Map<…>) cast
  • pointerevent.ts:194,204 — drop as EventListener on already-typed handlers
  • color.ts:223,413,423 — drop as ColorName / as Color on direct args

Pure cleanup. No runtime impact.

Test plan

  • pnpm -F melonjs build clean (0 errors, 115 pre-existing warnings)
  • CI green

🤖 Generated with Claude Code

obiot and others added 2 commits May 11, 2026 10:30
Bumps transitive devDeps to pull in patched versions:
- fast-uri 3.1.0 -> 3.1.2 (high: host confusion + path traversal)
- postcss 8.5.8 -> 8.5.14 (medium: XSS via unescaped </style>)

Also pulls in routine bumps for vitest 4.1.4 -> 4.1.5, eslint-related
plugins, turbo, lefthook. All devDeps, no melonjs runtime impact.

Closes Dependabot alerts #156, #157, #158.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…slint 8.59

The typescript-eslint bump tightens no-unnecessary-type-assertion. Six
assertions were always redundant — the target signature already accepts
the source type. Pure cleanup, no runtime impact.

- application.ts: drop (cameras as unknown as Map<string, Camera2d>) cast
- pointerevent.ts: drop `as EventListener` on already-typed handlers
- color.ts: drop `as ColorName` / `as Color` on direct string/Color args

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 11, 2026 02:30
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 updates the monorepo lockfile to pull in patched transitive dependencies (clearing Dependabot alerts) and removes a handful of redundant TypeScript type assertions that are now flagged by typescript-eslint’s no-unnecessary-type-assertion rule.

Changes:

  • Refreshed pnpm-lock.yaml to pick up patched transitive dependencies (notably fast-uri@3.1.2 and postcss@8.5.14).
  • Removed redundant type assertions in Application, pointer event registration, and Color parsing/cloning paths.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
pnpm-lock.yaml Updates resolved transitive versions to include security patches and minor toolchain bumps.
packages/melonjs/src/math/color.ts Drops unnecessary casts when passing strings to parseCSS() and when cloning via colorPool.
packages/melonjs/src/input/pointerevent.ts Removes redundant EventListener assertions when registering move listeners (direct and throttled).
packages/melonjs/src/application/application.ts Removes an unnecessary cast of current.cameras and uses the Map API directly.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

Comment thread packages/melonjs/src/input/pointerevent.ts
Addresses Copilot review on #1444: `throttle` was typed as
`(fn: () => void) => (...args: []) => void`, which forced an
`as unknown as () => void` cast at every non-zero-arg call site
(only one in core: the pointer-event throttled handler).

Switching to `<T extends unknown[]>(fn: (...args: T) => void)` preserves
the wrapped function's signature end-to-end, so callers like
`onMoveEvent(e: Event)` can be passed without casts.

Also bumps melonjs to 19.4.0 and adds the corresponding CHANGELOG entry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@obiot obiot merged commit f7f25bf into master May 11, 2026
6 checks passed
@obiot obiot deleted the chore/housekeeping-deps-lint branch May 11, 2026 07:42
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