Skip to content

Commit 86ee140

Browse files
chore(lint): disable eslint/no-control-regex
1 parent 18daf8d commit 86ee140

8 files changed

Lines changed: 8 additions & 17 deletions

File tree

‎apps/mobile/src/features/terminal/terminalInput.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export type ModifiedTerminalInput =
1010
| { readonly kind: "write"; readonly data: string }
1111
| { readonly kind: "paste" };
1212

13-
// eslint-disable-next-line no-control-regex -- Pasted text must not carry raw terminal controls.
1413
const UNSAFE_PASTE_BYTES = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g;
1514

1615
export function applyCtrlModifier(input: string): string {

‎apps/server/src/preview/ServerBrowserPage.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@ export const withoutDataPayload = (url: string) => {
174174
: ({ t: "\t", n: "\n", r: "\r", '"': '"', "\\": "\\" }[code] ?? "\u0001"),
175175
)
176176
.replace(/[\t\n\r]/g, "")
177-
// eslint-disable-next-line no-control-regex -- URL parsing ignores these controls.
178177
.replace(/^[\u0000-\u0020]+/, "");
179178
const parsed = /^data:([^,;]*)/i.exec(value);
180179
if (!parsed) return url;

‎apps/server/src/process/externalLauncher.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ interface TargetPathAndPosition {
6767
}
6868

6969
// cmd shims reparse %* after escaping is gone; newlines and quotes can expose shell operators.
70-
// oxlint-disable-next-line no-control-regex
7170
const WINDOWS_SHIM_UNSAFE_ARG_PATTERN = /[\u0000-\u001f\u007f"]/;
7271
const TARGET_WITH_POSITION_PATTERN = /^(.*?):(\d+)(?::(\d+))?$/;
7372
const POWERSHELL_ARGUMENTS_PREFIX = [

‎apps/server/src/project/ProjectSetupScriptRunner.ts‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,12 @@ function completionSentinelPattern(token: string): RegExp {
127127
}
128128

129129
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, "");
140136
}
141137

142138
// Line editors (zsh, fish, bash 5.1+) enable bracketed paste when they start reading a command.

‎apps/server/src/terminal/Manager.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,6 @@ function neutralizeInheritedHistory(history: string, maxLines: number, maxBytes:
10221022
// An unconditional 1049 reset restores a stale saved cursor on the main
10231023
// screen. The exit must match the inherited screen's cursor-save behavior.
10241024
let alternateScreen: number | undefined;
1025-
// eslint-disable-next-line no-control-regex -- Match replayed alternate-screen controls.
10261025
for (const match of history.matchAll(/\u001b(?:\[\?([0-9;]+)([hl])|(c))/gu)) {
10271026
if (match[3]) alternateScreen = undefined;
10281027
for (const parameter of (match[1] ?? "").split(";")) {
@@ -1120,7 +1119,6 @@ function findEscapeSequenceEndIndex(input: string, start: number): number | null
11201119
return isEscapeFinalByte(input.charCodeAt(cursor)) ? cursor + 1 : start + 1;
11211120
}
11221121

1123-
// eslint-disable-next-line no-control-regex -- Terminal sequence introducers must reach the parser.
11241122
const HISTORY_SEQUENCE_START = /[\u001b\u0090\u009b\u009d\u009e\u009f]/;
11251123
const NEXT_HISTORY_SEQUENCE_START = new RegExp(HISTORY_SEQUENCE_START.source, "g");
11261124

‎packages/client-runtime/src/work-log/commandLabel.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,6 @@ export function commandProgramName(command: string, depth = 0): string | null {
13611361
// Escape bytes and other control characters render as invisible gaps; display
13621362
// shows them as Unicode control pictures (ESC becomes ␛) instead. Tab, newline
13631363
// and carriage return lay out as whitespace, so CRLF scripts stay unmarked.
1364-
// oxlint-disable-next-line no-control-regex
13651364
const CONTROL_CHARACTERS = /[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/gu;
13661365

13671366
export function commandDisplayText(command: string): string {

‎packages/shared/src/promptLinks.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export type PromptLinkResult<T> =
3636

3737
// Hidden characters let models read instructions invisible to the person reviewing the prompt.
3838
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.
4040
/[\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;
4141
// Numeric emoji ranges because Hermes lacks Unicode property escapes.
4242
const isEmojiPart = (codePoint: number | undefined) =>

‎vite.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export default defineConfig({
216216
perf: "warn",
217217
},
218218
rules: {
219+
"eslint/no-control-regex": "off",
219220
"typescript/no-this-alias": "off",
220221
"unicorn/prefer-add-event-listener": "off",
221222
"unicorn/prefer-string-starts-ends-with": "off",

0 commit comments

Comments
 (0)