The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 15:45 UTC
chore(lint): disable eslint/no-control-regex (#25049)
Julius Marminge committed
Oct 25, 2026 at 19:33 UTC
1cd44f0d555f6804e15a1d03e483039251164437
8 files changed
+8
-17
apps/mobile/src/features/terminal/terminalInput.ts
-1
@@ -10,7 +10,6 @@ export type ModifiedTerminalInput =
10
| { readonly kind: "write"; readonly data: string }
11
| { readonly kind: "paste" };
12
13
-// eslint-disable-next-line no-control-regex -- Pasted text must not carry raw terminal controls.
13
const UNSAFE_PASTE_BYTES = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g;
14
15
export function applyCtrlModifier(input: string): string {
apps/server/src/preview/ServerBrowserPage.ts
-1
@@ -174,7 +174,6 @@ export const withoutDataPayload = (url: string) => {
174
: ({ t: "\t", n: "\n", r: "\r", '"': '"', "\\": "\\" }[code] ?? "\u0001"),
175
)
176
.replace(/[\t\n\r]/g, "")
177
- // eslint-disable-next-line no-control-regex -- URL parsing ignores these controls.
177
.replace(/^[\u0000-\u0020]+/, "");
178
const parsed = /^data:([^,;]*)/i.exec(value);
179
if (!parsed) return url;
apps/server/src/process/externalLauncher.ts
-1
@@ -67,7 +67,6 @@ interface TargetPathAndPosition {
67
}
68
69
// cmd shims reparse %* after escaping is gone; newlines and quotes can expose shell operators.
70
-// oxlint-disable-next-line no-control-regex
70
const WINDOWS_SHIM_UNSAFE_ARG_PATTERN = /[\u0000-\u001f\u007f"]/;
71
const TARGET_WITH_POSITION_PATTERN = /^(.*?):(\d+)(?::(\d+))?$/;
72
const POWERSHELL_ARGUMENTS_PREFIX = [
apps/server/src/project/ProjectSetupScriptRunner.ts
+6
-10
@@ -127,16 +127,12 @@ function completionSentinelPattern(token: string): RegExp {
127
}
128
129
function stripTerminalControl(text: string): string {
130
- return (
131
- text
132
- .replace(
133
- // eslint-disable-next-line no-control-regex -- ANSI escape sequences start with ESC.
134
- /\x1b\[[0-9;?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[()][A-Za-z0-9]|\x1b[=>]/g,
135
- "",
136
- )
137
- // eslint-disable-next-line no-control-regex -- removing control characters is the point.
138
- .replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, "")
139
- );
130
+ return text
131
+ .replace(
132
+ /\x1b\[[0-9;?]*[ -/]*[@-~]|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\)|\x1b[()][A-Za-z0-9]|\x1b[=>]/g,
133
+ "",
134
+ )
135
+ .replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, "");
136
}
137
138
// Line editors (zsh, fish, bash 5.1+) enable bracketed paste when they start reading a command.
apps/server/src/terminal/Manager.ts
-2
@@ -1022,7 +1022,6 @@ function neutralizeInheritedHistory(history: string, maxLines: number, maxBytes:
1022
// An unconditional 1049 reset restores a stale saved cursor on the main
1023
// screen. The exit must match the inherited screen's cursor-save behavior.
1024
let alternateScreen: number | undefined;
1025
- // eslint-disable-next-line no-control-regex -- Match replayed alternate-screen controls.
1025
for (const match of history.matchAll(/\u001b(?:\[\?([0-9;]+)([hl])|(c))/gu)) {
1026
if (match[3]) alternateScreen = undefined;
1027
for (const parameter of (match[1] ?? "").split(";")) {
@@ -1120,7 +1119,6 @@ function findEscapeSequenceEndIndex(input: string, start: number): number | null
1119
return isEscapeFinalByte(input.charCodeAt(cursor)) ? cursor + 1 : start + 1;
1120
}
1121
1123
-// eslint-disable-next-line no-control-regex -- Terminal sequence introducers must reach the parser.
1122
const HISTORY_SEQUENCE_START = /[\u001b\u0090\u009b\u009d\u009e\u009f]/;
1123
const NEXT_HISTORY_SEQUENCE_START = new RegExp(HISTORY_SEQUENCE_START.source, "g");
1124
packages/client-runtime/src/work-log/commandLabel.ts
-1
@@ -1361,7 +1361,6 @@ export function commandProgramName(command: string, depth = 0): string | null {
1361
// Escape bytes and other control characters render as invisible gaps; display
1362
// shows them as Unicode control pictures (ESC becomes ␛) instead. Tab, newline
1363
// and carriage return lay out as whitespace, so CRLF scripts stay unmarked.
1364
-// oxlint-disable-next-line no-control-regex
1364
const CONTROL_CHARACTERS = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/gu;
1365
1366
export function commandDisplayText(command: string): string {
packages/shared/src/promptLinks.ts
+1
-1
@@ -36,7 +36,7 @@ export type PromptLinkResult<T> =
36
37
// Hidden characters let models read instructions invisible to the person reviewing the prompt.
38
const HIDDEN_CHARACTERS =
39
- // oxlint-disable-next-line no-control-regex, no-misleading-character-class -- these are the characters it removes.
39
+ // oxlint-disable-next-line no-misleading-character-class -- these are the characters it removes.
40
/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F\u00AD\u034F\u061C\u115F\u1160\u17B4\u17B5\u180B-\u180F\u200B\u200C\u200E\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0D\uFEFF\uFFA0\uFFF0-\uFFFB\u{1BCA0}-\u{1BCA3}\u{1D173}-\u{1D17A}\u{E0000}-\u{E0FFF}]/gu;
41
// Numeric emoji ranges because Hermes lacks Unicode property escapes.
42
const isEmojiPart = (codePoint: number | undefined) =>
vite.config.ts
+1
@@ -216,6 +216,7 @@ export default defineConfig({
216
perf: "warn",
217
},
218
rules: {
219
+ "eslint/no-control-regex": "off",
220
"typescript/no-this-alias": "off",
221
"unicorn/prefer-add-event-listener": "off",
222
"unicorn/prefer-string-starts-ends-with": "off",