Skip to content

Commit 9d3a18b

Browse files
obiotclaude
andcommitted
Bump Biome 2.4, ESLint 10, TypeScript 6; fix lint and type errors
- Biome: 2.3.14 → 2.4.9 - ESLint: 9.x → 10.x (new no-useless-assignment rule) - TypeScript: 5.9 → 6.0 (requires explicit rootDir in tsconfig) - Fix all no-useless-assignment lint errors across the codebase - Fix TS6 globalThis indexing in platform.ts - Add rootDir to all tsconfig.build.json files - Add VertexArrayBuffer unit tests for push() and pushFloats() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5752182 commit 9d3a18b

25 files changed

Lines changed: 294 additions & 286 deletions

File tree

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@
2222
},
2323
"packageManager": "pnpm@10.32.1",
2424
"dependencies": {
25-
"@biomejs/biome": "2.3.14",
26-
"@eslint/js": "^9.39.4",
25+
"@biomejs/biome": "2.4.9",
26+
"@eslint/js": "^10.0.1",
2727
"@types/node": "^25.5.0",
2828
"@vitest/browser": "^4.1.2",
2929
"@vitest/browser-playwright": "^4.1.2",
30-
"eslint": "^9.39.4",
30+
"eslint": "^10.1.0",
3131
"eslint-plugin-jsdoc": "^62.8.1",
3232
"globals": "^17.4.0",
3333
"lefthook": "^2.1.4",
3434
"tsconfig": "workspace:^",
3535
"tsx": "^4.21.0",
3636
"turbo": "^2.8.21",
37-
"typescript": "^5.9.3",
37+
"typescript": "^6.0.2",
3838
"typescript-eslint": "^8.57.2",
3939
"vitest": "^4.1.2"
4040
},

packages/debug-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"melonjs": "workspace:*",
5252
"tsconfig": "workspace:*",
5353
"tsx": "^4.21.0",
54-
"typescript": "^5.9.3"
54+
"typescript": "^6.0.2"
5555
},
5656
"scripts": {
5757
"dev": "concurrently --raw \"pnpm build:watch\" \"pnpm tsc:watch\"",

packages/debug-plugin/tsconfig.build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "tsconfig/base.json",
33
"compilerOptions": {
4+
"rootDir": "src",
45
"declarationDir": "build",
56
"removeComments": false,
67
"declarationMap": true,

packages/examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"react-dom": "^19.2.4",
2222
"react-router-dom": "^7.13.2",
2323
"tsconfig": "workspace:^",
24-
"typescript": "^5.9.3",
24+
"typescript": "^6.0.2",
2525
"vite": "8.0.0"
2626
}
2727
}

packages/melonjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
"tsx": "^4.21.0",
7070
"type-fest": "^5.5.0",
7171
"typedoc": "^0.28.18",
72-
"typescript": "^5.9.3",
72+
"typescript": "^6.0.2",
7373
"vite": "8.0.0",
7474
"vite-plugin-glsl": "^1.5.6"
7575
},

packages/melonjs/src/geometries/path2d.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class Path2D {
8484
const pathCommands = svgPath.match(/([a-df-z])[^a-df-z]*/gi);
8585
const points = this.points;
8686
const startPoint = this.startPoint;
87-
let lastPoint = startPoint;
87+
let lastPoint;
8888

8989
this.beginPath();
9090

packages/melonjs/src/input/pointerevent.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ function dispatchEvent(normalizedEvents: Pointer[]): boolean {
335335
const region = handlers.region;
336336
const ancestor = region.ancestor;
337337
const bounds = region.getBounds();
338-
let eventInBounds = false;
339338

340339
if (region.isFloating === true) {
341340
pointer.gameX = pointer.gameLocalX = pointer.gameScreenX;
@@ -353,7 +352,7 @@ function dispatchEvent(normalizedEvents: Pointer[]): boolean {
353352
pointer.gameLocalY = pointer.gameY - parentBounds.y;
354353
}
355354

356-
eventInBounds = bounds.contains(pointer.gameX, pointer.gameY);
355+
const eventInBounds = bounds.contains(pointer.gameX, pointer.gameY);
357356

358357
switch (pointer.type) {
359358
case POINTER_MOVE[0]:

packages/melonjs/src/level/tiled/TMXTileMap.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,6 @@ export default class TMXTileMap {
455455
*/
456456
getObjects(flatten) {
457457
const objects = [];
458-
let isCollisionGroup = false;
459458
let targetContainer;
460459

461460
// parse the map for objects
@@ -465,7 +464,9 @@ export default class TMXTileMap {
465464
const group = this.objectGroups[g];
466465

467466
// check if this is the collision shape group
468-
isCollisionGroup = group.name.toLowerCase().includes(COLLISION_GROUP);
467+
const isCollisionGroup = group.name
468+
.toLowerCase()
469+
.includes(COLLISION_GROUP);
469470

470471
if (flatten === false) {
471472
// create a new container

packages/melonjs/src/loader/loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export let onload;
170170
* // use the LOADER_PROGRESS event instead
171171
* me.event.on(me.event.LOADER_PROGRESS, (progress, resource) => this.updateProgress(progress, resource));
172172
*/
173-
export let onProgress;
173+
export let onProgress; // eslint-disable-line no-unassigned-vars
174174

175175
/**
176176
* onError callback<br>

packages/melonjs/src/physics/quadtree.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,9 @@ export default class QuadTree {
237237
* @param {object} item - object to be added
238238
*/
239239
insert(item) {
240-
let index = -1;
241-
242240
//if we have subnodes ...
243241
if (this.nodes.length > 0) {
244-
index = this.getIndex(item);
242+
const index = this.getIndex(item);
245243

246244
if (index !== -1) {
247245
this.nodes[index].insert(item);
@@ -263,9 +261,9 @@ export default class QuadTree {
263261
//add all objects to their corresponding subnodes
264262
let writeIdx = 0;
265263
for (let i = 0, len = this.objects.length; i < len; i++) {
266-
index = this.getIndex(this.objects[i]);
267-
if (index !== -1) {
268-
this.nodes[index].insert(this.objects[i]);
264+
const subIndex = this.getIndex(this.objects[i]);
265+
if (subIndex !== -1) {
266+
this.nodes[subIndex].insert(this.objects[i]);
269267
} else {
270268
this.objects[writeIdx++] = this.objects[i];
271269
}

0 commit comments

Comments
 (0)