From 1bd68327f37c95c8edd6c8e9008e4bb570262a4f Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Sun, 1 Feb 2026 00:25:49 +0100 Subject: [PATCH] fix: make pre-commit hook fail on lint warnings, fix template literal warnings - Add --error-on-warnings to biome check in root and web-ui package.json - Convert string concatenation to template literals in daxnuts.ts - Convert string concatenation to template literals in test file Fixes #1103 --- package.json | 2 +- .../coding-agent/src/modes/interactive/components/daxnuts.ts | 2 +- .../test/bug-regression-isimageline-startswith-bug.test.ts | 4 ++-- packages/web-ui/package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 8aed2df9..a28356b5 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "build": "cd packages/tui && npm run build && cd ../ai && npm run build && cd ../agent && npm run build && cd ../coding-agent && npm run build && cd ../mom && npm run build && cd ../web-ui && npm run build && cd ../pods && npm run build", "dev": "concurrently --names \"ai,agent,coding-agent,mom,web-ui,tui\" --prefix-colors \"cyan,yellow,red,white,green,magenta\" \"cd packages/ai && npm run dev\" \"cd packages/agent && npm run dev\" \"cd packages/coding-agent && npm run dev\" \"cd packages/mom && npm run dev\" \"cd packages/web-ui && npm run dev\" \"cd packages/tui && npm run dev\"", "dev:tsc": "concurrently --names \"ai,web-ui\" --prefix-colors \"cyan,green\" \"cd packages/ai && npm run dev:tsc\" \"cd packages/web-ui && npm run dev:tsc\"", - "check": "biome check --write . && tsgo --noEmit && cd packages/web-ui && npm run check", + "check": "biome check --write --error-on-warnings . && tsgo --noEmit && cd packages/web-ui && npm run check", "test": "npm run test --workspaces --if-present", "version:patch": "npm version patch -ws --no-git-tag-version && node scripts/sync-versions.js && rm -rf node_modules packages/*/node_modules package-lock.json && npm install", "version:minor": "npm version minor -ws --no-git-tag-version && node scripts/sync-versions.js && rm -rf node_modules packages/*/node_modules package-lock.json && npm install", diff --git a/packages/coding-agent/src/modes/interactive/components/daxnuts.ts b/packages/coding-agent/src/modes/interactive/components/daxnuts.ts index 3e6f12b1..54170c27 100644 --- a/packages/coding-agent/src/modes/interactive/components/daxnuts.ts +++ b/packages/coding-agent/src/modes/interactive/components/daxnuts.ts @@ -46,7 +46,7 @@ function buildImage(): string[] { for (let x = 0; x < WIDTH; x++) { const top = pixels[row][x]; const bottom = pixels[row + 1]?.[x] ?? top; - line += rgb(bottom[0], bottom[1], bottom[2]) + rgb(top[0], top[1], top[2], true) + "▄"; + line += `${rgb(bottom[0], bottom[1], bottom[2])}${rgb(top[0], top[1], top[2], true)}▄`; } line += RESET; lines.push(line); diff --git a/packages/tui/test/bug-regression-isimageline-startswith-bug.test.ts b/packages/tui/test/bug-regression-isimageline-startswith-bug.test.ts index 2ab162ac..ff15d18f 100644 --- a/packages/tui/test/bug-regression-isimageline-startswith-bug.test.ts +++ b/packages/tui/test/bug-regression-isimageline-startswith-bug.test.ts @@ -76,7 +76,7 @@ describe("Bug regression: isImageLine() crash with image escape sequences", () = "Suffix text \x1b_Ga=T,data...\x1b\\ suffix", "Middle \x1b_Ga=T,data...\x1b\\ more text", // Very long line (simulating 300KB+ crash scenario) - "Text before " + "\x1b_Ga=T,f=100" + "A".repeat(300000) + " text after", + `Text before \x1b_Ga=T,f=100${"A".repeat(300000)} text after`, ]; for (const line of scenarios) { @@ -93,7 +93,7 @@ describe("Bug regression: isImageLine() crash with image escape sequences", () = "Suffix text \x1b]1337;File=inline=1:data==\x07 suffix", "Middle \x1b]1337;File=inline=1:data==\x07 more text", // Very long line (simulating 304KB crash scenario) - "Text before " + "\x1b]1337;File=size=800,600;inline=1:" + "B".repeat(300000) + " text after", + `Text before \x1b]1337;File=size=800,600;inline=1:${"B".repeat(300000)} text after`, ]; for (const line of scenarios) { diff --git a/packages/web-ui/package.json b/packages/web-ui/package.json index 3618a503..68739518 100644 --- a/packages/web-ui/package.json +++ b/packages/web-ui/package.json @@ -14,7 +14,7 @@ "build": "tsgo -p tsconfig.build.json && tailwindcss -i ./src/app.css -o ./dist/app.css --minify", "dev": "concurrently --names \"build,example\" --prefix-colors \"cyan,green\" \"tsc -p tsconfig.build.json --watch --preserveWatchOutput\" \"tailwindcss -i ./src/app.css -o ./dist/app.css --watch\" \"npm run dev --prefix example\"", "dev:tsc": "concurrently --names \"build\" --prefix-colors \"cyan\" \"tsc -p tsconfig.build.json --watch --preserveWatchOutput\" \"tailwindcss -i ./src/app.css -o ./dist/app.css --watch\"", - "check": "biome check --write . && tsc --noEmit && cd example && biome check --write . && tsc --noEmit" + "check": "biome check --write --error-on-warnings . && tsc --noEmit && cd example && biome check --write --error-on-warnings . && tsc --noEmit" }, "dependencies": { "@lmstudio/sdk": "^1.5.0",