fix: avoid no-control-regex lint error for ANSI strip pattern

Use RegExp constructor with String.raw to express \x1b without
a literal control character in the source, matching the pattern
used elsewhere in the codebase.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
arkon
2026-03-22 03:57:36 +01:00
co-authored by Claude Opus 4.6
parent de49437a6f
commit 6eb3969816
+1 -1
View File
@@ -1000,7 +1000,7 @@ export function registerSessionRoutes(
// Strip XML-like system/command tags and ANSI escapes from transcripts
text = text
.replace(/<[^>]+>/g, '')
.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, '')
.replace(new RegExp(String.raw`\x1b\[[0-9;]*[a-zA-Z]`, 'g'), '')
.trim()
.replace(/\s+/g, ' ');
if (!text) continue;